Rev 2628 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
240 | tk | 1 | // $Id: seq_ui_opt.c 2633 2019-01-04 11:10:04Z tk $ |
2 | /* |
||
3 | * Options page |
||
4 | * |
||
5 | * ========================================================================== |
||
6 | * |
||
7 | * Copyright (C) 2008 Thorsten Klose (tk@midibox.org) |
||
8 | * Licensed for personal non-commercial use only. |
||
9 | * All other rights reserved. |
||
10 | * |
||
11 | * ========================================================================== |
||
12 | */ |
||
13 | |||
14 | ///////////////////////////////////////////////////////////////////////////// |
||
15 | // Include files |
||
16 | ///////////////////////////////////////////////////////////////////////////// |
||
17 | |||
18 | #include <mios32.h> |
||
1810 | tk | 19 | #include <string.h> |
352 | tk | 20 | #include "tasks.h" |
21 | |||
240 | tk | 22 | #include "seq_lcd.h" |
23 | #include "seq_ui.h" |
||
24 | |||
1123 | tk | 25 | #include "seq_file.h" |
352 | tk | 26 | #include "seq_file_c.h" |
1052 | tk | 27 | #include "seq_file_gc.h" |
352 | tk | 28 | |
240 | tk | 29 | #include "seq_core.h" |
254 | tk | 30 | #include "seq_cc.h" |
2542 | tk | 31 | #include "seq_midi_in.h" |
625 | tk | 32 | #include "seq_midi_port.h" |
33 | #include "seq_midi_sysex.h" |
||
2027 | tk | 34 | #include "seq_mixer.h" |
1864 | tk | 35 | #include "seq_tpd.h" |
2020 | tk | 36 | #include "seq_blm.h" |
2130 | tk | 37 | #include "seq_lcd_logo.h" |
240 | tk | 38 | |
39 | |||
40 | ///////////////////////////////////////////////////////////////////////////// |
||
41 | // Local definitions |
||
42 | ///////////////////////////////////////////////////////////////////////////// |
||
43 | |||
2542 | tk | 44 | #define ITEM_STEPS_MEASURE 0 |
45 | #define ITEM_STEPS_PATTERN 1 |
||
46 | #define ITEM_SYNC_CHANGE 2 |
||
47 | #define ITEM_PATTERN_RESEND_PC 3 |
||
48 | #define ITEM_RATOPC 4 |
||
49 | #define ITEM_PATTERN_MIXER_MAP_COUPLING 5 |
||
50 | #define ITEM_SYNC_MUTE 6 |
||
51 | #define ITEM_SYNC_UNMUTE 7 |
||
2633 | tk | 52 | #define ITEM_UNMUTE_ON_PATTERN_CHANGE 8 |
53 | #define ITEM_SELECT_UNMUTED_TRACK 9 |
||
54 | #define ITEM_PASTE_CLR_ALL 10 |
||
55 | #define ITEM_RESTORE_TRACK_SELECTIONS 11 |
||
56 | #define ITEM_MODIFY_PATTERN_BANKS 12 |
||
57 | #define ITEM_ALL_FOR_STEP_VIEW_ONLY 13 |
||
58 | #define ITEM_PRINT_AND_MODIFY_WITHOUT_GATES 14 |
||
59 | #define ITEM_PRINT_TRANSPOSED_NOTES 15 |
||
60 | #define ITEM_METRONOME 16 |
||
61 | #define ITEM_SHADOW_OUT 17 |
||
62 | #define ITEM_MIDI_REMOTE 18 |
||
63 | #define ITEM_TRACK_CC 19 |
||
64 | #define ITEM_RUNTIME_STATUS_OPTIMIZATION 20 |
||
65 | #define ITEM_LIVE_LAYER_MUTE 21 |
||
66 | #define ITEM_INIT_WITH_TRIGGERS 22 |
||
67 | #define ITEM_INIT_CC 23 |
||
68 | #define ITEM_DRUM_CC 24 |
||
69 | #define ITEM_TPD_MODE 25 |
||
70 | #define ITEM_SWAP_GP_LED_COLOURS 26 |
||
71 | #define ITEM_INVERT_MUTE_LEDS 27 |
||
72 | #define ITEM_BLM_ALWAYS_USE_FTS 28 |
||
73 | #define ITEM_BLM_FADERS 29 |
||
74 | #define ITEM_MIXER_CC1234 30 |
||
75 | #define ITEM_MENU_SHORTCUTS 31 |
||
76 | #define ITEM_SCREEN_SAVER 32 |
||
240 | tk | 77 | |
2633 | tk | 78 | #define NUM_OF_ITEMS 33 |
1794 | tk | 79 | |
1810 | tk | 80 | |
81 | static const char *item_text[NUM_OF_ITEMS][2] = { |
||
82 | |||
83 | {//<--------------------------------------> |
||
84 | "Track Synchronisation", |
||
85 | "Steps per Measure:" // %3d |
||
86 | }, |
||
87 | |||
88 | {//<--------------------------------------> |
||
89 | "Pattern Change Synchronisation", |
||
90 | "Change considered each " // %3d steps |
||
91 | }, |
||
92 | |||
93 | {//<--------------------------------------> |
||
94 | "Pattern Change Synchronisation", |
||
95 | NULL, // enabled/disabled |
||
96 | }, |
||
97 | |||
98 | {//<--------------------------------------> |
||
2523 | tk | 99 | "Pattern Change re-sends Program Change", |
100 | NULL, // enabled/disabled |
||
101 | }, |
||
102 | |||
103 | {//<--------------------------------------> |
||
1810 | tk | 104 | "Restart all Tracks on Pattern Change", |
105 | NULL, // enabled/disabled |
||
106 | }, |
||
107 | |||
108 | {//<--------------------------------------> |
||
109 | "Dump a predefined Mixer Map on", |
||
110 | "Pattern Changes: ", // enabled/disabled |
||
111 | }, |
||
112 | |||
113 | {//<--------------------------------------> |
||
114 | "Synchronize MUTE to Measure", |
||
115 | NULL, // enabled/disabled |
||
116 | }, |
||
117 | |||
118 | {//<--------------------------------------> |
||
119 | "Synchronize UNMUTE to Measure", |
||
120 | NULL, // enabled/disabled |
||
121 | }, |
||
122 | |||
123 | {//<--------------------------------------> |
||
2633 | tk | 124 | "Unmute tracks on pattern change", |
125 | NULL, // enabled/disabled |
||
126 | }, |
||
127 | |||
128 | {//<--------------------------------------> |
||
2587 | tk | 129 | "Auto-Select unmuted Track", |
130 | NULL, // enabled/disabled |
||
131 | }, |
||
132 | |||
133 | {//<--------------------------------------> |
||
1810 | tk | 134 | "Paste and Clear button will modify", |
135 | NULL, // Only Steps/Complete Track |
||
136 | }, |
||
137 | |||
138 | {//<--------------------------------------> |
||
2250 | tk | 139 | "Selections restored on Track Change", |
140 | NULL, // enabled/disabled |
||
141 | }, |
||
142 | |||
143 | {//<--------------------------------------> |
||
2545 | tk | 144 | "Allow to change pattern banks", |
145 | NULL, // enabled/disabled |
||
146 | }, |
||
147 | |||
148 | {//<--------------------------------------> |
||
2628 | tk | 149 | "ALL Function works on Step View only", |
150 | NULL, // enabled/disabled |
||
151 | }, |
||
152 | |||
153 | {//<--------------------------------------> |
||
2564 | tk | 154 | "Print/Modify Steps w/o changing Gates", |
155 | NULL, // enabled/disabled |
||
156 | }, |
||
157 | |||
158 | {//<--------------------------------------> |
||
2567 | tk | 159 | "Print Notes with transposed value", |
160 | NULL, // enabled/disabled |
||
161 | }, |
||
162 | |||
163 | {//<--------------------------------------> |
||
2545 | tk | 164 | "Metronome Port Chn. Meas.Note BeatNote", |
165 | NULL, |
||
166 | }, |
||
167 | |||
168 | {//<--------------------------------------> |
||
169 | "ShadowOut Port Chn.", |
||
170 | NULL, |
||
171 | }, |
||
172 | |||
173 | {//<--------------------------------------> |
||
2542 | tk | 174 | "Frontpanel MIDI Remote Control", |
175 | "via: ", |
||
176 | }, |
||
177 | |||
178 | {//<--------------------------------------> |
||
179 | "Sending selected Track as CC to a DAW", |
||
180 | NULL, |
||
181 | }, |
||
182 | |||
183 | {//<--------------------------------------> |
||
184 | "MIDI OUT Runtime Status Optimization", |
||
185 | NULL, |
||
186 | }, |
||
187 | |||
188 | {//<--------------------------------------> |
||
2294 | tk | 189 | "If Live function, matching received", |
190 | "MIDI Events will: ", |
||
1810 | tk | 191 | }, |
192 | |||
193 | {//<--------------------------------------> |
||
2294 | tk | 194 | "Initial Gate Trigger Layer Pattern:", |
195 | NULL, |
||
1810 | tk | 196 | }, |
1864 | tk | 197 | |
198 | {//<--------------------------------------> |
||
2294 | tk | 199 | "Initial CC value for Clear and Init", |
200 | "is: ", |
||
201 | }, |
||
202 | |||
203 | {//<--------------------------------------> |
||
2552 | tk | 204 | "Session specific Drum CC Assignments", |
205 | "", |
||
206 | }, |
||
207 | |||
208 | {//<--------------------------------------> |
||
1864 | tk | 209 | "Track Position Display (TPD) Mode", |
2542 | tk | 210 | NULL, |
1864 | tk | 211 | }, |
2020 | tk | 212 | |
213 | {//<--------------------------------------> |
||
2618 | tk | 214 | "Swap LED Colours: GP Select XOR Pos", |
2609 | tk | 215 | "", |
216 | }, |
||
217 | |||
218 | {//<--------------------------------------> |
||
2610 | tk | 219 | "Invert Mute LEDs", |
220 | NULL, |
||
221 | }, |
||
222 | |||
223 | {//<--------------------------------------> |
||
2020 | tk | 224 | "The BLM16x16+X should always use", |
225 | "Force-To-Scale in Grid Edit Mode: " // yes/no |
||
226 | }, |
||
2027 | tk | 227 | |
228 | {//<--------------------------------------> |
||
2227 | tk | 229 | "BLM16x16+X Fader Assignments", |
2542 | tk | 230 | NULL, |
2227 | tk | 231 | }, |
232 | |||
233 | {//<--------------------------------------> |
||
2027 | tk | 234 | "Mixer CCs which should be sent after PC", |
2542 | tk | 235 | NULL, |
2027 | tk | 236 | }, |
2130 | tk | 237 | |
238 | {//<--------------------------------------> |
||
2542 | tk | 239 | "MENU button page assignments", |
240 | "GP Button #", |
||
241 | }, |
||
242 | |||
243 | {//<--------------------------------------> |
||
2130 | tk | 244 | "Screen Saver:", |
245 | "" |
||
246 | }, |
||
1810 | tk | 247 | }; |
248 | |||
240 | tk | 249 | ///////////////////////////////////////////////////////////////////////////// |
513 | tk | 250 | // Local variables |
251 | ///////////////////////////////////////////////////////////////////////////// |
||
252 | |||
1810 | tk | 253 | static u8 local_selected_item = 0; // stays stable when menu is exit |
513 | tk | 254 | |
2227 | tk | 255 | static u8 selected_blm_fader = 0; |
2542 | tk | 256 | static u8 selected_menu_assignment_button = 0; |
513 | tk | 257 | |
2542 | tk | 258 | |
513 | tk | 259 | ///////////////////////////////////////////////////////////////////////////// |
240 | tk | 260 | // Local LED handler function |
261 | ///////////////////////////////////////////////////////////////////////////// |
||
262 | static s32 LED_Handler(u16 *gp_leds) |
||
263 | { |
||
264 | if( ui_cursor_flash ) // if flashing flag active: no LED flag set |
||
265 | return 0; |
||
266 | |||
1810 | tk | 267 | *gp_leds = 0xffc0; |
240 | tk | 268 | |
269 | return 0; // no error |
||
270 | } |
||
271 | |||
272 | |||
273 | |||
274 | ///////////////////////////////////////////////////////////////////////////// |
||
275 | // Local encoder callback function |
||
276 | // Should return: |
||
277 | // 1 if value has been changed |
||
278 | // 0 if value hasn't been changed |
||
279 | // -1 if invalid or unsupported encoder |
||
280 | ///////////////////////////////////////////////////////////////////////////// |
||
281 | static s32 Encoder_Handler(seq_ui_encoder_t encoder, s32 incrementer) |
||
282 | { |
||
1810 | tk | 283 | if( encoder <= SEQ_UI_ENCODER_GP6 ) |
284 | return -1; // not mapped |
||
758 | tk | 285 | |
1810 | tk | 286 | // change page |
287 | if( encoder == SEQ_UI_ENCODER_GP7 || encoder == SEQ_UI_ENCODER_GP8 ) { |
||
288 | if( SEQ_UI_Var8_Inc(&local_selected_item, 0, NUM_OF_ITEMS-1, incrementer) >= 0 ) { |
||
289 | return 1; // changed |
||
290 | } |
||
291 | return 0; // not changed |
||
240 | tk | 292 | } |
293 | |||
294 | // for GP encoders and Datawheel |
||
1810 | tk | 295 | switch( local_selected_item ) { |
758 | tk | 296 | case ITEM_STEPS_MEASURE: |
1810 | tk | 297 | if( encoder == SEQ_UI_ENCODER_GP16 ) { |
758 | tk | 298 | // increment in +/- 16 steps |
299 | u8 value = seq_core_steps_per_measure >> 4; |
||
300 | if( SEQ_UI_Var8_Inc(&value, 0, 15, incrementer) >= 0 ) { |
||
301 | seq_core_steps_per_measure = (value << 4) + 15; |
||
2102 | tk | 302 | ui_store_file_required = 1; |
758 | tk | 303 | return 1; |
304 | } |
||
305 | } else { |
||
306 | if( SEQ_UI_Var8_Inc(&seq_core_steps_per_measure, 0, 255, incrementer) >= 0 ) { |
||
2102 | tk | 307 | ui_store_file_required = 1; |
758 | tk | 308 | return 1; |
309 | } |
||
310 | } |
||
311 | return 0; |
||
312 | |||
313 | case ITEM_STEPS_PATTERN: |
||
1810 | tk | 314 | if( encoder == SEQ_UI_ENCODER_GP16 ) { |
758 | tk | 315 | // increment in +/- 16 steps |
316 | u8 value = seq_core_steps_per_pattern >> 4; |
||
317 | if( SEQ_UI_Var8_Inc(&value, 0, 15, incrementer) >= 0 ) { |
||
318 | seq_core_steps_per_pattern = (value << 4) + 15; |
||
2102 | tk | 319 | ui_store_file_required = 1; |
758 | tk | 320 | return 1; |
321 | } |
||
322 | } else { |
||
323 | if( SEQ_UI_Var8_Inc(&seq_core_steps_per_pattern, 0, 255, incrementer) >= 0 ) { |
||
2102 | tk | 324 | ui_store_file_required = 1; |
758 | tk | 325 | return 1; |
326 | } |
||
327 | } |
||
328 | return 0; |
||
329 | |||
416 | tk | 330 | case ITEM_SYNC_CHANGE: |
331 | if( incrementer ) |
||
2542 | tk | 332 | seq_core_options.SYNCHED_PATTERN_CHANGE = (incrementer > 0) ? 1 : 0; |
416 | tk | 333 | else |
334 | seq_core_options.SYNCHED_PATTERN_CHANGE ^= 1; |
||
2102 | tk | 335 | ui_store_file_required = 1; |
416 | tk | 336 | return 1; |
337 | |||
2523 | tk | 338 | case ITEM_PATTERN_RESEND_PC: |
339 | if( incrementer ) |
||
2542 | tk | 340 | seq_core_options.PATTERN_CHANGE_DONT_RESET_LATCHED_PC = (incrementer > 0) ? 1 : 0; |
2523 | tk | 341 | else |
342 | seq_core_options.PATTERN_CHANGE_DONT_RESET_LATCHED_PC ^= 1; |
||
343 | ui_store_file_required = 1; |
||
344 | return 1; |
||
345 | |||
1810 | tk | 346 | case ITEM_PATTERN_MIXER_MAP_COUPLING: |
347 | if( incrementer ) |
||
2542 | tk | 348 | seq_core_options.PATTERN_MIXER_MAP_COUPLING = (incrementer > 0) ? 1 : 0; |
1810 | tk | 349 | else |
350 | seq_core_options.PATTERN_MIXER_MAP_COUPLING ^= 1; |
||
2102 | tk | 351 | ui_store_file_required = 1; |
1810 | tk | 352 | return 1; |
353 | |||
416 | tk | 354 | case ITEM_PASTE_CLR_ALL: |
355 | if( incrementer ) |
||
2542 | tk | 356 | seq_core_options.PASTE_CLR_ALL = (incrementer > 0) ? 1 : 0; |
416 | tk | 357 | else |
358 | seq_core_options.PASTE_CLR_ALL ^= 1; |
||
2102 | tk | 359 | ui_store_file_required = 1; |
416 | tk | 360 | return 1; |
625 | tk | 361 | |
1205 | tk | 362 | case ITEM_RATOPC: |
363 | if( incrementer ) |
||
2542 | tk | 364 | seq_core_options.RATOPC = (incrementer > 0) ? 1 : 0; |
1205 | tk | 365 | else |
366 | seq_core_options.RATOPC ^= 1; |
||
2102 | tk | 367 | ui_store_file_required = 1; |
1205 | tk | 368 | return 1; |
369 | |||
1261 | tk | 370 | case ITEM_SYNC_MUTE: { |
371 | if( incrementer ) |
||
2542 | tk | 372 | seq_core_options.SYNCHED_MUTE = (incrementer > 0) ? 1 : 0; |
1261 | tk | 373 | else |
374 | seq_core_options.SYNCHED_MUTE ^= 1; |
||
2102 | tk | 375 | ui_store_file_required = 1; |
1261 | tk | 376 | return 1; |
377 | } break; |
||
378 | |||
379 | case ITEM_SYNC_UNMUTE: { |
||
380 | if( incrementer ) |
||
2542 | tk | 381 | seq_core_options.SYNCHED_UNMUTE = (incrementer > 0) ? 1 : 0; |
1261 | tk | 382 | else |
383 | seq_core_options.SYNCHED_UNMUTE ^= 1; |
||
2102 | tk | 384 | ui_store_file_required = 1; |
1261 | tk | 385 | return 1; |
386 | } break; |
||
1810 | tk | 387 | |
2633 | tk | 388 | case ITEM_UNMUTE_ON_PATTERN_CHANGE: { |
389 | if( incrementer ) |
||
390 | seq_core_options.UNMUTE_ON_PATTERN_CHANGE = (incrementer > 0) ? 1 : 0; |
||
391 | else |
||
392 | seq_core_options.UNMUTE_ON_PATTERN_CHANGE ^= 1; |
||
393 | ui_store_file_required = 1; |
||
394 | return 1; |
||
395 | } break; |
||
396 | |||
2587 | tk | 397 | case ITEM_SELECT_UNMUTED_TRACK: { |
398 | if( incrementer ) |
||
399 | seq_ui_options.SELECT_UNMUTED_TRACK = (incrementer > 0) ? 1 : 0; |
||
400 | else |
||
401 | seq_ui_options.SELECT_UNMUTED_TRACK ^= 1; |
||
402 | ui_store_file_required = 1; |
||
403 | return 1; |
||
404 | } break; |
||
405 | |||
2250 | tk | 406 | case ITEM_RESTORE_TRACK_SELECTIONS: { |
407 | if( incrementer ) |
||
2542 | tk | 408 | seq_ui_options.RESTORE_TRACK_SELECTIONS = (incrementer > 0) ? 1 : 0; |
2250 | tk | 409 | else |
410 | seq_ui_options.RESTORE_TRACK_SELECTIONS ^= 1; |
||
411 | ui_store_file_required = 1; |
||
412 | return 1; |
||
413 | } break; |
||
414 | |||
2545 | tk | 415 | case ITEM_MODIFY_PATTERN_BANKS: { |
416 | if( incrementer ) |
||
417 | seq_ui_options.MODIFY_PATTERN_BANKS = (incrementer > 0) ? 1 : 0; |
||
418 | else |
||
419 | seq_ui_options.MODIFY_PATTERN_BANKS ^= 1; |
||
420 | ui_store_file_required = 1; |
||
421 | return 1; |
||
422 | } break; |
||
423 | |||
2628 | tk | 424 | case ITEM_ALL_FOR_STEP_VIEW_ONLY: { |
425 | if( incrementer ) |
||
426 | seq_ui_options.ALL_FOR_STEP_VIEW_ONLY = (incrementer > 0) ? 1 : 0; |
||
427 | else |
||
428 | seq_ui_options.ALL_FOR_STEP_VIEW_ONLY ^= 1; |
||
429 | ui_store_file_required = 1; |
||
430 | return 1; |
||
431 | } break; |
||
432 | |||
2564 | tk | 433 | case ITEM_PRINT_AND_MODIFY_WITHOUT_GATES: { |
434 | if( incrementer ) |
||
435 | seq_ui_options.PRINT_AND_MODIFY_WITHOUT_GATES = (incrementer > 0) ? 1 : 0; |
||
436 | else |
||
437 | seq_ui_options.PRINT_AND_MODIFY_WITHOUT_GATES ^= 1; |
||
438 | ui_store_file_required = 1; |
||
439 | return 1; |
||
440 | } break; |
||
441 | |||
2567 | tk | 442 | case ITEM_PRINT_TRANSPOSED_NOTES: { |
443 | if( incrementer ) |
||
444 | seq_ui_options.PRINT_TRANSPOSED_NOTES = (incrementer > 0) ? 1 : 0; |
||
445 | else |
||
446 | seq_ui_options.PRINT_TRANSPOSED_NOTES ^= 1; |
||
447 | ui_store_file_required = 1; |
||
448 | return 1; |
||
449 | } break; |
||
450 | |||
2294 | tk | 451 | case ITEM_INIT_WITH_TRIGGERS: { |
452 | if( incrementer ) |
||
2542 | tk | 453 | seq_core_options.INIT_WITH_TRIGGERS = (incrementer > 0) ? 1 : 0; |
2294 | tk | 454 | else |
455 | seq_core_options.INIT_WITH_TRIGGERS ^= 1; |
||
456 | ui_store_file_required = 1; |
||
457 | return 1; |
||
458 | } break; |
||
459 | |||
1810 | tk | 460 | case ITEM_INIT_CC: { |
461 | u8 value = seq_core_options.INIT_CC; |
||
2448 | tk | 462 | if( SEQ_UI_Var8_Inc(&value, 0, 128, incrementer) >= 0 ) { |
1810 | tk | 463 | seq_core_options.INIT_CC = value; |
2102 | tk | 464 | ui_store_file_required = 1; |
1810 | tk | 465 | return 1; |
466 | } |
||
467 | return 0; |
||
468 | } break; |
||
469 | |||
2552 | tk | 470 | case ITEM_DRUM_CC: { |
471 | #ifdef MBSEQV4P |
||
472 | switch( encoder ) { |
||
473 | case SEQ_UI_ENCODER_GP9: |
||
474 | case SEQ_UI_ENCODER_GP10: |
||
475 | case SEQ_UI_ENCODER_GP11: |
||
476 | case SEQ_UI_ENCODER_GP12: { |
||
477 | if( SEQ_UI_Var8_Inc(&ui_selected_instrument, 0, 15, incrementer) >= 0 ) { |
||
478 | return 1; // value changed |
||
479 | } |
||
480 | return 0; // no change |
||
481 | } break; |
||
482 | |||
483 | case SEQ_UI_ENCODER_GP13: |
||
484 | case SEQ_UI_ENCODER_GP14: { |
||
485 | if( ui_selected_par_layer >= 4 ) { |
||
486 | ui_selected_par_layer = 3; // max. 4 layers supported |
||
487 | return 1; |
||
488 | } |
||
489 | |||
490 | if( SEQ_UI_Var8_Inc(&ui_selected_par_layer, 0, 3, incrementer) >= 0 ) { |
||
491 | return 1; // value changed |
||
492 | } |
||
493 | return 0; // no change |
||
494 | } break; |
||
495 | |||
496 | case SEQ_UI_ENCODER_GP15: |
||
497 | case SEQ_UI_ENCODER_GP16: { |
||
498 | if( SEQ_UI_Var8_Inc(&seq_layer_drum_cc[ui_selected_instrument][ui_selected_par_layer], 0, 128, incrementer) >= 0 ) { |
||
499 | ui_store_file_required = 1; |
||
500 | return 1; // value changed |
||
501 | } |
||
502 | return 0; // no change |
||
503 | } break; |
||
504 | } |
||
505 | #endif |
||
506 | |||
507 | return -1; |
||
508 | } break; |
||
509 | |||
2545 | tk | 510 | case ITEM_METRONOME: { |
511 | switch( encoder ) { |
||
512 | case SEQ_UI_ENCODER_GP9: |
||
513 | case SEQ_UI_ENCODER_GP10: { |
||
514 | if( incrementer ) |
||
515 | seq_core_state.METRONOME = ((incrementer > 0)) ? 1 : 0; |
||
516 | else |
||
517 | seq_core_state.METRONOME ^= 1; |
||
518 | ui_store_file_required = 1; |
||
519 | return 1; |
||
520 | } break; |
||
521 | |||
522 | case SEQ_UI_ENCODER_GP11: { |
||
523 | u8 port_ix = SEQ_MIDI_PORT_OutIxGet(seq_core_metronome_port); |
||
524 | if( SEQ_UI_Var8_Inc(&port_ix, 0, SEQ_MIDI_PORT_OutNumGet()-1, incrementer) >= 0 ) { |
||
525 | seq_core_metronome_port = SEQ_MIDI_PORT_OutPortGet(port_ix); |
||
526 | ui_store_file_required = 1; |
||
527 | return 1; // value changed |
||
528 | } |
||
529 | return 0; // no change |
||
530 | } break; |
||
531 | |||
532 | case SEQ_UI_ENCODER_GP12: { |
||
533 | if( SEQ_UI_Var8_Inc(&seq_core_metronome_chn, 0, 16, incrementer) >= 0 ) { |
||
534 | ui_store_file_required = 1; |
||
535 | return 1; // value changed |
||
536 | } |
||
537 | return 0; // no change |
||
538 | } break; |
||
539 | |||
540 | case SEQ_UI_ENCODER_GP13: |
||
541 | case SEQ_UI_ENCODER_GP14: { |
||
542 | if( SEQ_UI_Var8_Inc(&seq_core_metronome_note_m, 0, 127, incrementer) >= 0 ) { |
||
543 | ui_store_file_required = 1; |
||
544 | return 1; // value changed |
||
545 | } |
||
546 | return 0; // no change |
||
547 | } break; |
||
548 | |||
549 | case SEQ_UI_ENCODER_GP15: |
||
550 | case SEQ_UI_ENCODER_GP16: { |
||
551 | if( SEQ_UI_Var8_Inc(&seq_core_metronome_note_b, 0, 127, incrementer) >= 0 ) { |
||
552 | ui_store_file_required = 1; |
||
553 | return 1; // value changed |
||
554 | } |
||
555 | return 0; // no change |
||
556 | } break; |
||
557 | } |
||
558 | |||
559 | return -1; |
||
560 | } break; |
||
561 | |||
562 | case ITEM_SHADOW_OUT: { |
||
563 | switch( encoder ) { |
||
564 | case SEQ_UI_ENCODER_GP11: { |
||
565 | u8 port_ix = SEQ_MIDI_PORT_OutIxGet(seq_core_shadow_out_port); |
||
566 | if( SEQ_UI_Var8_Inc(&port_ix, 0, SEQ_MIDI_PORT_OutNumGet()-1, incrementer) >= 0 ) { |
||
567 | seq_core_shadow_out_port = SEQ_MIDI_PORT_OutPortGet(port_ix); |
||
568 | ui_store_file_required = 1; |
||
569 | return 1; // value changed |
||
570 | } |
||
571 | return 0; // no change |
||
572 | } break; |
||
573 | |||
574 | case SEQ_UI_ENCODER_GP12: { |
||
575 | if( SEQ_UI_Var8_Inc(&seq_core_shadow_out_chn, 0, 16, incrementer) >= 0 ) { |
||
576 | ui_store_file_required = 1; |
||
577 | return 1; // value changed |
||
578 | } |
||
579 | return 0; // no change |
||
580 | } break; |
||
581 | } |
||
582 | |||
583 | return -1; |
||
584 | } break; |
||
585 | |||
2542 | tk | 586 | case ITEM_MIDI_REMOTE: { |
587 | if( encoder == SEQ_UI_ENCODER_GP10 ) { |
||
588 | if( incrementer ) |
||
589 | seq_midi_in_remote.cc_or_key = ((incrementer > 0)) ? 1 : 0; |
||
590 | else |
||
591 | seq_midi_in_remote.cc_or_key ^= 1; |
||
592 | ui_store_file_required = 1; |
||
593 | return 1; |
||
594 | } else if( encoder == SEQ_UI_ENCODER_GP11 ) { |
||
595 | u8 value = seq_midi_in_remote.value; |
||
596 | if( SEQ_UI_Var8_Inc(&value, 0, 127, incrementer) >= 0 ) { |
||
597 | seq_midi_in_remote.value = value; |
||
598 | ui_store_file_required = 1; |
||
599 | return 1; |
||
600 | } |
||
601 | } |
||
602 | |||
603 | return 0; |
||
604 | } break; |
||
605 | |||
606 | case ITEM_TRACK_CC: { |
||
607 | switch( encoder ) { |
||
608 | case SEQ_UI_ENCODER_GP9: |
||
609 | case SEQ_UI_ENCODER_GP10: |
||
610 | case SEQ_UI_ENCODER_GP11: |
||
611 | case SEQ_UI_ENCODER_GP12: { |
||
612 | u8 value = seq_ui_track_cc.mode; |
||
613 | if( SEQ_UI_Var8_Inc(&value, 0, 2, incrementer) >= 0 ) { |
||
614 | seq_ui_track_cc.mode = value; |
||
615 | ui_store_file_required = 1; |
||
616 | return 1; |
||
617 | } |
||
618 | return 0; |
||
619 | } break; |
||
620 | case SEQ_UI_ENCODER_GP13: |
||
621 | case SEQ_UI_ENCODER_GP14: { |
||
622 | u8 port_ix = SEQ_MIDI_PORT_OutIxGet(seq_ui_track_cc.port); |
||
623 | if( SEQ_UI_Var8_Inc(&port_ix, 0, SEQ_MIDI_PORT_OutNumGet()-1, incrementer) >= 0 ) { |
||
624 | seq_ui_track_cc.port = SEQ_MIDI_PORT_OutPortGet(port_ix); |
||
625 | ui_store_file_required = 1; |
||
626 | return 1; |
||
627 | } |
||
628 | return 0; |
||
629 | } break; |
||
630 | case SEQ_UI_ENCODER_GP15: { |
||
631 | u8 value = seq_ui_track_cc.chn; |
||
632 | if( SEQ_UI_Var8_Inc(&value, 0, 15, incrementer) >= 0 ) { |
||
633 | seq_ui_track_cc.chn = value; |
||
634 | ui_store_file_required = 1; |
||
635 | return 1; |
||
636 | } |
||
637 | return 0; |
||
638 | } break; |
||
639 | case SEQ_UI_ENCODER_GP16: { |
||
640 | u8 value = seq_ui_track_cc.cc; |
||
641 | if( SEQ_UI_Var8_Inc(&value, 0, 127, incrementer) >= 0 ) { |
||
642 | seq_ui_track_cc.cc = value; |
||
643 | ui_store_file_required = 1; |
||
644 | return 1; |
||
645 | } |
||
646 | return 0; |
||
647 | } break; |
||
648 | } |
||
649 | |||
650 | return -1; |
||
651 | } break; |
||
652 | |||
653 | case ITEM_RUNTIME_STATUS_OPTIMIZATION: { |
||
654 | mios32_midi_port_t port = DEFAULT; |
||
655 | |||
656 | if( encoder == SEQ_UI_ENCODER_GP10 ) { |
||
657 | port = UART0; |
||
658 | } else if( encoder == SEQ_UI_ENCODER_GP12 ) { |
||
659 | port = UART1; |
||
660 | } else if( encoder == SEQ_UI_ENCODER_GP14 ) { |
||
661 | port = UART2; |
||
662 | } else if( encoder == SEQ_UI_ENCODER_GP16 ) { |
||
663 | port = UART3; |
||
664 | } |
||
665 | |||
666 | if( port != DEFAULT ) { |
||
667 | if( incrementer ) |
||
668 | MIOS32_MIDI_RS_OptimisationSet(port, (incrementer > 0) ? 1 : 0); |
||
669 | else |
||
670 | MIOS32_MIDI_RS_OptimisationSet(port, (MIOS32_MIDI_RS_OptimisationGet(port) > 0) ? 0 : 1); |
||
671 | ui_store_file_required = 1; |
||
672 | return 1; |
||
673 | } |
||
674 | |||
675 | return 0; |
||
676 | } break; |
||
677 | |||
1810 | tk | 678 | case ITEM_LIVE_LAYER_MUTE: { |
679 | u8 value = seq_core_options.LIVE_LAYER_MUTE_STEPS; |
||
680 | if( SEQ_UI_Var8_Inc(&value, 0, 7, incrementer) >= 0 ) { |
||
681 | seq_core_options.LIVE_LAYER_MUTE_STEPS = value; |
||
2102 | tk | 682 | ui_store_file_required = 1; |
1810 | tk | 683 | return 1; |
684 | } |
||
685 | return 0; |
||
686 | } break; |
||
687 | |||
1864 | tk | 688 | case ITEM_TPD_MODE: { |
689 | u8 value = SEQ_TPD_ModeGet(); |
||
690 | if( SEQ_UI_Var8_Inc(&value, 0, SEQ_TPD_NUM_MODES-1, incrementer) >= 0 ) { |
||
691 | SEQ_TPD_ModeSet(value); |
||
2102 | tk | 692 | ui_store_file_required = 1; |
1864 | tk | 693 | return 1; |
694 | } |
||
695 | return 0; |
||
696 | } break; |
||
697 | |||
2609 | tk | 698 | case ITEM_SWAP_GP_LED_COLOURS: { |
699 | if( encoder == SEQ_UI_ENCODER_GP13 ) { |
||
700 | if( incrementer ) |
||
701 | seq_ui_options.SWAP_GP_LED_COLOURS = (incrementer > 0) ? 1 : 0; |
||
702 | else |
||
703 | seq_ui_options.SWAP_GP_LED_COLOURS ^= 1; |
||
704 | ui_store_file_required = 1; |
||
705 | } else if( encoder == SEQ_UI_ENCODER_GP14 ) { |
||
706 | if( incrementer ) |
||
707 | seq_ui_options.SWAP_SELECT_LED_COLOURS = (incrementer > 0) ? 1 : 0; |
||
708 | else |
||
709 | seq_ui_options.SWAP_SELECT_LED_COLOURS ^= 1; |
||
710 | ui_store_file_required = 1; |
||
2618 | tk | 711 | } else if( encoder == SEQ_UI_ENCODER_GP15 || encoder == SEQ_UI_ENCODER_GP16 ) { |
712 | if( incrementer ) |
||
713 | seq_ui_options.GP_LED_DONT_XOR_POS = (incrementer > 0) ? 1 : 0; |
||
714 | else |
||
715 | seq_ui_options.GP_LED_DONT_XOR_POS ^= 1; |
||
716 | ui_store_file_required = 1; |
||
2609 | tk | 717 | } |
718 | return 1; |
||
719 | } break; |
||
720 | |||
2610 | tk | 721 | case ITEM_INVERT_MUTE_LEDS: { |
722 | if( incrementer ) |
||
723 | seq_ui_options.INVERT_MUTE_LEDS = (incrementer > 0) ? 1 : 0; |
||
724 | else |
||
725 | seq_ui_options.INVERT_MUTE_LEDS ^= 1; |
||
726 | ui_store_file_required = 1; |
||
727 | return 1; |
||
728 | } break; |
||
729 | |||
2020 | tk | 730 | case ITEM_BLM_ALWAYS_USE_FTS: { |
731 | if( incrementer ) |
||
2542 | tk | 732 | seq_blm_options.ALWAYS_USE_FTS = (incrementer > 0) ? 1 : 0; |
2020 | tk | 733 | else |
734 | seq_blm_options.ALWAYS_USE_FTS ^= 1; |
||
2102 | tk | 735 | ui_store_file_required = 1; |
2020 | tk | 736 | return 1; |
737 | } break; |
||
738 | |||
2227 | tk | 739 | case ITEM_BLM_FADERS: { |
740 | seq_blm_fader_t *fader = &seq_blm_fader[selected_blm_fader]; |
||
741 | |||
742 | switch( encoder ) { |
||
743 | case SEQ_UI_ENCODER_GP9: { |
||
744 | if( SEQ_UI_Var8_Inc(&selected_blm_fader, 0, SEQ_BLM_NUM_FADERS-1, incrementer) >= 0 ) { |
||
745 | return 1; |
||
746 | } |
||
747 | return 0; |
||
748 | } break; |
||
749 | |||
750 | case SEQ_UI_ENCODER_GP10: |
||
751 | case SEQ_UI_ENCODER_GP11: { |
||
752 | u8 port_ix = SEQ_MIDI_PORT_OutIxGet(fader->port); |
||
753 | if( SEQ_UI_Var8_Inc(&port_ix, 0, SEQ_MIDI_PORT_OutNumGet()-1, incrementer) >= 0 ) { |
||
754 | fader->port = SEQ_MIDI_PORT_OutPortGet(port_ix); |
||
755 | ui_store_file_required = 1; |
||
756 | return 1; |
||
757 | } |
||
758 | return 0; |
||
759 | } break; |
||
760 | |||
761 | case SEQ_UI_ENCODER_GP12: |
||
762 | case SEQ_UI_ENCODER_GP13: { |
||
763 | u8 value = fader->chn; |
||
764 | if( SEQ_UI_Var8_Inc(&value, 0, 16, incrementer) >= 0 ) { |
||
765 | fader->chn = value; |
||
766 | ui_store_file_required = 1; |
||
767 | return 1; |
||
768 | } |
||
769 | return 0; |
||
770 | } break; |
||
771 | |||
772 | case SEQ_UI_ENCODER_GP14: |
||
773 | case SEQ_UI_ENCODER_GP16: |
||
774 | case SEQ_UI_ENCODER_GP15: { |
||
2228 | tk | 775 | u16 value = fader->send_function; |
776 | if( SEQ_UI_Var16_Inc(&value, 0, 256, incrementer) >= 0 ) { |
||
2227 | tk | 777 | fader->send_function = value; |
778 | ui_store_file_required = 1; |
||
779 | return 1; |
||
780 | } |
||
781 | return 0; |
||
782 | } break; |
||
783 | } |
||
784 | return 1; |
||
785 | } break; |
||
786 | |||
2027 | tk | 787 | case ITEM_MIXER_CC1234: { |
788 | u8 pos = (encoder-8) / 2; |
||
789 | u8 value = (seq_mixer_cc1234_before_pc & (1 << pos)) ? 0 : 1; // note: we've to invert yes/no! |
||
790 | if( SEQ_UI_Var8_Inc(&value, 0, 1, incrementer) >= 0 ) { |
||
791 | if( !value ) // note: we've to invert yes/no |
||
792 | seq_mixer_cc1234_before_pc |= (1 << pos); |
||
793 | else |
||
794 | seq_mixer_cc1234_before_pc &= ~(1 << pos); |
||
795 | |||
2102 | tk | 796 | ui_store_file_required = 1; |
2027 | tk | 797 | return 1; |
798 | } |
||
799 | return 0; |
||
800 | } break; |
||
801 | |||
2542 | tk | 802 | case ITEM_MENU_SHORTCUTS: { |
803 | switch( encoder ) { |
||
804 | case SEQ_UI_ENCODER_GP9: |
||
805 | case SEQ_UI_ENCODER_GP10: |
||
806 | case SEQ_UI_ENCODER_GP11: { |
||
807 | if( SEQ_UI_Var8_Inc(&selected_menu_assignment_button, 0, 15, incrementer) >= 0 ) { |
||
808 | return 1; |
||
809 | } |
||
810 | return 0; |
||
811 | } break; |
||
812 | case SEQ_UI_ENCODER_GP12: |
||
813 | case SEQ_UI_ENCODER_GP13: |
||
814 | case SEQ_UI_ENCODER_GP14: |
||
815 | case SEQ_UI_ENCODER_GP15: |
||
816 | case SEQ_UI_ENCODER_GP16: { |
||
817 | u8 value = (u8)SEQ_UI_PAGES_MenuShortcutPageGet(selected_menu_assignment_button); |
||
818 | if( SEQ_UI_Var8_Inc(&value, 0, SEQ_UI_PAGES-1, incrementer) >= 0 ) { |
||
819 | SEQ_UI_PAGES_MenuShortcutPageSet(selected_menu_assignment_button, value); |
||
820 | ui_store_file_required = 1; |
||
821 | return 1; |
||
822 | } |
||
823 | return 0; |
||
824 | } break; |
||
825 | } |
||
826 | return -1; |
||
827 | } break; |
||
828 | |||
2130 | tk | 829 | case ITEM_SCREEN_SAVER: { |
830 | if( incrementer ) { |
||
831 | int delay = (int)seq_lcd_logo_screensaver_delay + incrementer; |
||
832 | if( delay > 255 ) |
||
833 | delay = 255; |
||
834 | else if( delay < 0 ) |
||
835 | delay = 0; |
||
836 | |||
837 | seq_lcd_logo_screensaver_delay = delay; |
||
838 | ui_store_file_required = 1; |
||
839 | } |
||
840 | return 1; |
||
841 | } break; |
||
842 | |||
240 | tk | 843 | } |
844 | |||
845 | return -1; // invalid or unsupported encoder |
||
846 | } |
||
847 | |||
848 | |||
849 | ///////////////////////////////////////////////////////////////////////////// |
||
850 | // Local button callback function |
||
851 | // Should return: |
||
852 | // 1 if value has been changed |
||
853 | // 0 if value hasn't been changed |
||
854 | // -1 if invalid or unsupported button |
||
855 | ///////////////////////////////////////////////////////////////////////////// |
||
856 | static s32 Button_Handler(seq_ui_button_t button, s32 depressed) |
||
857 | { |
||
858 | if( depressed ) return 0; // ignore when button depressed |
||
859 | |||
416 | tk | 860 | #if 0 |
861 | // leads to: comparison is always true due to limited range of data type |
||
862 | if( button >= SEQ_UI_BUTTON_GP1 && button <= SEQ_UI_BUTTON_GP16 ) { |
||
863 | #else |
||
864 | if( button <= SEQ_UI_BUTTON_GP16 ) { |
||
865 | #endif |
||
866 | // re-use encoder handler - only select UI item, don't increment, flags will be toggled |
||
867 | return Encoder_Handler((int)button, 0); |
||
868 | } |
||
869 | |||
870 | // remaining buttons: |
||
240 | tk | 871 | switch( button ) { |
872 | case SEQ_UI_BUTTON_Select: |
||
873 | case SEQ_UI_BUTTON_Right: |
||
874 | if( depressed ) return -1; |
||
1810 | tk | 875 | if( ++local_selected_item >= NUM_OF_ITEMS ) |
876 | local_selected_item = 0; |
||
240 | tk | 877 | return 1; // value always changed |
878 | |||
879 | case SEQ_UI_BUTTON_Left: |
||
880 | if( depressed ) return -1; |
||
1810 | tk | 881 | if( local_selected_item == 0 ) |
882 | local_selected_item = NUM_OF_ITEMS-1; |
||
1142 | tk | 883 | else |
1810 | tk | 884 | --local_selected_item; |
240 | tk | 885 | return 1; // value always changed |
886 | |||
887 | case SEQ_UI_BUTTON_Up: |
||
888 | if( depressed ) return -1; |
||
889 | return Encoder_Handler(SEQ_UI_ENCODER_Datawheel, 1); |
||
890 | |||
891 | case SEQ_UI_BUTTON_Down: |
||
892 | if( depressed ) return -1; |
||
893 | return Encoder_Handler(SEQ_UI_ENCODER_Datawheel, -1); |
||
894 | } |
||
895 | |||
896 | return -1; // invalid or unsupported button |
||
897 | } |
||
898 | |||
899 | |||
900 | ///////////////////////////////////////////////////////////////////////////// |
||
901 | // Local Display Handler function |
||
902 | // IN: <high_prio>: if set, a high-priority LCD update is requested |
||
903 | ///////////////////////////////////////////////////////////////////////////// |
||
904 | static s32 LCD_Handler(u8 high_prio) |
||
905 | { |
||
906 | if( high_prio ) |
||
907 | return 0; // there are no high-priority updates |
||
908 | |||
909 | // layout: |
||
910 | // 00000000001111111111222222222233333333330000000000111111111122222222223333333333 |
||
911 | // 01234567890123456789012345678901234567890123456789012345678901234567890123456789 |
||
912 | // <--------------------------------------><--------------------------------------> |
||
1810 | tk | 913 | // Option Track Synchronisation |
914 | // 1/10 Steps per Measure: 16 |
||
240 | tk | 915 | |
916 | /////////////////////////////////////////////////////////////////////////// |
||
278 | tk | 917 | SEQ_LCD_CursorSet(0, 0); |
1810 | tk | 918 | SEQ_LCD_PrintSpaces(32); |
919 | SEQ_LCD_PrintString("Option "); |
||
920 | SEQ_LCD_PrintStringPadded((char *)item_text[local_selected_item][0], 40); |
||
240 | tk | 921 | |
922 | /////////////////////////////////////////////////////////////////////////// |
||
278 | tk | 923 | SEQ_LCD_CursorSet(0, 1); |
1810 | tk | 924 | SEQ_LCD_PrintSpaces(33); |
925 | SEQ_LCD_PrintFormattedString("%2d/%-2d ", local_selected_item+1, NUM_OF_ITEMS); |
||
240 | tk | 926 | |
758 | tk | 927 | /////////////////////////////////////////////////////////////////////////// |
1810 | tk | 928 | char *str = (char *)item_text[local_selected_item][1]; |
929 | u32 len = strlen(str); |
||
930 | int enabled_value = -1; // cheap: will print enabled/disabled in second line if >= 0 |
||
240 | tk | 931 | |
1810 | tk | 932 | switch( local_selected_item ) { |
933 | |||
240 | tk | 934 | /////////////////////////////////////////////////////////////////////////// |
1810 | tk | 935 | case ITEM_STEPS_MEASURE: { |
936 | SEQ_LCD_PrintString(str); |
||
937 | if( ui_cursor_flash ) { |
||
938 | SEQ_LCD_PrintSpaces(3); |
||
939 | } else { |
||
940 | SEQ_LCD_PrintFormattedString("%3d", (int)seq_core_steps_per_measure + 1); |
||
941 | } |
||
942 | SEQ_LCD_PrintSpaces(40-3-len); |
||
943 | } break; |
||
240 | tk | 944 | |
945 | /////////////////////////////////////////////////////////////////////////// |
||
1810 | tk | 946 | case ITEM_STEPS_PATTERN: { |
947 | SEQ_LCD_PrintString(str); |
||
948 | if( ui_cursor_flash ) { |
||
949 | SEQ_LCD_PrintSpaces(9); |
||
950 | } else { |
||
951 | SEQ_LCD_PrintFormattedString("%3d steps", (int)seq_core_steps_per_pattern + 1); |
||
952 | } |
||
953 | SEQ_LCD_PrintSpaces(40-9-len); |
||
954 | } break; |
||
240 | tk | 955 | |
956 | /////////////////////////////////////////////////////////////////////////// |
||
1810 | tk | 957 | case ITEM_SYNC_CHANGE: { |
958 | enabled_value = seq_core_options.SYNCHED_PATTERN_CHANGE; |
||
959 | } break; |
||
240 | tk | 960 | |
1810 | tk | 961 | /////////////////////////////////////////////////////////////////////////// |
2523 | tk | 962 | case ITEM_PATTERN_RESEND_PC: { |
963 | enabled_value = seq_core_options.PATTERN_CHANGE_DONT_RESET_LATCHED_PC ? 0 : 1; |
||
964 | } break; |
||
965 | |||
966 | /////////////////////////////////////////////////////////////////////////// |
||
1810 | tk | 967 | case ITEM_RATOPC: { |
968 | enabled_value = seq_core_options.RATOPC; |
||
969 | } break; |
||
1261 | tk | 970 | |
240 | tk | 971 | /////////////////////////////////////////////////////////////////////////// |
1810 | tk | 972 | case ITEM_PATTERN_MIXER_MAP_COUPLING: { |
973 | SEQ_LCD_PrintString(str); |
||
625 | tk | 974 | |
1810 | tk | 975 | if( ui_cursor_flash ) { |
976 | SEQ_LCD_PrintSpaces(40-len); |
||
977 | } else { |
||
978 | SEQ_LCD_PrintStringPadded(seq_core_options.PATTERN_MIXER_MAP_COUPLING ? "enabled" : "disabled", 40-len); |
||
979 | } |
||
980 | } break; |
||
981 | |||
1205 | tk | 982 | /////////////////////////////////////////////////////////////////////////// |
1810 | tk | 983 | case ITEM_SYNC_MUTE: { |
984 | enabled_value = seq_core_options.SYNCHED_MUTE; |
||
985 | } break; |
||
1261 | tk | 986 | |
987 | /////////////////////////////////////////////////////////////////////////// |
||
1810 | tk | 988 | case ITEM_SYNC_UNMUTE: { |
989 | enabled_value = seq_core_options.SYNCHED_UNMUTE; |
||
990 | } break; |
||
1205 | tk | 991 | |
1794 | tk | 992 | /////////////////////////////////////////////////////////////////////////// |
2633 | tk | 993 | case ITEM_UNMUTE_ON_PATTERN_CHANGE: { |
994 | enabled_value = seq_core_options.UNMUTE_ON_PATTERN_CHANGE; |
||
995 | } break; |
||
996 | |||
997 | /////////////////////////////////////////////////////////////////////////// |
||
2587 | tk | 998 | case ITEM_SELECT_UNMUTED_TRACK: { |
999 | enabled_value = seq_ui_options.SELECT_UNMUTED_TRACK; |
||
1000 | } break; |
||
1001 | |||
1002 | /////////////////////////////////////////////////////////////////////////// |
||
1810 | tk | 1003 | case ITEM_PASTE_CLR_ALL: { |
1004 | if( ui_cursor_flash ) { |
||
1005 | SEQ_LCD_PrintSpaces(14); |
||
1006 | } else { |
||
2294 | tk | 1007 | SEQ_LCD_PrintString(seq_core_options.PASTE_CLR_ALL ? "Complete Track" : "Only Steps "); |
1810 | tk | 1008 | } |
1009 | SEQ_LCD_PrintSpaces(40-14); |
||
1010 | } break; |
||
1011 | |||
2542 | tk | 1012 | |
1810 | tk | 1013 | /////////////////////////////////////////////////////////////////////////// |
2545 | tk | 1014 | case ITEM_METRONOME: { |
1015 | if( ui_cursor_flash ) { |
||
1016 | SEQ_LCD_PrintSpaces(40); |
||
1017 | } else { |
||
1018 | SEQ_LCD_PrintSpaces(3); |
||
1019 | SEQ_LCD_PrintString(seq_core_state.METRONOME ? "on " : "off"); |
||
1020 | SEQ_LCD_PrintSpaces(4); |
||
1021 | |||
1022 | SEQ_LCD_PrintString(SEQ_MIDI_PORT_OutNameGet(SEQ_MIDI_PORT_OutIxGet(seq_core_metronome_port))); |
||
1023 | SEQ_LCD_PrintSpaces(1); |
||
1024 | |||
1025 | if( !seq_core_metronome_chn ) |
||
1026 | SEQ_LCD_PrintString("---"); |
||
1027 | else |
||
1028 | SEQ_LCD_PrintFormattedString("#%2d", seq_core_metronome_chn); |
||
1029 | SEQ_LCD_PrintSpaces(5); |
||
1030 | |||
1031 | SEQ_LCD_PrintNote(seq_core_metronome_note_m); |
||
1032 | SEQ_LCD_PrintSpaces(7); |
||
1033 | |||
1034 | SEQ_LCD_PrintNote(seq_core_metronome_note_b); |
||
1035 | SEQ_LCD_PrintSpaces(4); |
||
1036 | } |
||
1037 | } break; |
||
1038 | |||
1039 | /////////////////////////////////////////////////////////////////////////// |
||
1040 | case ITEM_SHADOW_OUT: { |
||
1041 | if( ui_cursor_flash ) { |
||
1042 | SEQ_LCD_PrintSpaces(40); |
||
1043 | } else { |
||
1044 | SEQ_LCD_PrintSpaces(10); |
||
1045 | |||
1046 | SEQ_LCD_PrintString(SEQ_MIDI_PORT_OutNameGet(SEQ_MIDI_PORT_OutIxGet(seq_core_shadow_out_port))); |
||
1047 | SEQ_LCD_PrintSpaces(1); |
||
1048 | |||
1049 | if( !seq_core_shadow_out_chn ) |
||
1050 | SEQ_LCD_PrintString("---"); |
||
1051 | else |
||
1052 | SEQ_LCD_PrintFormattedString("#%2d", seq_core_shadow_out_chn); |
||
1053 | SEQ_LCD_PrintSpaces(25); |
||
1054 | } |
||
1055 | } break; |
||
1056 | |||
1057 | /////////////////////////////////////////////////////////////////////////// |
||
2542 | tk | 1058 | case ITEM_MIDI_REMOTE: { |
1059 | SEQ_LCD_PrintString(str); |
||
1060 | |||
1061 | if( ui_cursor_flash ) { |
||
1062 | SEQ_LCD_PrintSpaces(8); |
||
1063 | } else { |
||
1064 | if( seq_midi_in_remote.cc_or_key ) { |
||
1065 | SEQ_LCD_PrintFormattedString("CC #%3d", seq_midi_in_remote.value); |
||
1066 | } else { |
||
1067 | SEQ_LCD_PrintString("Key "); |
||
1068 | SEQ_LCD_PrintNote(seq_midi_in_remote.value); |
||
1069 | } |
||
1070 | |||
1071 | } |
||
1072 | SEQ_LCD_PrintSpaces(40-8-5); |
||
1073 | } break; |
||
1074 | |||
1075 | /////////////////////////////////////////////////////////////////////////// |
||
1076 | case ITEM_TRACK_CC: { |
||
1077 | u8 valid = 0; |
||
1078 | if( ui_cursor_flash ) { |
||
1079 | SEQ_LCD_PrintSpaces(40); |
||
1080 | } else { |
||
1081 | if( seq_ui_track_cc.mode == 1 ) { |
||
1082 | SEQ_LCD_PrintString("Single CC with Track: "); |
||
1083 | valid = 1; |
||
1084 | } else if( seq_ui_track_cc.mode == 2 ) { |
||
1085 | SEQ_LCD_PrintString("CC..CC+15 per Track: "); |
||
1086 | valid = 1; |
||
1087 | } else { |
||
1088 | SEQ_LCD_PrintString("Function disabled "); |
||
1089 | } |
||
1090 | |||
1091 | if( !valid ) { |
||
1092 | SEQ_LCD_PrintSpaces(40-22); |
||
1093 | } else { |
||
1094 | SEQ_LCD_PrintString(SEQ_MIDI_PORT_OutNameGet(SEQ_MIDI_PORT_OutIxGet(seq_ui_track_cc.port))); |
||
1095 | SEQ_LCD_PrintFormattedString(" Chn#%2d CC#%3d", seq_ui_track_cc.chn+1, seq_ui_track_cc.cc); |
||
1096 | } |
||
1097 | } |
||
1098 | } break; |
||
1099 | |||
1100 | /////////////////////////////////////////////////////////////////////////// |
||
1101 | case ITEM_RUNTIME_STATUS_OPTIMIZATION: { |
||
1102 | int i; |
||
1103 | |||
1104 | for(i=0; i<4; ++i) { |
||
1105 | SEQ_LCD_PrintFormattedString("OUT%d: ", i+1); |
||
1106 | if( ui_cursor_flash ) { |
||
1107 | SEQ_LCD_PrintSpaces(4); |
||
1108 | } else { |
||
1109 | s32 enabled = MIOS32_MIDI_RS_OptimisationGet(UART0 + i); |
||
1110 | if( enabled < 0 ) { |
||
1111 | SEQ_LCD_PrintString("--- "); |
||
1112 | } else { |
||
1113 | SEQ_LCD_PrintString(enabled >= 1 ? "on " : "off "); |
||
1114 | } |
||
1115 | } |
||
1116 | } |
||
1117 | } break; |
||
1118 | |||
1119 | /////////////////////////////////////////////////////////////////////////// |
||
2250 | tk | 1120 | case ITEM_RESTORE_TRACK_SELECTIONS: { |
1121 | enabled_value = seq_ui_options.RESTORE_TRACK_SELECTIONS; |
||
1122 | } break; |
||
1123 | |||
1124 | /////////////////////////////////////////////////////////////////////////// |
||
2545 | tk | 1125 | case ITEM_MODIFY_PATTERN_BANKS: { |
1126 | enabled_value = seq_ui_options.MODIFY_PATTERN_BANKS; |
||
1127 | } break; |
||
1128 | |||
1129 | /////////////////////////////////////////////////////////////////////////// |
||
2628 | tk | 1130 | case ITEM_ALL_FOR_STEP_VIEW_ONLY: { |
1131 | enabled_value = seq_ui_options.ALL_FOR_STEP_VIEW_ONLY; |
||
1132 | } break; |
||
1133 | |||
1134 | /////////////////////////////////////////////////////////////////////////// |
||
2564 | tk | 1135 | case ITEM_PRINT_AND_MODIFY_WITHOUT_GATES: { |
1136 | enabled_value = seq_ui_options.PRINT_AND_MODIFY_WITHOUT_GATES; |
||
1137 | } break; |
||
1138 | |||
1139 | /////////////////////////////////////////////////////////////////////////// |
||
2567 | tk | 1140 | case ITEM_PRINT_TRANSPOSED_NOTES: { |
1141 | enabled_value = seq_ui_options.PRINT_TRANSPOSED_NOTES; |
||
1142 | } break; |
||
1143 | |||
1144 | /////////////////////////////////////////////////////////////////////////// |
||
2294 | tk | 1145 | case ITEM_INIT_WITH_TRIGGERS: { |
1146 | if( ui_cursor_flash ) { |
||
1147 | SEQ_LCD_PrintSpaces(25); |
||
1148 | } else { |
||
1149 | SEQ_LCD_PrintString(seq_core_options.INIT_WITH_TRIGGERS ? "Set gate on each 4th step" : "Empty "); |
||
1150 | } |
||
1151 | SEQ_LCD_PrintSpaces(40-25); |
||
1152 | } break; |
||
1153 | |||
1154 | /////////////////////////////////////////////////////////////////////////// |
||
1810 | tk | 1155 | case ITEM_INIT_CC: { |
1156 | SEQ_LCD_PrintString(str); |
||
1157 | if( ui_cursor_flash ) { |
||
1158 | SEQ_LCD_PrintSpaces(3); |
||
1159 | } else { |
||
2448 | tk | 1160 | if( seq_core_options.INIT_CC >= 0x80 ) { |
1161 | SEQ_LCD_PrintString("---"); |
||
1162 | } else { |
||
1163 | SEQ_LCD_PrintFormattedString("%3d", seq_core_options.INIT_CC); |
||
1164 | } |
||
1810 | tk | 1165 | } |
1166 | SEQ_LCD_PrintSpaces(40-3-len); |
||
1167 | } break; |
||
1168 | |||
1169 | /////////////////////////////////////////////////////////////////////////// |
||
2552 | tk | 1170 | case ITEM_DRUM_CC: { |
1171 | #ifndef MBSEQV4P |
||
1172 | SEQ_LCD_PrintStringPadded("Only supported by V4+ Firmware!", 40); |
||
1173 | #else |
||
1174 | SEQ_LCD_PrintString("Drum #"); |
||
1175 | if( ui_cursor_flash ) { |
||
1176 | SEQ_LCD_PrintSpaces(2); |
||
1177 | } else { |
||
1178 | SEQ_LCD_PrintFormattedString("%2d", ui_selected_instrument+1); |
||
1179 | } |
||
1180 | |||
1181 | u8 visible_track = SEQ_UI_VisibleTrackGet(); |
||
1182 | seq_cc_trk_t *tcc = &seq_cc_trk[visible_track]; |
||
1183 | if( tcc->event_mode == SEQ_EVENT_MODE_Drum ) { |
||
1184 | SEQ_LCD_PrintString(" ("); |
||
1185 | if( ui_cursor_flash ) { |
||
1186 | SEQ_LCD_PrintSpaces(5); |
||
1187 | } else { |
||
1188 | SEQ_LCD_PrintTrackDrum(visible_track, ui_selected_instrument, (char *)seq_core_trk[visible_track].name); |
||
1189 | } |
||
1190 | SEQ_LCD_PrintString(")"); |
||
1191 | } else { |
||
1192 | SEQ_LCD_PrintSpaces(8); |
||
1193 | } |
||
1194 | |||
1195 | SEQ_LCD_PrintString(" PLayer:"); |
||
1196 | if( ui_cursor_flash ) { |
||
1197 | SEQ_LCD_PrintChar(' '); |
||
1198 | } else { |
||
1199 | SEQ_LCD_PrintChar('A' + ui_selected_par_layer); |
||
1200 | } |
||
1201 | |||
1202 | SEQ_LCD_PrintString(" CC:#"); |
||
1203 | if( ui_cursor_flash ) { |
||
1204 | SEQ_LCD_PrintSpaces(3); |
||
1205 | } else { |
||
1206 | u8 cc = seq_layer_drum_cc[ui_selected_instrument][ui_selected_par_layer]; |
||
1207 | if( cc >= 128 ) { |
||
1208 | SEQ_LCD_PrintString("---"); |
||
1209 | } else { |
||
1210 | SEQ_LCD_PrintFormattedString("%3d", cc); |
||
1211 | } |
||
1212 | } |
||
1213 | |||
1214 | SEQ_LCD_PrintSpaces(3); |
||
1215 | #endif |
||
1216 | } break; |
||
1217 | |||
1218 | /////////////////////////////////////////////////////////////////////////// |
||
1810 | tk | 1219 | case ITEM_LIVE_LAYER_MUTE: { |
1220 | SEQ_LCD_PrintString(str); |
||
1221 | |||
1222 | if( ui_cursor_flash ) { |
||
1223 | SEQ_LCD_PrintSpaces(22); |
||
1224 | } else { |
||
1225 | if( seq_core_options.LIVE_LAYER_MUTE_STEPS == 0 ) { |
||
1226 | SEQ_LCD_PrintStringPadded("do nothing", 22); |
||
1227 | } else if( seq_core_options.LIVE_LAYER_MUTE_STEPS == 1 ) { |
||
1228 | SEQ_LCD_PrintStringPadded("mute the appr. layer", 22); |
||
1229 | } else if( seq_core_options.LIVE_LAYER_MUTE_STEPS == 2 ) { |
||
1230 | SEQ_LCD_PrintStringPadded("mute layer for 1 step ", 22); |
||
1231 | } else { |
||
1232 | SEQ_LCD_PrintFormattedString("mute layer for %d steps", seq_core_options.LIVE_LAYER_MUTE_STEPS-1); |
||
1233 | } |
||
1234 | } |
||
1235 | } break; |
||
1236 | |||
1237 | /////////////////////////////////////////////////////////////////////////// |
||
1864 | tk | 1238 | case ITEM_TPD_MODE: { |
1239 | if( ui_cursor_flash ) { |
||
2027 | tk | 1240 | SEQ_LCD_PrintSpaces(40); |
1864 | tk | 1241 | } else { |
1242 | const char *tpd_mode_str[SEQ_TPD_NUM_MODES] = { |
||
1243 | //<--------------------------------------> |
||
1244 | "Green LED: Pos Red LED: Track", |
||
1245 | "Green LED: Pos Red LED: Track (Rot)", |
||
1246 | "Green LED: Meter Red LED: Pos", |
||
1247 | "Green LED: Meter Red LED: Pos (Rot)", |
||
1248 | "Green LED: DotMeter Red LED: Pos", |
||
1249 | "Green LED: DotMeter Red LED: Pos (Rot)", |
||
2611 | tk | 1250 | "Green LED: Logo Red LED: Logo", |
1251 | "Green LED: Logo Red LED: Beat", |
||
1252 | "Green LED: BPM Red LED: BPM", |
||
1253 | "Green LED: BPM Red LED: Beat", |
||
1864 | tk | 1254 | }; |
1255 | |||
1256 | u8 mode = SEQ_TPD_ModeGet(); |
||
1257 | if( mode >= SEQ_TPD_NUM_MODES ) |
||
1258 | mode = 0; |
||
1259 | |||
1260 | SEQ_LCD_PrintStringPadded((char *)tpd_mode_str[mode], 40); |
||
1261 | } |
||
1262 | } break; |
||
1263 | |||
1264 | /////////////////////////////////////////////////////////////////////////// |
||
2609 | tk | 1265 | case ITEM_SWAP_GP_LED_COLOURS: { |
1266 | SEQ_LCD_PrintSpaces(20); |
||
1267 | if( ui_cursor_flash ) { |
||
1268 | SEQ_LCD_PrintSpaces(20); |
||
1269 | } else { |
||
2618 | tk | 1270 | SEQ_LCD_PrintString(seq_ui_options.SWAP_GP_LED_COLOURS ? "Swap" : "Norm"); |
1271 | SEQ_LCD_PrintSpaces(1); |
||
1272 | SEQ_LCD_PrintString(seq_ui_options.SWAP_SELECT_LED_COLOURS ? "Swap" : "Norm"); |
||
1273 | SEQ_LCD_PrintSpaces(1 + 3); |
||
1274 | SEQ_LCD_PrintString(seq_ui_options.GP_LED_DONT_XOR_POS ? "Off" : "On "); |
||
1275 | SEQ_LCD_PrintSpaces(5); |
||
2609 | tk | 1276 | } |
1277 | } break; |
||
1278 | |||
1279 | /////////////////////////////////////////////////////////////////////////// |
||
2610 | tk | 1280 | case ITEM_INVERT_MUTE_LEDS: { |
1281 | enabled_value = seq_ui_options.INVERT_MUTE_LEDS; |
||
1282 | } break; |
||
1283 | |||
1284 | /////////////////////////////////////////////////////////////////////////// |
||
2020 | tk | 1285 | case ITEM_BLM_ALWAYS_USE_FTS: { |
1286 | SEQ_LCD_PrintString(str); |
||
1287 | |||
1288 | if( ui_cursor_flash ) { |
||
1289 | SEQ_LCD_PrintSpaces(40-len); |
||
1290 | } else { |
||
1291 | SEQ_LCD_PrintStringPadded(seq_blm_options.ALWAYS_USE_FTS ? "yes" : "no", 40-len); |
||
1292 | } |
||
1293 | } break; |
||
1294 | |||
1295 | /////////////////////////////////////////////////////////////////////////// |
||
2227 | tk | 1296 | case ITEM_BLM_FADERS: { |
1297 | if( ui_cursor_flash ) { |
||
1298 | SEQ_LCD_PrintSpaces(40); |
||
1299 | } else { |
||
1300 | seq_blm_fader_t *fader = &seq_blm_fader[selected_blm_fader]; |
||
1301 | |||
1302 | SEQ_LCD_PrintFormattedString("Fader:%d ", selected_blm_fader+1); |
||
1303 | |||
1304 | SEQ_LCD_PrintString("Port:"); |
||
1305 | if( fader->port == DEFAULT ) { |
||
1306 | SEQ_LCD_PrintString("Trk "); |
||
1307 | } else { |
||
1308 | SEQ_LCD_PrintString(SEQ_MIDI_PORT_OutNameGet(SEQ_MIDI_PORT_OutIxGet(fader->port))); |
||
1309 | } |
||
1310 | |||
1311 | SEQ_LCD_PrintString(" Chn:"); |
||
1312 | if( fader->chn == 0 ) { |
||
1313 | SEQ_LCD_PrintString("Trk"); |
||
1314 | } else { |
||
1315 | SEQ_LCD_PrintFormattedString("%2d ", fader->chn); |
||
1316 | } |
||
1317 | SEQ_LCD_PrintString(" Send:"); |
||
1318 | |||
1319 | if( fader->send_function < 128 ) { |
||
2228 | tk | 1320 | SEQ_LCD_PrintFormattedString("CC#%3d ", fader->send_function); |
1321 | } else if( fader->send_function < 256 ) { |
||
1322 | SEQ_LCD_PrintFormattedString("CC#%3dInv", fader->send_function - 128); |
||
2227 | tk | 1323 | } else { |
2228 | tk | 1324 | SEQ_LCD_PrintFormattedString("TODO#%3d ", fader->send_function & 0x7f); |
2227 | tk | 1325 | } |
1326 | } |
||
1327 | } break; |
||
1328 | |||
1329 | /////////////////////////////////////////////////////////////////////////// |
||
2027 | tk | 1330 | case ITEM_MIXER_CC1234: { |
1331 | if( ui_cursor_flash ) { |
||
1332 | SEQ_LCD_PrintSpaces(40); |
||
1333 | } else { |
||
1334 | SEQ_LCD_PrintFormattedString(" CC1:%s CC2:%s CC3:%s CC4:%s ", |
||
1335 | (seq_mixer_cc1234_before_pc & 0x1) ? " no" : "yes", |
||
1336 | (seq_mixer_cc1234_before_pc & 0x2) ? " no" : "yes", |
||
1337 | (seq_mixer_cc1234_before_pc & 0x4) ? " no" : "yes", |
||
1338 | (seq_mixer_cc1234_before_pc & 0x8) ? " no" : "yes"); |
||
1339 | } |
||
1340 | } break; |
||
1341 | |||
1342 | /////////////////////////////////////////////////////////////////////////// |
||
2542 | tk | 1343 | case ITEM_MENU_SHORTCUTS: { |
1344 | SEQ_LCD_PrintString(str); |
||
1345 | |||
1346 | if( ui_cursor_flash ) { |
||
1347 | SEQ_LCD_PrintSpaces(4); |
||
1348 | } else { |
||
1349 | SEQ_LCD_PrintFormattedString("%2d ", selected_menu_assignment_button+1); |
||
1350 | } |
||
1351 | |||
1352 | if( ui_cursor_flash ) { |
||
1353 | SEQ_LCD_PrintSpaces(25); |
||
1354 | } else { |
||
1355 | seq_ui_page_t page = SEQ_UI_PAGES_MenuShortcutPageGet(selected_menu_assignment_button); |
||
1356 | SEQ_LCD_PrintString(SEQ_UI_PAGES_MenuShortcutNameGet(selected_menu_assignment_button)); |
||
1357 | SEQ_LCD_PrintString(": "); |
||
1358 | SEQ_LCD_PrintStringPadded((char *)SEQ_UI_PAGES_PageNameGet(page), 18); |
||
1359 | } |
||
1360 | |||
1361 | } break; |
||
1362 | |||
1363 | /////////////////////////////////////////////////////////////////////////// |
||
2130 | tk | 1364 | case ITEM_SCREEN_SAVER: { |
1365 | if( !seq_lcd_logo_screensaver_delay ) { |
||
1366 | if( ui_cursor_flash ) { |
||
1367 | SEQ_LCD_PrintSpaces(3); |
||
1368 | } else { |
||
1369 | SEQ_LCD_PrintString("off"); |
||
1370 | } |
||
1371 | SEQ_LCD_PrintSpaces(40-3); |
||
1372 | } else { |
||
1373 | int delay_len; |
||
1374 | if( seq_lcd_logo_screensaver_delay < 10 ) |
||
1375 | delay_len = 1; |
||
1376 | else if( seq_lcd_logo_screensaver_delay < 100 ) |
||
1377 | delay_len = 2; |
||
1378 | else |
||
1379 | delay_len = 3; |
||
1380 | |||
1381 | SEQ_LCD_PrintString("after "); |
||
1382 | if( ui_cursor_flash ) { |
||
1383 | SEQ_LCD_PrintSpaces(delay_len); |
||
1384 | } else { |
||
1385 | SEQ_LCD_PrintFormattedString("%d", seq_lcd_logo_screensaver_delay); |
||
1386 | } |
||
1387 | SEQ_LCD_PrintString(" minutes"); |
||
1388 | SEQ_LCD_PrintSpaces(40-6-delay_len-8); |
||
1389 | } |
||
1390 | } break; |
||
1391 | |||
1392 | /////////////////////////////////////////////////////////////////////////// |
||
1810 | tk | 1393 | default: |
1394 | SEQ_LCD_PrintSpaces(40); |
||
1794 | tk | 1395 | } |
1810 | tk | 1396 | /////////////////////////////////////////////////////////////////////////// |
1397 | /////////////////////////////////////////////////////////////////////////// |
||
1205 | tk | 1398 | |
1794 | tk | 1399 | |
1810 | tk | 1400 | // for cheap enabled/disabled |
1401 | if( enabled_value >= 0 ) { |
||
1402 | if( ui_cursor_flash ) { |
||
1403 | SEQ_LCD_PrintSpaces(40); |
||
1404 | } else { |
||
1405 | SEQ_LCD_PrintStringPadded(enabled_value ? "enabled" : "disabled", 40); |
||
1406 | } |
||
1407 | } |
||
1408 | |||
240 | tk | 1409 | return 0; // no error |
1410 | } |
||
1411 | |||
1412 | |||
1413 | ///////////////////////////////////////////////////////////////////////////// |
||
352 | tk | 1414 | // Local exit function |
1415 | ///////////////////////////////////////////////////////////////////////////// |
||
1416 | static s32 EXIT_Handler(void) |
||
1417 | { |
||
513 | tk | 1418 | s32 status = 0; |
352 | tk | 1419 | |
2102 | tk | 1420 | if( ui_store_file_required ) { |
1052 | tk | 1421 | // write config files |
513 | tk | 1422 | MUTEX_SDCARD_TAKE; |
1123 | tk | 1423 | if( (status=SEQ_FILE_C_Write(seq_file_session_name)) < 0 ) |
513 | tk | 1424 | SEQ_UI_SDCardErrMsg(2000, status); |
1425 | MUTEX_SDCARD_GIVE; |
||
352 | tk | 1426 | |
1052 | tk | 1427 | MUTEX_SDCARD_TAKE; |
1428 | if( (status=SEQ_FILE_GC_Write()) < 0 ) |
||
1429 | SEQ_UI_SDCardErrMsg(2000, status); |
||
1430 | MUTEX_SDCARD_GIVE; |
||
1431 | |||
2102 | tk | 1432 | ui_store_file_required = 0; |
513 | tk | 1433 | } |
1434 | |||
352 | tk | 1435 | return status; |
1436 | } |
||
1437 | |||
1438 | |||
1439 | ///////////////////////////////////////////////////////////////////////////// |
||
240 | tk | 1440 | // Initialisation |
1441 | ///////////////////////////////////////////////////////////////////////////// |
||
1442 | s32 SEQ_UI_OPT_Init(u32 mode) |
||
1443 | { |
||
1444 | // install callback routines |
||
1445 | SEQ_UI_InstallButtonCallback(Button_Handler); |
||
1446 | SEQ_UI_InstallEncoderCallback(Encoder_Handler); |
||
1447 | SEQ_UI_InstallLEDCallback(LED_Handler); |
||
1448 | SEQ_UI_InstallLCDCallback(LCD_Handler); |
||
352 | tk | 1449 | SEQ_UI_InstallExitCallback(EXIT_Handler); |
240 | tk | 1450 | |
1451 | return 0; // no error |
||
1452 | } |