| 1 | // for finding memory leaks in debug mode with Visual Studio cxx . . $ `<file>/src/pt2_textedit.c`/ |
| 2 | #if defined _DEBUG && defined _MSC_VER |
| 3 | #include <crtdbg.h> |
| 4 | #endif |
| 5 | |
| 6 | #include <stdint.h> |
| 7 | #include <stdbool.h> |
| 8 | #include <string.h> |
| 9 | #include <ctype.h> |
| 10 | #include "pt2_textout.h"cxx . . $ `<file>/src/pt2_textout.h`/ |
| 11 | #include "pt2_visuals.h"cxx . . $ `<file>/src/pt2_visuals.h`/ |
| 12 | #include "pt2_helpers.h"cxx . . $ `<file>/src/pt2_helpers.h`/ |
| 13 | #include "pt2_replayer.h"cxx . . $ `<file>/src/pt2_replayer.h`/ |
| 14 | #include "pt2_bmp.h"cxx . . $ `<file>/src/pt2_bmp.h`/ |
| 15 | #include "pt2_mouse.h"cxx . . $ `<file>/src/pt2_mouse.h`/ |
| 16 | #include "pt2_edit.h"cxx . . $ `<file>/src/pt2_edit.h`/ |
| 17 | #include "pt2_config.h"cxx . . $ `<file>/src/pt2_config.h`/ |
| 18 | #include "pt2_diskop.h"cxx . . $ `<file>/src/pt2_diskop.h`/ |
| 19 | #include "pt2_sampler.h"cxx . . $ `<file>/src/pt2_sampler.h`/ |
| 20 | #include "pt2_audio.h"cxx . . $ `<file>/src/pt2_audio.h`/ |
| 21 | #include "pt2_chordmaker.h"cxx . . $ `<file>/src/pt2_chordmaker.h`/ |
| 22 | #include "pt2_textedit.h"cxx . . $ `<file>/src/pt2_textedit.h`/ |
| 23 | |
| 24 | // PATH_MAX is the absolute longest editable string possible |
| 25 | static char oldTextcxx . . $ oldText.[PATH_MAXcxx . . $ `<external>/6347054901304145714/limits.h:13:9`!+2]; |
| 26 | static uint32_tcxx . . $ uint32_t# oldTextLengthcxx . . $ oldTextLength.; |
| 27 | |
| 28 | void renderTextEditCursorcxx . . $ renderTextEditCursor(49f6e7a06ebc5aa8).(void) |
| 29 | { |
| 30 | if (!uicxx . . $ ui..editTextFlagcxx . . $ ui_t#editTextFlag.) |
| 31 | return; |
| 32 | |
| 33 | const int32_tcxx . . $ int32_t# x = textEditcxx . . $ textEdit..cursorStartXcxx . . $ textEdit_t#cursorStartX. + (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. * FONT_CHAR_Wcxx . . $ `src/pt2_header.h:70:9`!); |
| 34 | const int32_tcxx . . $ int32_t# y = textEditcxx . . $ textEdit..cursorStartYcxx . . $ textEdit_t#cursorStartY.; |
| 35 | const int32_tcxx . . $ int32_t# w = 7; |
| 36 | const int32_tcxx . . $ int32_t# h = 2; |
| 37 | |
| 38 | if (x < 0 || x+w >= SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! || y < 0 || y+h >= SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`!) |
| 39 | return; |
| 40 | |
| 41 | fillRectcxx . . $ fillRect(6fb2c7d311165c4f).(x, y, w, h, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_TEXTMARKcxx . . $ PAL_TEXTMARK.]); |
| 42 | } |
| 43 | |
| 44 | void removeTextEditCursorcxx . . $ removeTextEditCursor(49f6e7a06ebc5aa8).(void) |
| 45 | { |
| 46 | if (!uicxx . . $ ui..editTextFlagcxx . . $ ui_t#editTextFlag.) |
| 47 | return; |
| 48 | |
| 49 | const int32_tcxx . . $ int32_t# x = textEditcxx . . $ textEdit..cursorStartXcxx . . $ textEdit_t#cursorStartX. + (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. * FONT_CHAR_Wcxx . . $ `src/pt2_header.h:70:9`!); |
| 50 | const int32_tcxx . . $ int32_t# y = textEditcxx . . $ textEdit..cursorStartYcxx . . $ textEdit_t#cursorStartY.; |
| 51 | const int32_tcxx . . $ int32_t# w = 7; |
| 52 | const int32_tcxx . . $ int32_t# h = 2; |
| 53 | |
| 54 | if (x < 0 || x+w >= SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! || y < 0 || y+h >= SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`!) |
| 55 | return; |
| 56 | |
| 57 | if (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_PE_PATTcxx . . $ PTB_PE_PATT. || textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_PE_PATTNAMEcxx . . $ PTB_PE_PATTNAME.) |
| 58 | { |
| 59 | // position editor text editing needs different handling |
| 60 | |
| 61 | // rewrite border pixels (below second row of text edit cursor) |
| 62 | hLinecxx . . $ hLine(78a5fb7015678ec5).(x, y, w, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKG2cxx . . $ PAL_GENBKG2.]); |
| 63 | |
| 64 | uicxx . . $ ui..updatePosEdcxx . . $ ui_t#updatePosEd. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; // this also erases the first row of the text edit cursor |
| 65 | } |
| 66 | else |
| 67 | { |
| 68 | // all others |
| 69 | fillRectcxx . . $ fillRect(6fb2c7d311165c4f).(x, y, w, h, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | static void moveTextCursorLeftcxx . . $ moveTextCursorLeft(49f6e7a06ebc5aa8).(void) |
| 74 | { |
| 75 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. > 0) |
| 76 | { |
| 77 | removeTextEditCursorcxx . . $ removeTextEditCursor(49f6e7a06ebc5aa8).(); |
| 78 | textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock.--; |
| 79 | renderTextEditCursorcxx . . $ renderTextEditCursor(49f6e7a06ebc5aa8).(); |
| 80 | } |
| 81 | else if (textEditcxx . . $ textEdit..scrollablecxx . . $ textEdit_t#scrollable.) |
| 82 | { |
| 83 | if (textEditcxx . . $ textEdit..scrollOffsetcxx . . $ textEdit_t#scrollOffset. > 0) |
| 84 | { |
| 85 | textEditcxx . . $ textEdit..scrollOffsetcxx . . $ textEdit_t#scrollOffset.--; |
| 86 | |
| 87 | if (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_DO_DATAPATHcxx . . $ PTB_DO_DATAPATH.) |
| 88 | uicxx . . $ ui..updateDiskOpPathTextcxx . . $ ui_t#updateDiskOpPathText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 89 | else if (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_PE_PATTNAMEcxx . . $ PTB_PE_PATTNAME.) |
| 90 | uicxx . . $ ui..updatePosEdcxx . . $ ui_t#updatePosEd. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 91 | } |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | static void moveTextCursorRightcxx . . $ moveTextCursorRight(49f6e7a06ebc5aa8).(void) |
| 96 | { |
| 97 | if (textEditcxx . . $ textEdit..typecxx . . $ textEdit_t#type. == TEXT_EDIT_STRINGcxx . . $ TEXT_EDIT_STRING.) |
| 98 | { |
| 99 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. < textEditcxx . . $ textEdit..numBlockscxx . . $ textEdit_t#numBlocks.-1) |
| 100 | { |
| 101 | removeTextEditCursorcxx . . $ removeTextEditCursor(49f6e7a06ebc5aa8).(); |
| 102 | textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock.++; |
| 103 | renderTextEditCursorcxx . . $ renderTextEditCursor(49f6e7a06ebc5aa8).(); |
| 104 | } |
| 105 | else if (textEditcxx . . $ textEdit..scrollablecxx . . $ textEdit_t#scrollable.) |
| 106 | { |
| 107 | if (textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr. <= textEditcxx . . $ textEdit..textEndPtrcxx . . $ textEdit_t#textEndPtr.) |
| 108 | { |
| 109 | textEditcxx . . $ textEdit..scrollOffsetcxx . . $ textEdit_t#scrollOffset.++; |
| 110 | |
| 111 | if (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_DO_DATAPATHcxx . . $ PTB_DO_DATAPATH.) |
| 112 | uicxx . . $ ui..updateDiskOpPathTextcxx . . $ ui_t#updateDiskOpPathText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 113 | else if (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_PE_PATTNAMEcxx . . $ PTB_PE_PATTNAME.) |
| 114 | uicxx . . $ ui..updatePosEdcxx . . $ ui_t#updatePosEd. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | else |
| 119 | { |
| 120 | // we end up here when entering a number/hex digit |
| 121 | |
| 122 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. < textEditcxx . . $ textEdit..numDigitscxx . . $ textEdit_t#numDigits.) |
| 123 | removeTextEditCursorcxx . . $ removeTextEditCursor(49f6e7a06ebc5aa8).(); |
| 124 | |
| 125 | textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock.++; |
| 126 | |
| 127 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. < textEditcxx . . $ textEdit..numDigitscxx . . $ textEdit_t#numDigits.) |
| 128 | renderTextEditCursorcxx . . $ renderTextEditCursor(49f6e7a06ebc5aa8).(); |
| 129 | |
| 130 | // don't clamp now, textEdit.cursorBlock is tested elsewhere |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | void editTextPrevCharcxx . . $ editTextPrevChar(49f6e7a06ebc5aa8).(void) |
| 135 | { |
| 136 | if (textEditcxx . . $ textEdit..typecxx . . $ textEdit_t#type. != TEXT_EDIT_STRINGcxx . . $ TEXT_EDIT_STRING.) |
| 137 | { |
| 138 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. > 0) |
| 139 | { |
| 140 | removeTextEditCursorcxx . . $ removeTextEditCursor(49f6e7a06ebc5aa8).(); |
| 141 | textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock.--; |
| 142 | renderTextEditCursorcxx . . $ renderTextEditCursor(49f6e7a06ebc5aa8).(); |
| 143 | } |
| 144 | |
| 145 | return; |
| 146 | } |
| 147 | |
| 148 | if (editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag. && textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. <= 4) // kludge... |
| 149 | return; |
| 150 | |
| 151 | if (textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr. > textEditcxx . . $ textEdit..textStartPtrcxx . . $ textEdit_t#textStartPtr.) |
| 152 | { |
| 153 | removeTextEditCursorcxx . . $ removeTextEditCursor(49f6e7a06ebc5aa8).(); |
| 154 | |
| 155 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.--; |
| 156 | moveTextCursorLeftcxx . . $ moveTextCursorLeft(49f6e7a06ebc5aa8).(); |
| 157 | |
| 158 | if (editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag.) // special case for "Mix" input field in Edit. Op. |
| 159 | { |
| 160 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 12) |
| 161 | { |
| 162 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.--; moveTextCursorLeftcxx . . $ moveTextCursorLeft(49f6e7a06ebc5aa8).(); |
| 163 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.--; moveTextCursorLeftcxx . . $ moveTextCursorLeft(49f6e7a06ebc5aa8).(); |
| 164 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.--; moveTextCursorLeftcxx . . $ moveTextCursorLeft(49f6e7a06ebc5aa8).(); |
| 165 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.--; moveTextCursorLeftcxx . . $ moveTextCursorLeft(49f6e7a06ebc5aa8).(); |
| 166 | } |
| 167 | else if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 6) |
| 168 | { |
| 169 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.--; |
| 170 | moveTextCursorLeftcxx . . $ moveTextCursorLeft(49f6e7a06ebc5aa8).(); |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | renderTextEditCursorcxx . . $ renderTextEditCursor(49f6e7a06ebc5aa8).(); |
| 175 | } |
| 176 | |
| 177 | textEditcxx . . $ textEdit..endReachedcxx . . $ textEdit_t#endReached. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 178 | } |
| 179 | |
| 180 | void editTextNextCharcxx . . $ editTextNextChar(49f6e7a06ebc5aa8).(void) |
| 181 | { |
| 182 | if (textEditcxx . . $ textEdit..typecxx . . $ textEdit_t#type. != TEXT_EDIT_STRINGcxx . . $ TEXT_EDIT_STRING.) |
| 183 | { |
| 184 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. < textEditcxx . . $ textEdit..numDigitscxx . . $ textEdit_t#numDigits.-1) |
| 185 | { |
| 186 | removeTextEditCursorcxx . . $ removeTextEditCursor(49f6e7a06ebc5aa8).(); |
| 187 | textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock.++; |
| 188 | renderTextEditCursorcxx . . $ renderTextEditCursor(49f6e7a06ebc5aa8).(); |
| 189 | } |
| 190 | |
| 191 | return; |
| 192 | } |
| 193 | |
| 194 | if (editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag. && textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. >= 14) // kludge |
| 195 | return; |
| 196 | |
| 197 | if (textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr. < textEditcxx . . $ textEdit..textEndPtrcxx . . $ textEdit_t#textEndPtr.) |
| 198 | { |
| 199 | if (*textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr. != '\0') |
| 200 | { |
| 201 | removeTextEditCursorcxx . . $ removeTextEditCursor(49f6e7a06ebc5aa8).(); |
| 202 | |
| 203 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.++; |
| 204 | moveTextCursorRightcxx . . $ moveTextCursorRight(49f6e7a06ebc5aa8).(); |
| 205 | |
| 206 | if (editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag.) // special case for "Mix" input field in Edit. Op. |
| 207 | { |
| 208 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 9) |
| 209 | { |
| 210 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.++; moveTextCursorRightcxx . . $ moveTextCursorRight(49f6e7a06ebc5aa8).(); |
| 211 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.++; moveTextCursorRightcxx . . $ moveTextCursorRight(49f6e7a06ebc5aa8).(); |
| 212 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.++; moveTextCursorRightcxx . . $ moveTextCursorRight(49f6e7a06ebc5aa8).(); |
| 213 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.++; moveTextCursorRightcxx . . $ moveTextCursorRight(49f6e7a06ebc5aa8).(); |
| 214 | } |
| 215 | else if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 6) |
| 216 | { |
| 217 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.++; |
| 218 | moveTextCursorRightcxx . . $ moveTextCursorRight(49f6e7a06ebc5aa8).(); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | renderTextEditCursorcxx . . $ renderTextEditCursor(49f6e7a06ebc5aa8).(); |
| 223 | } |
| 224 | else |
| 225 | { |
| 226 | textEditcxx . . $ textEdit..endReachedcxx . . $ textEdit_t#endReached. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 227 | } |
| 228 | } |
| 229 | else |
| 230 | { |
| 231 | textEditcxx . . $ textEdit..endReachedcxx . . $ textEdit_t#endReached. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | void handleTextEditingcxx . . $ handleTextEditing(ac50b47256ae7414).(uint8_tcxx . . $ uint8_t# mouseButton) // handle mouse while editing text/numbers |
| 236 | { |
| 237 | if (!uicxx . . $ ui..editTextFlagcxx . . $ ui_t#editTextFlag.) |
| 238 | return; |
| 239 | |
| 240 | if (textEditcxx . . $ textEdit..typecxx . . $ textEdit_t#type. != TEXT_EDIT_STRINGcxx . . $ TEXT_EDIT_STRING.) |
| 241 | { |
| 242 | if (mouseButton == SDL_BUTTON_RIGHTcxx . . $ `<external>/13849749812924280863/SDL_mouse.h:447:9`!) |
| 243 | leaveTextEditModecxx . . $ leaveTextEditMode(b45ddcbc8423892c).(EDIT_TEXT_NO_UPDATEcxx . . $ EDIT_TEXT_NO_UPDATE.); |
| 244 | } |
| 245 | else if (mouseButton == SDL_BUTTON_LEFTcxx . . $ `<external>/13849749812924280863/SDL_mouse.h:445:9`! && !editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag.) // string type |
| 246 | { |
| 247 | // jump to edit character under the mouse pointer |
| 248 | |
| 249 | int32_tcxx . . $ int32_t# tmp32 = mousecxx . . $ mouse..ycxx . . $ mouse_t#y. - textEditcxx . . $ textEdit..cursorStartYcxx . . $ textEdit_t#cursorStartY.; |
| 250 | if (tmp32 <= 2 && tmp32 >= -9) |
| 251 | { |
| 252 | ASSERTcxx . . $ `src/pt2_header.h:25:9`!(textEdit.textStartPtr != NULL); |
| 253 | const int32_tcxx . . $ int32_t# textLength = (int32_tcxx . . $ int32_t#)strlencxx . . $ strlen(751346f8406fd082).(textEditcxx . . $ textEdit..textStartPtrcxx . . $ textEdit_t#textStartPtr.); |
| 254 | int32_tcxx . . $ int32_t# cursorBlock = (mousecxx . . $ mouse..xcxx . . $ mouse_t#x. - textEditcxx . . $ textEdit..cursorStartXcxx . . $ textEdit_t#cursorStartX.) / FONT_CHAR_Wcxx . . $ `src/pt2_header.h:70:9`!; |
| 255 | const int32_tcxx . . $ int32_t# textPos = CLAMPcxx . . $ `src/pt2_helpers.h:36:9`!(textEdit.scrollOffset + cursorBlock, 0, textLength); |
| 256 | |
| 257 | cursorBlock = CLAMPcxx . . $ `src/pt2_helpers.h:36:9`!(cursorBlock, 0, textEdit.numBlocks-1); |
| 258 | if (cursorBlock > textLength) |
| 259 | cursorBlock = textLength; |
| 260 | |
| 261 | removeTextEditCursorcxx . . $ removeTextEditCursor(49f6e7a06ebc5aa8).(); |
| 262 | textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. = (uint16_tcxx . . $ uint16_t#)cursorBlock; |
| 263 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr. = textEditcxx . . $ textEdit..textStartPtrcxx . . $ textEdit_t#textStartPtr. + textPos; |
| 264 | renderTextEditCursorcxx . . $ renderTextEditCursor(49f6e7a06ebc5aa8).(); |
| 265 | } |
| 266 | else |
| 267 | { |
| 268 | // if we clicked outside of the vertical edit area, stop edit mode |
| 269 | |
| 270 | if (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. != PTB_PE_PATTNAMEcxx . . $ PTB_PE_PATTNAME.) // special case... |
| 271 | leaveTextEditModecxx . . $ leaveTextEditMode(b45ddcbc8423892c).(EDIT_TEXT_UPDATEcxx . . $ EDIT_TEXT_UPDATE.); |
| 272 | } |
| 273 | } |
| 274 | else if (mouseButton == SDL_BUTTON_RIGHTcxx . . $ `<external>/13849749812924280863/SDL_mouse.h:447:9`!) |
| 275 | { |
| 276 | if (editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag.) |
| 277 | { |
| 278 | leaveTextEditModecxx . . $ leaveTextEditMode(b45ddcbc8423892c).(EDIT_TEXT_UPDATEcxx . . $ EDIT_TEXT_UPDATE.); |
| 279 | editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 280 | uicxx . . $ ui..updateMixTextcxx . . $ ui_t#updateMixText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 281 | } |
| 282 | else |
| 283 | { |
| 284 | // delete text |
| 285 | const uint32_tcxx . . $ uint32_t# charsToZero = (uint32_tcxx . . $ uint32_t#)(textEditcxx . . $ textEdit..textEndPtrcxx . . $ textEdit_t#textEndPtr. - textEditcxx . . $ textEdit..textStartPtrcxx . . $ textEdit_t#textStartPtr.); |
| 286 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(textEditcxx . . $ textEdit..textStartPtrcxx . . $ textEdit_t#textStartPtr., '\0', charsToZero); |
| 287 | |
| 288 | if (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_DO_DATAPATHcxx . . $ PTB_DO_DATAPATH.) |
| 289 | { |
| 290 | /* Don't exit text edit mode if the Disk Op. path was about to |
| 291 | ** be deleted with the right mouse button. |
| 292 | ** Set text cursor to beginning instead. |
| 293 | */ |
| 294 | removeTextEditCursorcxx . . $ removeTextEditCursor(49f6e7a06ebc5aa8).(); |
| 295 | textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. = 0; |
| 296 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr. = textEditcxx . . $ textEdit..textStartPtrcxx . . $ textEdit_t#textStartPtr.; |
| 297 | textEditcxx . . $ textEdit..scrollOffsetcxx . . $ textEdit_t#scrollOffset. = 0; |
| 298 | renderTextEditCursorcxx . . $ renderTextEditCursor(49f6e7a06ebc5aa8).(); |
| 299 | |
| 300 | uicxx . . $ ui..updateDiskOpPathTextcxx . . $ ui_t#updateDiskOpPathText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 301 | } |
| 302 | else |
| 303 | { |
| 304 | if (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_SONGNAMEcxx . . $ PTB_SONGNAME.) |
| 305 | uicxx . . $ ui..updateSongNamecxx . . $ ui_t#updateSongName. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 306 | else if (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_SAMPLENAMEcxx . . $ PTB_SAMPLENAME.) |
| 307 | uicxx . . $ ui..updateCurrSampleNamecxx . . $ ui_t#updateCurrSampleName. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 308 | |
| 309 | leaveTextEditModecxx . . $ leaveTextEditMode(b45ddcbc8423892c).(EDIT_TEXT_UPDATEcxx . . $ EDIT_TEXT_UPDATE.); |
| 310 | } |
| 311 | } |
| 312 | } |
| 313 | } |
| 314 | |
| 315 | void enterTextEditModecxx . . $ enterTextEditMode(68e3ae50fe6578a9).(int16_tcxx . . $ int16_t# editObject) |
| 316 | { |
| 317 | pointerSetModecxx . . $ pointerSetMode(f2ac3508b56cd10).(POINTER_MODE_MSG1cxx . . $ POINTER_MODE_MSG1., NO_CARRYcxx . . $ NO_CARRY.); |
| 318 | |
| 319 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr. = textEditcxx . . $ textEdit..textStartPtrcxx . . $ textEdit_t#textStartPtr.; |
| 320 | textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. = 0; |
| 321 | textEditcxx . . $ textEdit..scrollOffsetcxx . . $ textEdit_t#scrollOffset. = 0; |
| 322 | textEditcxx . . $ textEdit..typecxx . . $ textEdit_t#type. = TEXT_EDIT_STRINGcxx . . $ TEXT_EDIT_STRING.; |
| 323 | textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. = editObject; |
| 324 | textEditcxx . . $ textEdit..endReachedcxx . . $ textEdit_t#endReached. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 325 | uicxx . . $ ui..editTextFlagcxx . . $ ui_t#editTextFlag. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 326 | |
| 327 | // make backup of old text (for handling 'song modified' flag later) |
| 328 | oldTextLengthcxx . . $ oldTextLength. = (uint32_tcxx . . $ uint32_t#)strlencxx . . $ strlen(751346f8406fd082).(textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.); |
| 329 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(oldTextcxx . . $ oldText., '\0', sizeof (oldTextcxx . . $ oldText.)); |
| 330 | memcpycxx . . $ memcpy(cc817cb175f282d).(oldTextcxx . . $ oldText., textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr., oldTextLengthcxx . . $ oldTextLength.); |
| 331 | |
| 332 | if (editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag.) // skip to editable text section |
| 333 | { |
| 334 | editTextNextCharcxx . . $ editTextNextChar(49f6e7a06ebc5aa8).(); |
| 335 | editTextNextCharcxx . . $ editTextNextChar(49f6e7a06ebc5aa8).(); |
| 336 | editTextNextCharcxx . . $ editTextNextChar(49f6e7a06ebc5aa8).(); |
| 337 | editTextNextCharcxx . . $ editTextNextChar(49f6e7a06ebc5aa8).(); |
| 338 | } |
| 339 | |
| 340 | renderTextEditCursorcxx . . $ renderTextEditCursor(49f6e7a06ebc5aa8).(); |
| 341 | SDL_StartTextInputcxx . . $ SDL_StartTextInput(49f6e7a06ebc5aa8).(); |
| 342 | } |
| 343 | |
| 344 | void enterNumberEditModecxx . . $ enterNumberEditMode(1a1cb793af1dcc7a).(uint8_tcxx . . $ uint8_t# type, int16_tcxx . . $ int16_t# editObject) |
| 345 | { |
| 346 | pointerSetModecxx . . $ pointerSetMode(f2ac3508b56cd10).(POINTER_MODE_MSG1cxx . . $ POINTER_MODE_MSG1., NO_CARRYcxx . . $ NO_CARRY.); |
| 347 | |
| 348 | textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. = 0; |
| 349 | textEditcxx . . $ textEdit..typecxx . . $ textEdit_t#type. = type; |
| 350 | textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. = editObject; |
| 351 | textEditcxx . . $ textEdit..endReachedcxx . . $ textEdit_t#endReached. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 352 | uicxx . . $ ui..editTextFlagcxx . . $ ui_t#editTextFlag. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 353 | |
| 354 | renderTextEditCursorcxx . . $ renderTextEditCursor(49f6e7a06ebc5aa8).(); |
| 355 | SDL_StartTextInputcxx . . $ SDL_StartTextInput(49f6e7a06ebc5aa8).(); |
| 356 | } |
| 357 | |
| 358 | static void redrawTextEditObjectcxx . . $ redrawTextEditObject(49f6e7a06ebc5aa8).(void) |
| 359 | { |
| 360 | switch (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object.) |
| 361 | { |
| 362 | default: break; |
| 363 | case PTB_SONGNAMEcxx . . $ PTB_SONGNAME.: uicxx . . $ ui..updateSongNamecxx . . $ ui_t#updateSongName. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 364 | case PTB_SAMPLENAMEcxx . . $ PTB_SAMPLENAME.: uicxx . . $ ui..updateCurrSampleNamecxx . . $ ui_t#updateCurrSampleName. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 365 | case PTB_PE_PATTcxx . . $ PTB_PE_PATT.: uicxx . . $ ui..updatePosEdcxx . . $ ui_t#updatePosEd. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 366 | case PTB_PE_PATTNAMEcxx . . $ PTB_PE_PATTNAME.: uicxx . . $ ui..updatePosEdcxx . . $ ui_t#updatePosEd. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 367 | case PTB_EO_QUANTIZEcxx . . $ PTB_EO_QUANTIZE.: uicxx . . $ ui..updateQuantizeTextcxx . . $ ui_t#updateQuantizeText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 368 | case PTB_EO_METRO_1cxx . . $ PTB_EO_METRO_1.: uicxx . . $ ui..updateMetro1Textcxx . . $ ui_t#updateMetro1Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 369 | case PTB_EO_METRO_2cxx . . $ PTB_EO_METRO_2.: uicxx . . $ ui..updateMetro2Textcxx . . $ ui_t#updateMetro2Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 370 | case PTB_EO_FROM_NUMcxx . . $ PTB_EO_FROM_NUM.: uicxx . . $ ui..updateFromTextcxx . . $ ui_t#updateFromText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 371 | case PTB_EO_TO_NUMcxx . . $ PTB_EO_TO_NUM.: uicxx . . $ ui..updateToTextcxx . . $ ui_t#updateToText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 372 | case PTB_EO_MIXcxx . . $ PTB_EO_MIX.: uicxx . . $ ui..updateMixTextcxx . . $ ui_t#updateMixText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 373 | case PTB_EO_POS_NUMcxx . . $ PTB_EO_POS_NUM.: uicxx . . $ ui..updatePosTextcxx . . $ ui_t#updatePosText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 374 | case PTB_EO_MOD_NUMcxx . . $ PTB_EO_MOD_NUM.: uicxx . . $ ui..updateModTextcxx . . $ ui_t#updateModText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 375 | case PTB_EO_VOL_NUMcxx . . $ PTB_EO_VOL_NUM.: uicxx . . $ ui..updateVolTextcxx . . $ ui_t#updateVolText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 376 | case PTB_DO_DATAPATHcxx . . $ PTB_DO_DATAPATH.: uicxx . . $ ui..updateDiskOpPathTextcxx . . $ ui_t#updateDiskOpPathText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 377 | case PTB_POSScxx . . $ PTB_POSS.: updateNewPoscxx . . $ updateNewPos(49f6e7a06ebc5aa8).(); break; |
| 378 | case PTB_PATTERNScxx . . $ PTB_PATTERNS.: uicxx . . $ ui..updateSongPatterncxx . . $ ui_t#updateSongPattern. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 379 | case PTB_LENGTHScxx . . $ PTB_LENGTHS.: uicxx . . $ ui..updateSongLengthcxx . . $ ui_t#updateSongLength. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 380 | case PTB_SAMPLEScxx . . $ PTB_SAMPLES.: uicxx . . $ ui..updateCurrSampleNumcxx . . $ ui_t#updateCurrSampleNum. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 381 | case PTB_SVOLUMEScxx . . $ PTB_SVOLUMES.: uicxx . . $ ui..updateCurrSampleVolumecxx . . $ ui_t#updateCurrSampleVolume. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 382 | case PTB_SLENGTHScxx . . $ PTB_SLENGTHS.: uicxx . . $ ui..updateCurrSampleLengthcxx . . $ ui_t#updateCurrSampleLength. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 383 | case PTB_SREPEATScxx . . $ PTB_SREPEATS.: uicxx . . $ ui..updateCurrSampleRepeatcxx . . $ ui_t#updateCurrSampleRepeat. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 384 | case PTB_SREPLENScxx . . $ PTB_SREPLENS.: uicxx . . $ ui..updateCurrSampleReplencxx . . $ ui_t#updateCurrSampleReplen. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 385 | case PTB_PATTDATAcxx . . $ PTB_PATTDATA.: uicxx . . $ ui..updateCurrPattTextcxx . . $ ui_t#updateCurrPattText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 386 | case PTB_SA_VOL_FROM_NUMcxx . . $ PTB_SA_VOL_FROM_NUM.: uicxx . . $ ui..updateVolFromTextcxx . . $ ui_t#updateVolFromText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 387 | case PTB_SA_VOL_TO_NUMcxx . . $ PTB_SA_VOL_TO_NUM.: uicxx . . $ ui..updateVolToTextcxx . . $ ui_t#updateVolToText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 388 | case PTB_SA_FIL_LP_CUTOFFcxx . . $ PTB_SA_FIL_LP_CUTOFF.: uicxx . . $ ui..updateLPTextcxx . . $ ui_t#updateLPText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 389 | case PTB_SA_FIL_HP_CUTOFFcxx . . $ PTB_SA_FIL_HP_CUTOFF.: uicxx . . $ ui..updateHPTextcxx . . $ ui_t#updateHPText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; break; |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | void leaveTextEditModecxx . . $ leaveTextEditMode(b45ddcbc8423892c).(boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! updateValue) |
| 394 | { |
| 395 | int8_tcxx . . $ int8_t# tmp8; |
| 396 | int16_tcxx . . $ int16_t# tmp16; |
| 397 | int32_tcxx . . $ int32_t# tmp32; |
| 398 | |
| 399 | SDL_StopTextInputcxx . . $ SDL_StopTextInput(49f6e7a06ebc5aa8).(); |
| 400 | |
| 401 | // if user updated the disk op path text |
| 402 | if (uicxx . . $ ui..diskOpScreenShowncxx . . $ ui_t#diskOpScreenShown. && textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_DO_DATAPATHcxx . . $ PTB_DO_DATAPATH.) |
| 403 | { |
| 404 | UNICHARcxx . . $ UNICHAR# *pathU = (UNICHARcxx . . $ UNICHAR# *)calloccxx . . $ calloc(63a7bf2941bfcd7a).(PATH_MAXcxx . . $ `<external>/6347054901304145714/limits.h:13:9`! + 2, sizeof (UNICHARcxx . . $ UNICHAR#)); |
| 405 | if (pathU != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 406 | { |
| 407 | #ifdef _WIN32 |
| 408 | MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, editor.currPath, -1, pathU, PATH_MAX); |
| 409 | #else |
| 410 | strcpycxx . . $ strcpy(b7b3a83273496486).(pathU, editorcxx . . $ editor..currPathcxx . . $ editor_t#currPath.); |
| 411 | #endif |
| 412 | diskOpSetPathcxx . . $ diskOpSetPath(b66281b8031ad34f).(pathU, DISKOP_CACHEcxx . . $ DISKOP_CACHE.); |
| 413 | freecxx . . $ free(5d22bdacc48458e8).(pathU); |
| 414 | } |
| 415 | } |
| 416 | |
| 417 | if (textEditcxx . . $ textEdit..typecxx . . $ textEdit_t#type. != TEXT_EDIT_STRINGcxx . . $ TEXT_EDIT_STRING.) |
| 418 | { |
| 419 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. != textEditcxx . . $ textEdit..numDigitscxx . . $ textEdit_t#numDigits.) |
| 420 | removeTextEditCursorcxx . . $ removeTextEditCursor(49f6e7a06ebc5aa8).(); |
| 421 | |
| 422 | redrawTextEditObjectcxx . . $ redrawTextEditObject(49f6e7a06ebc5aa8).(); |
| 423 | } |
| 424 | else |
| 425 | { |
| 426 | removeTextEditCursorcxx . . $ removeTextEditCursor(49f6e7a06ebc5aa8).(); |
| 427 | |
| 428 | // yet another kludge... |
| 429 | if (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_PE_PATTcxx . . $ PTB_PE_PATT. || textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_PE_PATTNAMEcxx . . $ PTB_PE_PATTNAME.) |
| 430 | uicxx . . $ ui..updatePosEdcxx . . $ ui_t#updatePosEd. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 431 | } |
| 432 | |
| 433 | uicxx . . $ ui..editTextFlagcxx . . $ ui_t#editTextFlag. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 434 | |
| 435 | if (textEditcxx . . $ textEdit..typecxx . . $ textEdit_t#type. == TEXT_EDIT_STRINGcxx . . $ TEXT_EDIT_STRING.) |
| 436 | { |
| 437 | pointerSetPreviousModecxx . . $ pointerSetPreviousMode(49f6e7a06ebc5aa8).(); |
| 438 | |
| 439 | // handle song modified state (only for some text edit objects) |
| 440 | if (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. != PTB_EO_MIXcxx . . $ PTB_EO_MIX. && textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. != PTB_PE_PATTNAMEcxx . . $ PTB_PE_PATTNAME. && textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. != PTB_DO_DATAPATHcxx . . $ PTB_DO_DATAPATH.) |
| 441 | { |
| 442 | if (strcmpcxx . . $ strcmp(5ae29d726ae57f88).(textEditcxx . . $ textEdit..textStartPtrcxx . . $ textEdit_t#textStartPtr., oldTextcxx . . $ oldText.) != 0) |
| 443 | updateWindowTitlecxx . . $ updateWindowTitle(b45ddcbc8423892c).(MOD_IS_MODIFIEDcxx . . $ MOD_IS_MODIFIED.); |
| 444 | } |
| 445 | } |
| 446 | else |
| 447 | { |
| 448 | // set back GUI text pointers and update values (if requested) |
| 449 | |
| 450 | moduleSample_tcxx . . $ moduleSample_t# *s = &songcxx . . $ song.->samplescxx . . $ module_t#samples.[editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample.]; |
| 451 | switch (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object.) |
| 452 | { |
| 453 | case PTB_SA_FIL_LP_CUTOFFcxx . . $ PTB_SA_FIL_LP_CUTOFF.: |
| 454 | { |
| 455 | editorcxx . . $ editor..lpCutOffDispcxx . . $ editor_t#lpCutOffDisp. = &editorcxx . . $ editor..lpCutOffcxx . . $ editor_t#lpCutOff.; |
| 456 | |
| 457 | if (updateValue) |
| 458 | { |
| 459 | editorcxx . . $ editor..lpCutOffcxx . . $ editor_t#lpCutOff. = textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16.; |
| 460 | if (editorcxx . . $ editor..lpCutOffcxx . . $ editor_t#lpCutOff. > (uint16_tcxx . . $ uint16_t#)(FILTERS_BASE_FREQcxx . . $ `src/pt2_audio.h:8:9`!/2)) |
| 461 | editorcxx . . $ editor..lpCutOffcxx . . $ editor_t#lpCutOff. = (uint16_tcxx . . $ uint16_t#)(FILTERS_BASE_FREQcxx . . $ `src/pt2_audio.h:8:9`!/2); |
| 462 | |
| 463 | uicxx . . $ ui..updateLPTextcxx . . $ ui_t#updateLPText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 464 | } |
| 465 | } |
| 466 | break; |
| 467 | |
| 468 | case PTB_SA_FIL_HP_CUTOFFcxx . . $ PTB_SA_FIL_HP_CUTOFF.: |
| 469 | { |
| 470 | editorcxx . . $ editor..hpCutOffDispcxx . . $ editor_t#hpCutOffDisp. = &editorcxx . . $ editor..hpCutOffcxx . . $ editor_t#hpCutOff.; |
| 471 | |
| 472 | if (updateValue) |
| 473 | { |
| 474 | editorcxx . . $ editor..hpCutOffcxx . . $ editor_t#hpCutOff. = textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16.; |
| 475 | if (editorcxx . . $ editor..hpCutOffcxx . . $ editor_t#hpCutOff. > (uint16_tcxx . . $ uint16_t#)(FILTERS_BASE_FREQcxx . . $ `src/pt2_audio.h:8:9`!/2)) |
| 476 | editorcxx . . $ editor..hpCutOffcxx . . $ editor_t#hpCutOff. = (uint16_tcxx . . $ uint16_t#)(FILTERS_BASE_FREQcxx . . $ `src/pt2_audio.h:8:9`!/2); |
| 477 | |
| 478 | uicxx . . $ ui..updateHPTextcxx . . $ ui_t#updateHPText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 479 | } |
| 480 | } |
| 481 | break; |
| 482 | |
| 483 | case PTB_SA_VOL_FROM_NUMcxx . . $ PTB_SA_VOL_FROM_NUM.: |
| 484 | { |
| 485 | editorcxx . . $ editor..vol1Dispcxx . . $ editor_t#vol1Disp. = &editorcxx . . $ editor..vol1cxx . . $ editor_t#vol1.; |
| 486 | |
| 487 | if (updateValue) |
| 488 | { |
| 489 | editorcxx . . $ editor..vol1cxx . . $ editor_t#vol1. = textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16.; |
| 490 | if (editorcxx . . $ editor..vol1cxx . . $ editor_t#vol1. > 200) |
| 491 | editorcxx . . $ editor..vol1cxx . . $ editor_t#vol1. = 200; |
| 492 | |
| 493 | uicxx . . $ ui..updateVolFromTextcxx . . $ ui_t#updateVolFromText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 494 | showVolFromSlidercxx . . $ showVolFromSlider(49f6e7a06ebc5aa8).(); |
| 495 | } |
| 496 | } |
| 497 | break; |
| 498 | |
| 499 | case PTB_SA_VOL_TO_NUMcxx . . $ PTB_SA_VOL_TO_NUM.: |
| 500 | { |
| 501 | editorcxx . . $ editor..vol2Dispcxx . . $ editor_t#vol2Disp. = &editorcxx . . $ editor..vol2cxx . . $ editor_t#vol2.; |
| 502 | |
| 503 | if (updateValue) |
| 504 | { |
| 505 | editorcxx . . $ editor..vol2cxx . . $ editor_t#vol2. = textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16.; |
| 506 | if (editorcxx . . $ editor..vol2cxx . . $ editor_t#vol2. > 200) |
| 507 | editorcxx . . $ editor..vol2cxx . . $ editor_t#vol2. = 200; |
| 508 | |
| 509 | uicxx . . $ ui..updateVolToTextcxx . . $ ui_t#updateVolToText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 510 | showVolToSlidercxx . . $ showVolToSlider(49f6e7a06ebc5aa8).(); |
| 511 | } |
| 512 | } |
| 513 | break; |
| 514 | |
| 515 | case PTB_EO_VOL_NUMcxx . . $ PTB_EO_VOL_NUM.: |
| 516 | { |
| 517 | editorcxx . . $ editor..sampleVolDispcxx . . $ editor_t#sampleVolDisp. = &editorcxx . . $ editor..sampleVolcxx . . $ editor_t#sampleVol.; |
| 518 | |
| 519 | if (updateValue) |
| 520 | { |
| 521 | editorcxx . . $ editor..sampleVolcxx . . $ editor_t#sampleVol. = textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16.; |
| 522 | uicxx . . $ ui..updateVolTextcxx . . $ ui_t#updateVolText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 523 | } |
| 524 | } |
| 525 | break; |
| 526 | |
| 527 | case PTB_EO_POS_NUMcxx . . $ PTB_EO_POS_NUM.: |
| 528 | { |
| 529 | editorcxx . . $ editor..samplePosDispcxx . . $ editor_t#samplePosDisp. = &editorcxx . . $ editor..samplePoscxx . . $ editor_t#samplePos.; |
| 530 | |
| 531 | if (updateValue) |
| 532 | { |
| 533 | editorcxx . . $ editor..samplePoscxx . . $ editor_t#samplePos. = textEditcxx . . $ textEdit..tmpDisp32cxx . . $ textEdit_t#tmpDisp32.; |
| 534 | if (editorcxx . . $ editor..samplePoscxx . . $ editor_t#samplePos. > configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength.) |
| 535 | editorcxx . . $ editor..samplePoscxx . . $ editor_t#samplePos. = configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength.; |
| 536 | |
| 537 | if (editorcxx . . $ editor..samplePoscxx . . $ editor_t#samplePos. > songcxx . . $ song.->samplescxx . . $ module_t#samples.[editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample.].lengthcxx . . $ moduleSample_t#length.) |
| 538 | editorcxx . . $ editor..samplePoscxx . . $ editor_t#samplePos. = songcxx . . $ song.->samplescxx . . $ module_t#samples.[editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample.].lengthcxx . . $ moduleSample_t#length.; |
| 539 | |
| 540 | uicxx . . $ ui..updatePosTextcxx . . $ ui_t#updatePosText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 541 | } |
| 542 | } |
| 543 | break; |
| 544 | |
| 545 | case PTB_EO_QUANTIZEcxx . . $ PTB_EO_QUANTIZE.: |
| 546 | { |
| 547 | editorcxx . . $ editor..quantizeValueDispcxx . . $ editor_t#quantizeValueDisp. = &configcxx . . $ config..quantizeValuecxx . . $ config_t#quantizeValue.; |
| 548 | |
| 549 | if (updateValue) |
| 550 | { |
| 551 | if (textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16. > 63) |
| 552 | textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16. = 63; |
| 553 | |
| 554 | configcxx . . $ config..quantizeValuecxx . . $ config_t#quantizeValue. = textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16.; |
| 555 | uicxx . . $ ui..updateQuantizeTextcxx . . $ ui_t#updateQuantizeText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 556 | } |
| 557 | } |
| 558 | break; |
| 559 | |
| 560 | case PTB_EO_METRO_1cxx . . $ PTB_EO_METRO_1.: // metronome speed |
| 561 | { |
| 562 | editorcxx . . $ editor..metroSpeedDispcxx . . $ editor_t#metroSpeedDisp. = &editorcxx . . $ editor..metroSpeedcxx . . $ editor_t#metroSpeed.; |
| 563 | |
| 564 | if (updateValue) |
| 565 | { |
| 566 | if (textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16. > 64) |
| 567 | textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16. = 64; |
| 568 | |
| 569 | editorcxx . . $ editor..metroSpeedcxx . . $ editor_t#metroSpeed. = textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16.; |
| 570 | uicxx . . $ ui..updateMetro1Textcxx . . $ ui_t#updateMetro1Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 571 | } |
| 572 | } |
| 573 | break; |
| 574 | |
| 575 | case PTB_EO_METRO_2cxx . . $ PTB_EO_METRO_2.: // metronome channel |
| 576 | { |
| 577 | editorcxx . . $ editor..metroChannelDispcxx . . $ editor_t#metroChannelDisp. = &editorcxx . . $ editor..metroChannelcxx . . $ editor_t#metroChannel.; |
| 578 | |
| 579 | if (updateValue) |
| 580 | { |
| 581 | if (textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16. > 4) |
| 582 | textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16. = 4; |
| 583 | |
| 584 | editorcxx . . $ editor..metroChannelcxx . . $ editor_t#metroChannel. = textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16.; |
| 585 | uicxx . . $ ui..updateMetro2Textcxx . . $ ui_t#updateMetro2Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 586 | } |
| 587 | } |
| 588 | break; |
| 589 | |
| 590 | case PTB_EO_FROM_NUMcxx . . $ PTB_EO_FROM_NUM.: |
| 591 | { |
| 592 | editorcxx . . $ editor..sampleFromDispcxx . . $ editor_t#sampleFromDisp. = &editorcxx . . $ editor..sampleFromcxx . . $ editor_t#sampleFrom.; |
| 593 | |
| 594 | if (updateValue) |
| 595 | { |
| 596 | editorcxx . . $ editor..sampleFromcxx . . $ editor_t#sampleFrom. = textEditcxx . . $ textEdit..tmpDisp8cxx . . $ textEdit_t#tmpDisp8.; |
| 597 | |
| 598 | // signed check + normal check |
| 599 | if (editorcxx . . $ editor..sampleFromcxx . . $ editor_t#sampleFrom. < 0x00 || editorcxx . . $ editor..sampleFromcxx . . $ editor_t#sampleFrom. > 0x1F) |
| 600 | editorcxx . . $ editor..sampleFromcxx . . $ editor_t#sampleFrom. = 0x1F; |
| 601 | |
| 602 | uicxx . . $ ui..updateFromTextcxx . . $ ui_t#updateFromText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 603 | } |
| 604 | } |
| 605 | break; |
| 606 | |
| 607 | case PTB_EO_TO_NUMcxx . . $ PTB_EO_TO_NUM.: |
| 608 | { |
| 609 | editorcxx . . $ editor..sampleToDispcxx . . $ editor_t#sampleToDisp. = &editorcxx . . $ editor..sampleTocxx . . $ editor_t#sampleTo.; |
| 610 | |
| 611 | if (updateValue) |
| 612 | { |
| 613 | editorcxx . . $ editor..sampleTocxx . . $ editor_t#sampleTo. = textEditcxx . . $ textEdit..tmpDisp8cxx . . $ textEdit_t#tmpDisp8.; |
| 614 | |
| 615 | // signed check + normal check |
| 616 | if (editorcxx . . $ editor..sampleTocxx . . $ editor_t#sampleTo. < 0x00 || editorcxx . . $ editor..sampleTocxx . . $ editor_t#sampleTo. > 0x1F) |
| 617 | editorcxx . . $ editor..sampleTocxx . . $ editor_t#sampleTo. = 0x1F; |
| 618 | |
| 619 | uicxx . . $ ui..updateToTextcxx . . $ ui_t#updateToText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 620 | } |
| 621 | } |
| 622 | break; |
| 623 | |
| 624 | case PTB_PE_PATTcxx . . $ PTB_PE_PATT.: |
| 625 | { |
| 626 | int16_tcxx . . $ int16_t# posEdPos = songcxx . . $ song.->currPoscxx . . $ module_t#currPos.; |
| 627 | if (posEdPos > songcxx . . $ song.->headercxx . . $ module_t#header..songLengthcxx . . $ moduleHeader_t#songLength.-1) |
| 628 | posEdPos = songcxx . . $ song.->headercxx . . $ module_t#header..songLengthcxx . . $ moduleHeader_t#songLength.-1; |
| 629 | |
| 630 | editorcxx . . $ editor..currPosEdPattDispcxx . . $ editor_t#currPosEdPattDisp. = &songcxx . . $ song.->headercxx . . $ module_t#header..patternTablecxx . . $ moduleHeader_t#patternTable.[posEdPos]; |
| 631 | |
| 632 | if (updateValue) |
| 633 | { |
| 634 | if (textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16. > MAX_PATTERNScxx . . $ `src/pt2_header.h:75:9`!-1) |
| 635 | textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16. = MAX_PATTERNScxx . . $ `src/pt2_header.h:75:9`!-1; |
| 636 | |
| 637 | songcxx . . $ song.->headercxx . . $ module_t#header..patternTablecxx . . $ moduleHeader_t#patternTable.[posEdPos] = textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16.; |
| 638 | |
| 639 | updateWindowTitlecxx . . $ updateWindowTitle(b45ddcbc8423892c).(MOD_IS_MODIFIEDcxx . . $ MOD_IS_MODIFIED.); |
| 640 | |
| 641 | if (uicxx . . $ ui..posEdScreenShowncxx . . $ ui_t#posEdScreenShown.) |
| 642 | uicxx . . $ ui..updatePosEdcxx . . $ ui_t#updatePosEd. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 643 | |
| 644 | uicxx . . $ ui..updateSongPatterncxx . . $ ui_t#updateSongPattern. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 645 | uicxx . . $ ui..updateSongSizecxx . . $ ui_t#updateSongSize. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 646 | } |
| 647 | } |
| 648 | break; |
| 649 | |
| 650 | case PTB_POSScxx . . $ PTB_POSS.: |
| 651 | { |
| 652 | editorcxx . . $ editor..currPosDispcxx . . $ editor_t#currPosDisp. = &songcxx . . $ song.->currPoscxx . . $ module_t#currPos.; |
| 653 | |
| 654 | if (updateValue) |
| 655 | { |
| 656 | tmp16 = textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16.; |
| 657 | if (tmp16 > 126) |
| 658 | tmp16 = 126; |
| 659 | |
| 660 | if (songcxx . . $ song.->currPoscxx . . $ module_t#currPos. != tmp16) |
| 661 | { |
| 662 | songcxx . . $ song.->currPoscxx . . $ module_t#currPos. = tmp16; |
| 663 | editorcxx . . $ editor..currPatternDispcxx . . $ editor_t#currPatternDisp. = &songcxx . . $ song.->headercxx . . $ module_t#header..patternTablecxx . . $ moduleHeader_t#patternTable.[songcxx . . $ song.->currPoscxx . . $ module_t#currPos.]; |
| 664 | |
| 665 | if (uicxx . . $ ui..posEdScreenShowncxx . . $ ui_t#posEdScreenShown.) |
| 666 | uicxx . . $ ui..updatePosEdcxx . . $ ui_t#updatePosEd. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 667 | |
| 668 | uicxx . . $ ui..updateSongPoscxx . . $ ui_t#updateSongPos. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 669 | uicxx . . $ ui..updatePatternDatacxx . . $ ui_t#updatePatternData. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 670 | } |
| 671 | } |
| 672 | } |
| 673 | break; |
| 674 | |
| 675 | case PTB_PATTERNScxx . . $ PTB_PATTERNS.: |
| 676 | { |
| 677 | editorcxx . . $ editor..currPatternDispcxx . . $ editor_t#currPatternDisp. = &songcxx . . $ song.->headercxx . . $ module_t#header..patternTablecxx . . $ moduleHeader_t#patternTable.[songcxx . . $ song.->currPoscxx . . $ module_t#currPos.]; |
| 678 | |
| 679 | if (updateValue) |
| 680 | { |
| 681 | tmp16 = textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16.; |
| 682 | if (tmp16 > MAX_PATTERNScxx . . $ `src/pt2_header.h:75:9`!-1) |
| 683 | tmp16 = MAX_PATTERNScxx . . $ `src/pt2_header.h:75:9`!-1; |
| 684 | |
| 685 | if (songcxx . . $ song.->headercxx . . $ module_t#header..patternTablecxx . . $ moduleHeader_t#patternTable.[songcxx . . $ song.->currPoscxx . . $ module_t#currPos.] != tmp16) |
| 686 | { |
| 687 | songcxx . . $ song.->headercxx . . $ module_t#header..patternTablecxx . . $ moduleHeader_t#patternTable.[songcxx . . $ song.->currPoscxx . . $ module_t#currPos.] = tmp16; |
| 688 | |
| 689 | updateWindowTitlecxx . . $ updateWindowTitle(b45ddcbc8423892c).(MOD_IS_MODIFIEDcxx . . $ MOD_IS_MODIFIED.); |
| 690 | |
| 691 | if (uicxx . . $ ui..posEdScreenShowncxx . . $ ui_t#posEdScreenShown.) |
| 692 | uicxx . . $ ui..updatePosEdcxx . . $ ui_t#updatePosEd. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 693 | |
| 694 | uicxx . . $ ui..updateSongPatterncxx . . $ ui_t#updateSongPattern. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 695 | uicxx . . $ ui..updateSongSizecxx . . $ ui_t#updateSongSize. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 696 | } |
| 697 | } |
| 698 | } |
| 699 | break; |
| 700 | |
| 701 | case PTB_LENGTHScxx . . $ PTB_LENGTHS.: |
| 702 | { |
| 703 | editorcxx . . $ editor..currLengthDispcxx . . $ editor_t#currLengthDisp. = &songcxx . . $ song.->headercxx . . $ module_t#header..songLengthcxx . . $ moduleHeader_t#songLength.; |
| 704 | |
| 705 | if (updateValue) |
| 706 | { |
| 707 | tmp16 = CLAMPcxx . . $ `src/pt2_helpers.h:36:9`!(textEdit.tmpDisp16, 1, 127); |
| 708 | |
| 709 | if (songcxx . . $ song.->headercxx . . $ module_t#header..songLengthcxx . . $ moduleHeader_t#songLength. != tmp16) |
| 710 | { |
| 711 | songcxx . . $ song.->headercxx . . $ module_t#header..songLengthcxx . . $ moduleHeader_t#songLength. = tmp16; |
| 712 | |
| 713 | int16_tcxx . . $ int16_t# posEdPos = songcxx . . $ song.->currPoscxx . . $ module_t#currPos.; |
| 714 | if (posEdPos > songcxx . . $ song.->headercxx . . $ module_t#header..songLengthcxx . . $ moduleHeader_t#songLength.-1) |
| 715 | posEdPos = songcxx . . $ song.->headercxx . . $ module_t#header..songLengthcxx . . $ moduleHeader_t#songLength.-1; |
| 716 | |
| 717 | editorcxx . . $ editor..currPosEdPattDispcxx . . $ editor_t#currPosEdPattDisp. = &songcxx . . $ song.->headercxx . . $ module_t#header..patternTablecxx . . $ moduleHeader_t#patternTable.[posEdPos]; |
| 718 | |
| 719 | if (uicxx . . $ ui..posEdScreenShowncxx . . $ ui_t#posEdScreenShown.) |
| 720 | uicxx . . $ ui..updatePosEdcxx . . $ ui_t#updatePosEd. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 721 | |
| 722 | uicxx . . $ ui..updateSongLengthcxx . . $ ui_t#updateSongLength. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 723 | uicxx . . $ ui..updateSongSizecxx . . $ ui_t#updateSongSize. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 724 | updateWindowTitlecxx . . $ updateWindowTitle(b45ddcbc8423892c).(MOD_IS_MODIFIEDcxx . . $ MOD_IS_MODIFIED.); |
| 725 | } |
| 726 | } |
| 727 | } |
| 728 | break; |
| 729 | |
| 730 | case PTB_PATTDATAcxx . . $ PTB_PATTDATA.: |
| 731 | { |
| 732 | editorcxx . . $ editor..currEditPatternDispcxx . . $ editor_t#currEditPatternDisp. = &songcxx . . $ song.->currPatterncxx . . $ module_t#currPattern.; |
| 733 | |
| 734 | if (updateValue) |
| 735 | { |
| 736 | if (songcxx . . $ song.->currPatterncxx . . $ module_t#currPattern. != textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16.) |
| 737 | { |
| 738 | setPatterncxx . . $ setPattern(68e3ae50fe6578a9).(textEditcxx . . $ textEdit..tmpDisp16cxx . . $ textEdit_t#tmpDisp16.); |
| 739 | uicxx . . $ ui..updatePatternDatacxx . . $ ui_t#updatePatternData. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 740 | uicxx . . $ ui..updateCurrPattTextcxx . . $ ui_t#updateCurrPattText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 741 | } |
| 742 | } |
| 743 | } |
| 744 | break; |
| 745 | |
| 746 | case PTB_SAMPLEScxx . . $ PTB_SAMPLES.: |
| 747 | { |
| 748 | editorcxx . . $ editor..currSampleDispcxx . . $ editor_t#currSampleDisp. = &editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample.; |
| 749 | |
| 750 | if (updateValue) |
| 751 | { |
| 752 | tmp8 = textEditcxx . . $ textEdit..tmpDisp8cxx . . $ textEdit_t#tmpDisp8.; |
| 753 | if (tmp8 < 0x00) // (signed) if >0x7F was entered, clamp to 0x1F |
| 754 | tmp8 = 0x1F; |
| 755 | |
| 756 | tmp8 = CLAMPcxx . . $ `src/pt2_helpers.h:36:9`!(tmp8, 0x01, 0x1F) - 1; |
| 757 | |
| 758 | if (tmp8 != editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample.) |
| 759 | { |
| 760 | editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample. = tmp8; |
| 761 | updateCurrSamplecxx . . $ updateCurrSample(49f6e7a06ebc5aa8).(); |
| 762 | } |
| 763 | } |
| 764 | } |
| 765 | break; |
| 766 | |
| 767 | case PTB_SVOLUMEScxx . . $ PTB_SVOLUMES.: |
| 768 | { |
| 769 | s->volumeDispcxx . . $ moduleSample_t#volumeDisp. = &s->volumecxx . . $ moduleSample_t#volume.; |
| 770 | |
| 771 | if (updateValue) |
| 772 | { |
| 773 | tmp8 = textEditcxx . . $ textEdit..tmpDisp8cxx . . $ textEdit_t#tmpDisp8.; |
| 774 | |
| 775 | // signed check + normal check |
| 776 | if (tmp8 < 0x00 || tmp8 > 0x40) |
| 777 | tmp8 = 0x40; |
| 778 | |
| 779 | if (s->volumecxx . . $ moduleSample_t#volume. != tmp8) |
| 780 | { |
| 781 | s->volumecxx . . $ moduleSample_t#volume. = tmp8; |
| 782 | uicxx . . $ ui..updateCurrSampleVolumecxx . . $ ui_t#updateCurrSampleVolume. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 783 | updateWindowTitlecxx . . $ updateWindowTitle(b45ddcbc8423892c).(MOD_IS_MODIFIEDcxx . . $ MOD_IS_MODIFIED.); |
| 784 | } |
| 785 | } |
| 786 | } |
| 787 | break; |
| 788 | |
| 789 | case PTB_SLENGTHScxx . . $ PTB_SLENGTHS.: |
| 790 | { |
| 791 | s->lengthDispcxx . . $ moduleSample_t#lengthDisp. = &s->lengthcxx . . $ moduleSample_t#length.; |
| 792 | |
| 793 | if (updateValue) |
| 794 | { |
| 795 | tmp32 = textEditcxx . . $ textEdit..tmpDisp32cxx . . $ textEdit_t#tmpDisp32. & ~1; // even'ify |
| 796 | if (tmp32 > configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength.) |
| 797 | tmp32 = configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength.; |
| 798 | |
| 799 | if (s->loopStartcxx . . $ moduleSample_t#loopStart.+s->loopLengthcxx . . $ moduleSample_t#loopLength. > 2) |
| 800 | { |
| 801 | if (tmp32 < s->loopStartcxx . . $ moduleSample_t#loopStart.+s->loopLengthcxx . . $ moduleSample_t#loopLength.) |
| 802 | tmp32 = s->loopStartcxx . . $ moduleSample_t#loopStart.+s->loopLengthcxx . . $ moduleSample_t#loopLength.; |
| 803 | } |
| 804 | |
| 805 | tmp32 &= ~1; |
| 806 | |
| 807 | if (s->lengthcxx . . $ moduleSample_t#length. != tmp32) |
| 808 | { |
| 809 | turnOffVoicescxx . . $ turnOffVoices(49f6e7a06ebc5aa8).(); |
| 810 | s->lengthcxx . . $ moduleSample_t#length. = tmp32; |
| 811 | |
| 812 | uicxx . . $ ui..updateCurrSampleLengthcxx . . $ ui_t#updateCurrSampleLength. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 813 | uicxx . . $ ui..updateSongSizecxx . . $ ui_t#updateSongSize. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 814 | updateSamplePoscxx . . $ updateSamplePos(49f6e7a06ebc5aa8).(); |
| 815 | |
| 816 | if (uicxx . . $ ui..samplerScreenShowncxx . . $ ui_t#samplerScreenShown.) |
| 817 | redrawSamplecxx . . $ redrawSample(49f6e7a06ebc5aa8).(); |
| 818 | |
| 819 | recalcChordLengthcxx . . $ recalcChordLength(49f6e7a06ebc5aa8).(); |
| 820 | updateWindowTitlecxx . . $ updateWindowTitle(b45ddcbc8423892c).(MOD_IS_MODIFIEDcxx . . $ MOD_IS_MODIFIED.); |
| 821 | } |
| 822 | } |
| 823 | } |
| 824 | break; |
| 825 | |
| 826 | case PTB_SREPEATScxx . . $ PTB_SREPEATS.: |
| 827 | { |
| 828 | s->loopStartDispcxx . . $ moduleSample_t#loopStartDisp. = &s->loopStartcxx . . $ moduleSample_t#loopStart.; |
| 829 | |
| 830 | if (updateValue) |
| 831 | { |
| 832 | tmp32 = textEditcxx . . $ textEdit..tmpDisp32cxx . . $ textEdit_t#tmpDisp32. & ~1; // even'ify |
| 833 | if (tmp32 > configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength.) |
| 834 | tmp32 = configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength.; |
| 835 | |
| 836 | if (s->lengthcxx . . $ moduleSample_t#length. >= s->loopLengthcxx . . $ moduleSample_t#loopLength.) |
| 837 | { |
| 838 | if (tmp32+s->loopLengthcxx . . $ moduleSample_t#loopLength. > s->lengthcxx . . $ moduleSample_t#length.) |
| 839 | tmp32 = s->lengthcxx . . $ moduleSample_t#length. - s->loopLengthcxx . . $ moduleSample_t#loopLength.; |
| 840 | } |
| 841 | else |
| 842 | { |
| 843 | tmp32 = 0; |
| 844 | } |
| 845 | |
| 846 | tmp32 &= ~1; |
| 847 | |
| 848 | if (s->loopStartcxx . . $ moduleSample_t#loopStart. != tmp32) |
| 849 | { |
| 850 | turnOffVoicescxx . . $ turnOffVoices(49f6e7a06ebc5aa8).(); |
| 851 | s->loopStartcxx . . $ moduleSample_t#loopStart. = tmp32; |
| 852 | updatePaulaLoopscxx . . $ updatePaulaLoops(49f6e7a06ebc5aa8).(); |
| 853 | |
| 854 | uicxx . . $ ui..updateCurrSampleRepeatcxx . . $ ui_t#updateCurrSampleRepeat. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 855 | |
| 856 | if (uicxx . . $ ui..editOpScreenShowncxx . . $ ui_t#editOpScreenShown. && uicxx . . $ ui..editOpScreencxx . . $ ui_t#editOpScreen. == 3) |
| 857 | uicxx . . $ ui..updateChordLengthTextcxx . . $ ui_t#updateChordLengthText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 858 | |
| 859 | if (uicxx . . $ ui..samplerScreenShowncxx . . $ ui_t#samplerScreenShown.) |
| 860 | setLoopSpritescxx . . $ setLoopSprites(49f6e7a06ebc5aa8).(); |
| 861 | |
| 862 | updateWindowTitlecxx . . $ updateWindowTitle(b45ddcbc8423892c).(MOD_IS_MODIFIEDcxx . . $ MOD_IS_MODIFIED.); |
| 863 | } |
| 864 | } |
| 865 | } |
| 866 | break; |
| 867 | |
| 868 | case PTB_SREPLENScxx . . $ PTB_SREPLENS.: |
| 869 | { |
| 870 | s->loopLengthDispcxx . . $ moduleSample_t#loopLengthDisp. = &s->loopLengthcxx . . $ moduleSample_t#loopLength.; |
| 871 | |
| 872 | if (updateValue) |
| 873 | { |
| 874 | tmp32 = textEditcxx . . $ textEdit..tmpDisp32cxx . . $ textEdit_t#tmpDisp32. & ~1; // even'ify |
| 875 | if (tmp32 > configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength.) |
| 876 | tmp32 = configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength.; |
| 877 | |
| 878 | if (s->lengthcxx . . $ moduleSample_t#length. >= s->loopStartcxx . . $ moduleSample_t#loopStart.) |
| 879 | { |
| 880 | if (s->loopStartcxx . . $ moduleSample_t#loopStart.+tmp32 > s->lengthcxx . . $ moduleSample_t#length.) |
| 881 | tmp32 = s->lengthcxx . . $ moduleSample_t#length. - s->loopStartcxx . . $ moduleSample_t#loopStart.; |
| 882 | } |
| 883 | else |
| 884 | { |
| 885 | tmp32 = 2; |
| 886 | } |
| 887 | |
| 888 | tmp32 &= ~1; |
| 889 | |
| 890 | if (tmp32 < 2) |
| 891 | tmp32 = 2; |
| 892 | |
| 893 | if (s->loopLengthcxx . . $ moduleSample_t#loopLength. != tmp32) |
| 894 | { |
| 895 | turnOffVoicescxx . . $ turnOffVoices(49f6e7a06ebc5aa8).(); |
| 896 | s->loopLengthcxx . . $ moduleSample_t#loopLength. = tmp32; |
| 897 | updatePaulaLoopscxx . . $ updatePaulaLoops(49f6e7a06ebc5aa8).(); |
| 898 | |
| 899 | uicxx . . $ ui..updateCurrSampleReplencxx . . $ ui_t#updateCurrSampleReplen. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 900 | if (uicxx . . $ ui..editOpScreenShowncxx . . $ ui_t#editOpScreenShown. && uicxx . . $ ui..editOpScreencxx . . $ ui_t#editOpScreen. == 3) |
| 901 | uicxx . . $ ui..updateChordLengthTextcxx . . $ ui_t#updateChordLengthText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 902 | |
| 903 | if (uicxx . . $ ui..samplerScreenShowncxx . . $ ui_t#samplerScreenShown.) |
| 904 | setLoopSpritescxx . . $ setLoopSprites(49f6e7a06ebc5aa8).(); |
| 905 | |
| 906 | updateWindowTitlecxx . . $ updateWindowTitle(b45ddcbc8423892c).(MOD_IS_MODIFIEDcxx . . $ MOD_IS_MODIFIED.); |
| 907 | } |
| 908 | } |
| 909 | } |
| 910 | break; |
| 911 | |
| 912 | default: break; |
| 913 | } |
| 914 | |
| 915 | pointerSetPreviousModecxx . . $ pointerSetPreviousMode(49f6e7a06ebc5aa8).(); |
| 916 | } |
| 917 | |
| 918 | textEditcxx . . $ textEdit..typecxx . . $ textEdit_t#type. = 0; |
| 919 | } |
| 920 | |
| 921 | void handleTextEditInputCharcxx . . $ handleTextEditInputChar(44b6ea1973a07080).(char textChar) |
| 922 | { |
| 923 | // we only want certain keys |
| 924 | if (textChar < ' ' || textChar > '~') |
| 925 | return; |
| 926 | |
| 927 | // A..Z -> a..z |
| 928 | if (textChar >= 'A' && textChar <= 'Z') |
| 929 | textChar = (char)tolowercxx . . $ `<external>/17904084882347303253/ctype.h:220:11`!(textChar); |
| 930 | |
| 931 | if (textEditcxx . . $ textEdit..typecxx . . $ textEdit_t#type. == TEXT_EDIT_STRINGcxx . . $ TEXT_EDIT_STRING.) |
| 932 | { |
| 933 | if (textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr. < textEditcxx . . $ textEdit..textEndPtrcxx . . $ textEdit_t#textEndPtr.) |
| 934 | { |
| 935 | if (!editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag.) |
| 936 | { |
| 937 | char *readTmp = textEditcxx . . $ textEdit..textEndPtrcxx . . $ textEdit_t#textEndPtr.; |
| 938 | while (readTmp > textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.) |
| 939 | { |
| 940 | int8_tcxx . . $ int8_t# readTmpPrev = *--readTmp; |
| 941 | *(readTmp + 1) = readTmpPrev; |
| 942 | } |
| 943 | |
| 944 | *textEditcxx . . $ textEdit..textEndPtrcxx . . $ textEdit_t#textEndPtr. = '\0'; |
| 945 | *textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.++ = textChar; |
| 946 | |
| 947 | moveTextCursorRightcxx . . $ moveTextCursorRight(49f6e7a06ebc5aa8).(); |
| 948 | } |
| 949 | else if ((textChar >= '0' && textChar <= '9') || (textChar >= 'a' && textChar <= 'f')) |
| 950 | { |
| 951 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 14) // hack for sample mix text |
| 952 | { |
| 953 | *textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr. = textChar; |
| 954 | } |
| 955 | else |
| 956 | { |
| 957 | *textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.++ = textChar; |
| 958 | moveTextCursorRightcxx . . $ moveTextCursorRight(49f6e7a06ebc5aa8).(); |
| 959 | |
| 960 | // hack for sample mix text |
| 961 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 9) |
| 962 | { |
| 963 | for (int32_tcxx . . $ int32_t# i = 0; i < 4; i++) |
| 964 | { |
| 965 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.++; |
| 966 | moveTextCursorRightcxx . . $ moveTextCursorRight(49f6e7a06ebc5aa8).(); |
| 967 | } |
| 968 | } |
| 969 | else if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 6) |
| 970 | { |
| 971 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.++; |
| 972 | moveTextCursorRightcxx . . $ moveTextCursorRight(49f6e7a06ebc5aa8).(); |
| 973 | } |
| 974 | } |
| 975 | } |
| 976 | } |
| 977 | } |
| 978 | else |
| 979 | { |
| 980 | if (textEditcxx . . $ textEdit..typecxx . . $ textEdit_t#type. == TEXT_EDIT_DECIMALcxx . . $ TEXT_EDIT_DECIMAL.) |
| 981 | { |
| 982 | if (textChar >= '0' && textChar <= '9') |
| 983 | { |
| 984 | uint8_tcxx . . $ uint8_t# digit1, digit2, digit3, digit4; |
| 985 | uint32_tcxx . . $ uint32_t# number; |
| 986 | |
| 987 | textChar -= '0'; |
| 988 | |
| 989 | if (textEditcxx . . $ textEdit..numDigitscxx . . $ textEdit_t#numDigits. == 4) |
| 990 | { |
| 991 | number = *textEditcxx . . $ textEdit..numPtr16cxx . . $ textEdit_t#numPtr16.; |
| 992 | digit4 = number % 10; number /= 10; |
| 993 | digit3 = number % 10; number /= 10; |
| 994 | digit2 = number % 10; number /= 10; |
| 995 | digit1 = (uint8_tcxx . . $ uint8_t#)number; |
| 996 | |
| 997 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 0) *textEditcxx . . $ textEdit..numPtr16cxx . . $ textEdit_t#numPtr16. = (textChar * 1000) + (digit2 * 100) + (digit3 * 10) + digit4; |
| 998 | else if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 1) *textEditcxx . . $ textEdit..numPtr16cxx . . $ textEdit_t#numPtr16. = (digit1 * 1000) + (textChar * 100) + (digit3 * 10) + digit4; |
| 999 | else if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 2) *textEditcxx . . $ textEdit..numPtr16cxx . . $ textEdit_t#numPtr16. = (digit1 * 1000) + (digit2 * 100) + (textChar * 10) + digit4; |
| 1000 | else if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 3) *textEditcxx . . $ textEdit..numPtr16cxx . . $ textEdit_t#numPtr16. = (digit1 * 1000) + (digit2 * 100) + (digit3 * 10) + textChar; |
| 1001 | } |
| 1002 | else if (textEditcxx . . $ textEdit..numDigitscxx . . $ textEdit_t#numDigits. == 3) |
| 1003 | { |
| 1004 | number = *textEditcxx . . $ textEdit..numPtr16cxx . . $ textEdit_t#numPtr16.; |
| 1005 | digit3 = number % 10; number /= 10; |
| 1006 | digit2 = number % 10; number /= 10; |
| 1007 | digit1 = (uint8_tcxx . . $ uint8_t#)number; |
| 1008 | |
| 1009 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 0) *textEditcxx . . $ textEdit..numPtr16cxx . . $ textEdit_t#numPtr16. = (textChar * 100) + (digit2 * 10) + digit3; |
| 1010 | else if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 1) *textEditcxx . . $ textEdit..numPtr16cxx . . $ textEdit_t#numPtr16. = (digit1 * 100) + (textChar * 10) + digit3; |
| 1011 | else if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 2) *textEditcxx . . $ textEdit..numPtr16cxx . . $ textEdit_t#numPtr16. = (digit1 * 100) + (digit2 * 10) + textChar; |
| 1012 | } |
| 1013 | else if (textEditcxx . . $ textEdit..numDigitscxx . . $ textEdit_t#numDigits. == 2) |
| 1014 | { |
| 1015 | number = *textEditcxx . . $ textEdit..numPtr16cxx . . $ textEdit_t#numPtr16.; |
| 1016 | digit2 = number % 10; number /= 10; |
| 1017 | digit1 = (uint8_tcxx . . $ uint8_t#)number; |
| 1018 | |
| 1019 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 0) *textEditcxx . . $ textEdit..numPtr16cxx . . $ textEdit_t#numPtr16. = (textChar * 10) + digit2; |
| 1020 | else if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. == 1) *textEditcxx . . $ textEdit..numPtr16cxx . . $ textEdit_t#numPtr16. = (digit1 * 10) + textChar; |
| 1021 | } |
| 1022 | |
| 1023 | moveTextCursorRightcxx . . $ moveTextCursorRight(49f6e7a06ebc5aa8).(); |
| 1024 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. >= textEditcxx . . $ textEdit..numDigitscxx . . $ textEdit_t#numDigits.) |
| 1025 | leaveTextEditModecxx . . $ leaveTextEditMode(b45ddcbc8423892c).(EDIT_TEXT_UPDATEcxx . . $ EDIT_TEXT_UPDATE.); |
| 1026 | } |
| 1027 | } |
| 1028 | else |
| 1029 | { |
| 1030 | if ((textChar >= '0' && textChar <= '9') || (textChar >= 'a' && textChar <= 'f')) |
| 1031 | { |
| 1032 | if (textChar <= '9') |
| 1033 | textChar -= '0'; |
| 1034 | else if (textChar <= 'f') |
| 1035 | textChar -= 'a'-10; |
| 1036 | |
| 1037 | if (textEditcxx . . $ textEdit..numBitscxx . . $ textEdit_t#numBits. == 17) |
| 1038 | { |
| 1039 | *textEditcxx . . $ textEdit..numPtr32cxx . . $ textEdit_t#numPtr32. &= ~(0xF0000 >> (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. << 2)); |
| 1040 | *textEditcxx . . $ textEdit..numPtr32cxx . . $ textEdit_t#numPtr32. |= textChar << (16 - (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. << 2)); |
| 1041 | } |
| 1042 | else if (textEditcxx . . $ textEdit..numBitscxx . . $ textEdit_t#numBits. == 16) |
| 1043 | { |
| 1044 | if (textEditcxx . . $ textEdit..force32BitNumPtrcxx . . $ textEdit_t#force32BitNumPtr.) |
| 1045 | { |
| 1046 | *textEditcxx . . $ textEdit..numPtr32cxx . . $ textEdit_t#numPtr32. &= ~(0xF000 >> (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. << 2)); |
| 1047 | *textEditcxx . . $ textEdit..numPtr32cxx . . $ textEdit_t#numPtr32. |= textChar << (12 - (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. << 2)); |
| 1048 | } |
| 1049 | else |
| 1050 | { |
| 1051 | *textEditcxx . . $ textEdit..numPtr16cxx . . $ textEdit_t#numPtr16. &= ~(0xF000 >> (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. << 2)); |
| 1052 | *textEditcxx . . $ textEdit..numPtr16cxx . . $ textEdit_t#numPtr16. |= textChar << (12 - (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. << 2)); |
| 1053 | } |
| 1054 | } |
| 1055 | else if (textEditcxx . . $ textEdit..numBitscxx . . $ textEdit_t#numBits. == 8) |
| 1056 | { |
| 1057 | *textEditcxx . . $ textEdit..numPtr8cxx . . $ textEdit_t#numPtr8. &= ~(0xF0 >> (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. << 2)); |
| 1058 | *textEditcxx . . $ textEdit..numPtr8cxx . . $ textEdit_t#numPtr8. |= textChar << (4 - (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. << 2)); |
| 1059 | } |
| 1060 | |
| 1061 | moveTextCursorRightcxx . . $ moveTextCursorRight(49f6e7a06ebc5aa8).(); |
| 1062 | if (textEditcxx . . $ textEdit..cursorBlockcxx . . $ textEdit_t#cursorBlock. >= textEditcxx . . $ textEdit..numDigitscxx . . $ textEdit_t#numDigits.) |
| 1063 | leaveTextEditModecxx . . $ leaveTextEditMode(b45ddcbc8423892c).(EDIT_TEXT_UPDATEcxx . . $ EDIT_TEXT_UPDATE.); |
| 1064 | } |
| 1065 | } |
| 1066 | } |
| 1067 | |
| 1068 | redrawTextEditObjectcxx . . $ redrawTextEditObject(49f6e7a06ebc5aa8).(); |
| 1069 | |
| 1070 | if (!keybcxx . . $ keyb..repeatKeycxx . . $ keyb_t#repeatKey.) |
| 1071 | keybcxx . . $ keyb..delayCountercxx . . $ keyb_t#delayCounter. = 0; |
| 1072 | |
| 1073 | keybcxx . . $ keyb..repeatKeycxx . . $ keyb_t#repeatKey. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1074 | keybcxx . . $ keyb..delayKeycxx . . $ keyb_t#delayKey. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1075 | } |
| 1076 | |
| 1077 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! handleTextEditModecxx . . $ handleTextEditMode(701ccd9e525c23ba).(SDL_Scancodecxx . . $ SDL_Scancode# scancode) |
| 1078 | { |
| 1079 | switch (scancode) |
| 1080 | { |
| 1081 | case SDL_SCANCODE_ESCAPEcxx . . $ SDL_SCANCODE_ESCAPE.: |
| 1082 | { |
| 1083 | editorcxx . . $ editor..blockMarkFlagcxx . . $ editor_t#blockMarkFlag. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1084 | if (uicxx . . $ ui..editTextFlagcxx . . $ ui_t#editTextFlag.) |
| 1085 | { |
| 1086 | leaveTextEditModecxx . . $ leaveTextEditMode(b45ddcbc8423892c).(EDIT_TEXT_NO_UPDATEcxx . . $ EDIT_TEXT_NO_UPDATE.); |
| 1087 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1088 | } |
| 1089 | } |
| 1090 | break; |
| 1091 | |
| 1092 | case SDL_SCANCODE_HOMEcxx . . $ SDL_SCANCODE_HOME.: |
| 1093 | { |
| 1094 | if (uicxx . . $ ui..editTextFlagcxx . . $ ui_t#editTextFlag. && !editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag. && textEditcxx . . $ textEdit..typecxx . . $ textEdit_t#type. == TEXT_EDIT_STRINGcxx . . $ TEXT_EDIT_STRING.) |
| 1095 | { |
| 1096 | while (textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr. > textEditcxx . . $ textEdit..textStartPtrcxx . . $ textEdit_t#textStartPtr.) |
| 1097 | editTextPrevCharcxx . . $ editTextPrevChar(49f6e7a06ebc5aa8).(); |
| 1098 | } |
| 1099 | } |
| 1100 | break; |
| 1101 | |
| 1102 | case SDL_SCANCODE_ENDcxx . . $ SDL_SCANCODE_END.: |
| 1103 | { |
| 1104 | if (uicxx . . $ ui..editTextFlagcxx . . $ ui_t#editTextFlag. && !editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag. && textEditcxx . . $ textEdit..typecxx . . $ textEdit_t#type. == TEXT_EDIT_STRINGcxx . . $ TEXT_EDIT_STRING.) |
| 1105 | { |
| 1106 | while (!textEditcxx . . $ textEdit..endReachedcxx . . $ textEdit_t#endReached.) |
| 1107 | editTextNextCharcxx . . $ editTextNextChar(49f6e7a06ebc5aa8).(); |
| 1108 | } |
| 1109 | } |
| 1110 | break; |
| 1111 | |
| 1112 | case SDL_SCANCODE_LEFTcxx . . $ SDL_SCANCODE_LEFT.: |
| 1113 | { |
| 1114 | if (uicxx . . $ ui..editTextFlagcxx . . $ ui_t#editTextFlag.) |
| 1115 | { |
| 1116 | editTextPrevCharcxx . . $ editTextPrevChar(49f6e7a06ebc5aa8).(); |
| 1117 | if (!keybcxx . . $ keyb..repeatKeycxx . . $ keyb_t#repeatKey.) |
| 1118 | keybcxx . . $ keyb..delayCountercxx . . $ keyb_t#delayCounter. = 0; |
| 1119 | |
| 1120 | keybcxx . . $ keyb..repeatKeycxx . . $ keyb_t#repeatKey. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1121 | keybcxx . . $ keyb..delayKeycxx . . $ keyb_t#delayKey. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1122 | } |
| 1123 | else |
| 1124 | { |
| 1125 | keybcxx . . $ keyb..delayKeycxx . . $ keyb_t#delayKey. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1126 | keybcxx . . $ keyb..repeatKeycxx . . $ keyb_t#repeatKey. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1127 | } |
| 1128 | } |
| 1129 | break; |
| 1130 | |
| 1131 | case SDL_SCANCODE_RIGHTcxx . . $ SDL_SCANCODE_RIGHT.: |
| 1132 | { |
| 1133 | if (uicxx . . $ ui..editTextFlagcxx . . $ ui_t#editTextFlag.) |
| 1134 | { |
| 1135 | editTextNextCharcxx . . $ editTextNextChar(49f6e7a06ebc5aa8).(); |
| 1136 | if (!keybcxx . . $ keyb..repeatKeycxx . . $ keyb_t#repeatKey.) |
| 1137 | keybcxx . . $ keyb..delayCountercxx . . $ keyb_t#delayCounter. = 0; |
| 1138 | |
| 1139 | keybcxx . . $ keyb..repeatKeycxx . . $ keyb_t#repeatKey. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1140 | keybcxx . . $ keyb..delayKeycxx . . $ keyb_t#delayKey. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1141 | } |
| 1142 | else |
| 1143 | { |
| 1144 | keybcxx . . $ keyb..delayKeycxx . . $ keyb_t#delayKey. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1145 | keybcxx . . $ keyb..repeatKeycxx . . $ keyb_t#repeatKey. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1146 | } |
| 1147 | } |
| 1148 | break; |
| 1149 | |
| 1150 | case SDL_SCANCODE_DELETEcxx . . $ SDL_SCANCODE_DELETE.: |
| 1151 | { |
| 1152 | if (uicxx . . $ ui..editTextFlagcxx . . $ ui_t#editTextFlag.) |
| 1153 | { |
| 1154 | if (editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag. || textEditcxx . . $ textEdit..typecxx . . $ textEdit_t#type. != TEXT_EDIT_STRINGcxx . . $ TEXT_EDIT_STRING.) |
| 1155 | break; |
| 1156 | |
| 1157 | char *readTmp = textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.; |
| 1158 | while (readTmp < textEditcxx . . $ textEdit..textEndPtrcxx . . $ textEdit_t#textEndPtr.) |
| 1159 | { |
| 1160 | int8_tcxx . . $ int8_t# readTmpNext = *(readTmp + 1); |
| 1161 | *readTmp++ = readTmpNext; |
| 1162 | } |
| 1163 | |
| 1164 | // kludge to prevent cloning last character if the song/sample name has one character too much |
| 1165 | if (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_SONGNAMEcxx . . $ PTB_SONGNAME. || textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_SAMPLENAMEcxx . . $ PTB_SAMPLENAME. || textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_PE_PATTNAMEcxx . . $ PTB_PE_PATTNAME.) |
| 1166 | *textEditcxx . . $ textEdit..textEndPtrcxx . . $ textEdit_t#textEndPtr. = '\0'; |
| 1167 | |
| 1168 | if (!keybcxx . . $ keyb..repeatKeycxx . . $ keyb_t#repeatKey.) |
| 1169 | keybcxx . . $ keyb..delayCountercxx . . $ keyb_t#delayCounter. = 0; |
| 1170 | |
| 1171 | keybcxx . . $ keyb..repeatKeycxx . . $ keyb_t#repeatKey. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1172 | keybcxx . . $ keyb..delayKeycxx . . $ keyb_t#delayKey. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1173 | |
| 1174 | redrawTextEditObjectcxx . . $ redrawTextEditObject(49f6e7a06ebc5aa8).(); |
| 1175 | } |
| 1176 | } |
| 1177 | break; |
| 1178 | |
| 1179 | case SDL_SCANCODE_BACKSPACEcxx . . $ SDL_SCANCODE_BACKSPACE.: |
| 1180 | { |
| 1181 | if (uicxx . . $ ui..editTextFlagcxx . . $ ui_t#editTextFlag.) |
| 1182 | { |
| 1183 | if (editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag. || textEditcxx . . $ textEdit..typecxx . . $ textEdit_t#type. != TEXT_EDIT_STRINGcxx . . $ TEXT_EDIT_STRING.) |
| 1184 | break; |
| 1185 | |
| 1186 | if (textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr. > textEditcxx . . $ textEdit..textStartPtrcxx . . $ textEdit_t#textStartPtr.) |
| 1187 | { |
| 1188 | textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.--; |
| 1189 | |
| 1190 | char *readTmp = textEditcxx . . $ textEdit..textPtrcxx . . $ textEdit_t#textPtr.; |
| 1191 | while (readTmp < textEditcxx . . $ textEdit..textEndPtrcxx . . $ textEdit_t#textEndPtr.) |
| 1192 | { |
| 1193 | int8_tcxx . . $ int8_t# readTmpNext = *(readTmp + 1); |
| 1194 | *readTmp++ = readTmpNext; |
| 1195 | } |
| 1196 | |
| 1197 | // kludge to prevent cloning last character if the song/sample name has one character too much |
| 1198 | if (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_SONGNAMEcxx . . $ PTB_SONGNAME. || textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_SAMPLENAMEcxx . . $ PTB_SAMPLENAME. || textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_PE_PATTNAMEcxx . . $ PTB_PE_PATTNAME.) |
| 1199 | *textEditcxx . . $ textEdit..textEndPtrcxx . . $ textEdit_t#textEndPtr. = '\0'; |
| 1200 | |
| 1201 | moveTextCursorLeftcxx . . $ moveTextCursorLeft(49f6e7a06ebc5aa8).(); |
| 1202 | redrawTextEditObjectcxx . . $ redrawTextEditObject(49f6e7a06ebc5aa8).(); |
| 1203 | } |
| 1204 | |
| 1205 | if (!keybcxx . . $ keyb..repeatKeycxx . . $ keyb_t#repeatKey.) |
| 1206 | keybcxx . . $ keyb..delayCountercxx . . $ keyb_t#delayCounter. = 0; |
| 1207 | |
| 1208 | keybcxx . . $ keyb..repeatKeycxx . . $ keyb_t#repeatKey. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1209 | keybcxx . . $ keyb..delayKeycxx . . $ keyb_t#delayKey. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1210 | } |
| 1211 | else |
| 1212 | { |
| 1213 | if (uicxx . . $ ui..diskOpScreenShowncxx . . $ ui_t#diskOpScreenShown.) |
| 1214 | { |
| 1215 | #ifdef _WIN32 |
| 1216 | diskOpSetPath(L"..", DISKOP_CACHE); |
| 1217 | #else |
| 1218 | diskOpSetPathcxx . . $ diskOpSetPath(b66281b8031ad34f).("..", DISKOP_CACHEcxx . . $ DISKOP_CACHE.); |
| 1219 | #endif |
| 1220 | } |
| 1221 | else if (keybcxx . . $ keyb..shiftPressedcxx . . $ keyb_t#shiftPressed. || keybcxx . . $ keyb..leftAltPressedcxx . . $ keyb_t#leftAltPressed. || keybcxx . . $ keyb..leftCtrlPressedcxx . . $ keyb_t#leftCtrlPressed.) |
| 1222 | { |
| 1223 | saveUndocxx . . $ saveUndo(49f6e7a06ebc5aa8).(); |
| 1224 | if (keybcxx . . $ keyb..leftAltPressedcxx . . $ keyb_t#leftAltPressed. && !keybcxx . . $ keyb..leftCtrlPressedcxx . . $ keyb_t#leftCtrlPressed.) |
| 1225 | { |
| 1226 | if (songcxx . . $ song.->currRowcxx . . $ module_t#currRow. > 0) |
| 1227 | { |
| 1228 | for (int32_tcxx . . $ int32_t# i = 0; i < PAULA_VOICEScxx . . $ `src/pt2_paula.h:13:9`!; i++) |
| 1229 | { |
| 1230 | for (int32_tcxx . . $ int32_t# j = (songcxx . . $ song.->currRowcxx . . $ module_t#currRow. - 1); j < MOD_ROWScxx . . $ `src/pt2_header.h:73:9`!; j++) |
| 1231 | { |
| 1232 | note_tcxx . . $ note_t# *noteSrc = &songcxx . . $ song.->patternscxx . . $ module_t#patterns.[songcxx . . $ song.->currPatterncxx . . $ module_t#currPattern.][((j + 1) * PAULA_VOICEScxx . . $ `src/pt2_paula.h:13:9`!) + i]; |
| 1233 | songcxx . . $ song.->patternscxx . . $ module_t#patterns.[songcxx . . $ song.->currPatterncxx . . $ module_t#currPattern.][(j * PAULA_VOICEScxx . . $ `src/pt2_paula.h:13:9`!) + i] = *noteSrc; |
| 1234 | } |
| 1235 | |
| 1236 | // clear newly made row on very bottom |
| 1237 | note_tcxx . . $ note_t# *noteDst = &songcxx . . $ song.->patternscxx . . $ module_t#patterns.[songcxx . . $ song.->currPatterncxx . . $ module_t#currPattern.][(63 * PAULA_VOICEScxx . . $ `src/pt2_paula.h:13:9`!) + i]; |
| 1238 | noteDst->periodcxx . . $ note_t#period. = 0; |
| 1239 | noteDst->samplecxx . . $ note_t#sample. = 0; |
| 1240 | noteDst->commandcxx . . $ note_t#command. = 0; |
| 1241 | noteDst->paramcxx . . $ note_t#param. = 0; |
| 1242 | } |
| 1243 | |
| 1244 | songcxx . . $ song.->currRowcxx . . $ module_t#currRow.--; |
| 1245 | uicxx . . $ ui..updatePatternDatacxx . . $ ui_t#updatePatternData. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1246 | } |
| 1247 | } |
| 1248 | else |
| 1249 | { |
| 1250 | if (songcxx . . $ song.->currRowcxx . . $ module_t#currRow. > 0) |
| 1251 | { |
| 1252 | for (int32_tcxx . . $ int32_t# i = songcxx . . $ song.->currRowcxx . . $ module_t#currRow.-1; i < MOD_ROWScxx . . $ `src/pt2_header.h:73:9`!-1; i++) |
| 1253 | { |
| 1254 | note_tcxx . . $ note_t# *noteSrc = &songcxx . . $ song.->patternscxx . . $ module_t#patterns.[songcxx . . $ song.->currPatterncxx . . $ module_t#currPattern.][((i + 1) * PAULA_VOICEScxx . . $ `src/pt2_paula.h:13:9`!) + cursorcxx . . $ cursor..channelcxx . . $ cursor_t#channel.]; |
| 1255 | note_tcxx . . $ note_t# *noteDst = &songcxx . . $ song.->patternscxx . . $ module_t#patterns.[songcxx . . $ song.->currPatterncxx . . $ module_t#currPattern.][(i * PAULA_VOICEScxx . . $ `src/pt2_paula.h:13:9`!) + cursorcxx . . $ cursor..channelcxx . . $ cursor_t#channel.]; |
| 1256 | |
| 1257 | if (keybcxx . . $ keyb..leftCtrlPressedcxx . . $ keyb_t#leftCtrlPressed.) |
| 1258 | { |
| 1259 | noteDst->commandcxx . . $ note_t#command. = noteSrc->commandcxx . . $ note_t#command.; |
| 1260 | noteDst->paramcxx . . $ note_t#param. = noteSrc->paramcxx . . $ note_t#param.; |
| 1261 | } |
| 1262 | else |
| 1263 | { |
| 1264 | *noteDst = *noteSrc; |
| 1265 | } |
| 1266 | } |
| 1267 | |
| 1268 | // clear newly made row on very bottom |
| 1269 | note_tcxx . . $ note_t# *noteDst = &songcxx . . $ song.->patternscxx . . $ module_t#patterns.[songcxx . . $ song.->currPatterncxx . . $ module_t#currPattern.][(63 * PAULA_VOICEScxx . . $ `src/pt2_paula.h:13:9`!) + cursorcxx . . $ cursor..channelcxx . . $ cursor_t#channel.]; |
| 1270 | noteDst->periodcxx . . $ note_t#period. = 0; |
| 1271 | noteDst->samplecxx . . $ note_t#sample. = 0; |
| 1272 | noteDst->commandcxx . . $ note_t#command. = 0; |
| 1273 | noteDst->paramcxx . . $ note_t#param. = 0; |
| 1274 | |
| 1275 | songcxx . . $ song.->currRowcxx . . $ module_t#currRow.--; |
| 1276 | uicxx . . $ ui..updatePatternDatacxx . . $ ui_t#updatePatternData. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1277 | } |
| 1278 | } |
| 1279 | } |
| 1280 | else |
| 1281 | { |
| 1282 | const boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! audioWasntLocked = !audiocxx . . $ audio..lockedcxx . . $ audio_t#locked.; |
| 1283 | if (audioWasntLocked) |
| 1284 | lockAudiocxx . . $ lockAudio(49f6e7a06ebc5aa8).(); |
| 1285 | |
| 1286 | editorcxx . . $ editor..stepPlayEnabledcxx . . $ editor_t#stepPlayEnabled. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1287 | editorcxx . . $ editor..stepPlayBackwardscxx . . $ editor_t#stepPlayBackwards. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1288 | |
| 1289 | editorcxx . . $ editor..stepPlayLastModecxx . . $ editor_t#stepPlayLastMode. = editorcxx . . $ editor..currModecxx . . $ editor_t#currMode.; |
| 1290 | |
| 1291 | if (configcxx . . $ config..keepEditModeAfterStepPlaycxx . . $ config_t#keepEditModeAfterStepPlay. && editorcxx . . $ editor..stepPlayLastModecxx . . $ editor_t#stepPlayLastMode. == MODE_EDITcxx . . $ MODE_EDIT.) |
| 1292 | doStopItcxx . . $ doStopIt(b45ddcbc8423892c).(falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!); |
| 1293 | else |
| 1294 | doStopItcxx . . $ doStopIt(b45ddcbc8423892c).(truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!); |
| 1295 | |
| 1296 | playPatterncxx . . $ playPattern(4af4fd0e2b26c4ac).((songcxx . . $ song.->currRowcxx . . $ module_t#currRow. - 1) & 63); |
| 1297 | |
| 1298 | if (configcxx . . $ config..keepEditModeAfterStepPlaycxx . . $ config_t#keepEditModeAfterStepPlay. && editorcxx . . $ editor..stepPlayLastModecxx . . $ editor_t#stepPlayLastMode. == MODE_EDITcxx . . $ MODE_EDIT.) |
| 1299 | { |
| 1300 | pointerSetModecxx . . $ pointerSetMode(f2ac3508b56cd10).(POINTER_MODE_EDITcxx . . $ POINTER_MODE_EDIT., DO_CARRYcxx . . $ DO_CARRY.); |
| 1301 | editorcxx . . $ editor..playModecxx . . $ editor_t#playMode. = PLAY_MODE_NORMALcxx . . $ PLAY_MODE_NORMAL.; |
| 1302 | editorcxx . . $ editor..currModecxx . . $ editor_t#currMode. = MODE_EDITcxx . . $ MODE_EDIT.; |
| 1303 | } |
| 1304 | |
| 1305 | if (audioWasntLocked) |
| 1306 | unlockAudiocxx . . $ unlockAudio(49f6e7a06ebc5aa8).(); |
| 1307 | } |
| 1308 | } |
| 1309 | } |
| 1310 | break; |
| 1311 | |
| 1312 | default: break; |
| 1313 | } |
| 1314 | |
| 1315 | if (uicxx . . $ ui..editTextFlagcxx . . $ ui_t#editTextFlag.) |
| 1316 | { |
| 1317 | if (scancode == SDL_SCANCODE_RETURNcxx . . $ SDL_SCANCODE_RETURN. || scancode == SDL_SCANCODE_KP_ENTERcxx . . $ SDL_SCANCODE_KP_ENTER.) |
| 1318 | { |
| 1319 | // dirty hack |
| 1320 | if (textEditcxx . . $ textEdit..objectcxx . . $ textEdit_t#object. == PTB_SAMPLEScxx . . $ PTB_SAMPLES.) |
| 1321 | textEditcxx . . $ textEdit..tmpDisp8cxx . . $ textEdit_t#tmpDisp8.++; |
| 1322 | |
| 1323 | leaveTextEditModecxx . . $ leaveTextEditMode(b45ddcbc8423892c).(EDIT_TEXT_UPDATEcxx . . $ EDIT_TEXT_UPDATE.); |
| 1324 | |
| 1325 | if (editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag.) |
| 1326 | { |
| 1327 | editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1328 | uicxx . . $ ui..updateMixTextcxx . . $ ui_t#updateMixText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1329 | doMixcxx . . $ doMix(49f6e7a06ebc5aa8).(); |
| 1330 | } |
| 1331 | } |
| 1332 | |
| 1333 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; // don't continue further key handling |
| 1334 | } |
| 1335 | |
| 1336 | return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; // continue further key handling (we're not editing text) |
| 1337 | } |