Chance setting
This commit is contained in:
@@ -162,6 +162,15 @@ static void handleInput() {
|
||||
trackIntensity[randomizeTrack] = current;
|
||||
}
|
||||
break;
|
||||
case UI_EDIT_CHANCE:
|
||||
{
|
||||
int current = trackChance[randomizeTrack];
|
||||
current += delta;
|
||||
if (current < 0) current = 0;
|
||||
if (current > 100) current = 100;
|
||||
trackChance[randomizeTrack] = current;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (currentState == UI_RANDOMIZE_TRACK_EDIT) {
|
||||
randomizeTrack += (delta > 0 ? 1 : -1);
|
||||
@@ -254,6 +263,7 @@ static void handleInput() {
|
||||
case MENU_ID_MUTE: trackMute[randomizeTrack] = !trackMute[randomizeTrack]; break;
|
||||
case MENU_ID_FLAVOUR: currentState = UI_EDIT_FLAVOUR; break;
|
||||
case MENU_ID_INTENSITY: currentState = UI_EDIT_INTENSITY; break;
|
||||
case MENU_ID_CHANCE: currentState = UI_EDIT_CHANCE; break;
|
||||
case MENU_ID_MUTATION: mutationEnabled = !mutationEnabled; break;
|
||||
|
||||
case MENU_ID_CHANNEL: currentState = UI_SETUP_CHANNEL_EDIT; break;
|
||||
@@ -355,6 +365,20 @@ static void handleInput() {
|
||||
}
|
||||
saveSequence(true);
|
||||
break;
|
||||
case UI_EDIT_CHANCE:
|
||||
currentState = UI_MENU_MAIN;
|
||||
if (isPlaying) {
|
||||
int theme = (queuedTheme != -1) ? queuedTheme : currentThemeIndex;
|
||||
midi.lock();
|
||||
if (!sequenceChangeScheduled) {
|
||||
memcpy(nextSequence, sequence, sizeof(sequence));
|
||||
}
|
||||
SequenceGenerator::generateTrackData(randomizeTrack, theme, nextSequence);
|
||||
sequenceChangeScheduled = true;
|
||||
midi.unlock();
|
||||
}
|
||||
saveSequence(true);
|
||||
break;
|
||||
case UI_RANDOMIZE_TRACK_EDIT:
|
||||
currentState = UI_MENU_MAIN;
|
||||
saveSequence(true);
|
||||
|
||||
Reference in New Issue
Block a user