fix: same key multiple uses
Clang Lint CI / lint-no-video (push) Successful in 1m4s
Clang Build CI / run-video (push) Successful in 1m4s
Clang Build CI / run-no-video (push) Successful in 1m4s
Clang Build CI / build-release (push) Has been cancelled
Clang Lint CI / lint-video (push) Successful in 1m27s
Clang Lint CI / lint-no-video (push) Successful in 1m4s
Clang Build CI / run-video (push) Successful in 1m4s
Clang Build CI / run-no-video (push) Successful in 1m4s
Clang Build CI / build-release (push) Has been cancelled
Clang Lint CI / lint-video (push) Successful in 1m27s
This commit is contained in:
+20
-17
@@ -529,6 +529,9 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
unsigned int j;
|
||||
unsigned int k;
|
||||
unsigned int part;
|
||||
bool found;
|
||||
|
||||
found = false;
|
||||
|
||||
// PAGE CHANGE
|
||||
i = arr_uint_index_of(state_config.select_page_codes, code);
|
||||
@@ -537,7 +540,7 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
context->page = i;
|
||||
update_page(context, state_config, midi);
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
// TARGET CHANGE
|
||||
@@ -547,7 +550,7 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
context->selected = i;
|
||||
update_page(context, state_config, midi);
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
// ITEM CHANGE
|
||||
@@ -558,7 +561,7 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
context->page * state_config.select_item_codes.length + i;
|
||||
update_page(context, state_config, midi);
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
// ACTIVE CHANGE
|
||||
@@ -570,7 +573,7 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
update_active(context, state_config, midi, true);
|
||||
update_values(context, state_config, midi);
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
// VALUE CHANGE
|
||||
@@ -592,7 +595,7 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
safe_midi_write(midi, code, MIDI_MAX);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
// TAP TEMPO
|
||||
@@ -601,7 +604,7 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
if (value > 0) {
|
||||
tempo_tap(&context->tempo);
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
// OTHER KEYS
|
||||
@@ -611,7 +614,7 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
randomize(context, state_config);
|
||||
update_values(context, state_config, midi);
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
if (code == state_config.key_reset) {
|
||||
@@ -620,7 +623,7 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
reset(context);
|
||||
update_values(context, state_config, midi);
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
if (code == state_config.key_demo) {
|
||||
@@ -628,7 +631,7 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
log_info((context->demo ? "[%d] Demo OFF" : "[%d] Demo ON"), code);
|
||||
context->demo = !context->demo;
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
if (code == state_config.key_autorand) {
|
||||
@@ -637,7 +640,7 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
log_info("[%d] Auto Random %s", code,
|
||||
context->auto_random ? "ON" : "OFF");
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
if (code == state_config.key_autorand_down) {
|
||||
@@ -647,7 +650,7 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
}
|
||||
log_info("[%d] Auto Random Cycle: %d", code, context->auto_random_cycle);
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
if (code == state_config.key_autorand_up) {
|
||||
@@ -655,7 +658,7 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
context->auto_random_cycle += 1;
|
||||
log_info("[%d] Auto Random Cycle: %d", code, context->auto_random_cycle);
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
if (code == state_config.key_tempo_up) {
|
||||
@@ -663,7 +666,7 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
tempo_set(&context->tempo, context->tempo.tempo + 1);
|
||||
log_info("[%d] Tempo: %f", code, context->tempo);
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
if (code == state_config.key_tempo_down) {
|
||||
@@ -673,7 +676,7 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
}
|
||||
log_info("[%d] Tempo: %f", code, context->tempo.tempo);
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
// LOAD STATE
|
||||
@@ -684,7 +687,7 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
log_info("[%d] Loading state %d", code, i + 1);
|
||||
load_from_index_file(context, state_config, i + 1);
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
// SAVE STATE
|
||||
@@ -695,10 +698,10 @@ static bool compute_event(Context *context, StateConfig state_config,
|
||||
log_info("[%d] Saving state %d", code, i + 1);
|
||||
save_to_index_file(context, state_config, i + 1);
|
||||
}
|
||||
return true;
|
||||
found = true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return found;
|
||||
}
|
||||
|
||||
void state_midi_event(Context *context, StateConfig state_config,
|
||||
|
||||
Reference in New Issue
Block a user