Feat: introduce follow up actions

This commit is contained in:
2026-02-22 03:59:09 +01:00
parent d3b27e8245
commit e2f3bcd4a9
25 changed files with 203 additions and 307 deletions

View File

@@ -24,26 +24,37 @@ pub enum PatternPropsField {
Speed,
Quantization,
SyncMode,
FollowUp,
ChainBank,
ChainPattern,
}
impl PatternPropsField {
pub fn next(&self) -> Self {
pub fn next(&self, follow_up_is_chain: bool) -> Self {
match self {
Self::Name => Self::Length,
Self::Length => Self::Speed,
Self::Speed => Self::Quantization,
Self::Quantization => Self::SyncMode,
Self::SyncMode => Self::SyncMode,
Self::SyncMode => Self::FollowUp,
Self::FollowUp if follow_up_is_chain => Self::ChainBank,
Self::FollowUp => Self::FollowUp,
Self::ChainBank => Self::ChainPattern,
Self::ChainPattern => Self::ChainPattern,
}
}
pub fn prev(&self) -> Self {
pub fn prev(&self, follow_up_is_chain: bool) -> Self {
match self {
Self::Name => Self::Name,
Self::Length => Self::Name,
Self::Speed => Self::Length,
Self::Quantization => Self::Speed,
Self::SyncMode => Self::Quantization,
Self::FollowUp => Self::SyncMode,
Self::ChainBank => Self::FollowUp,
Self::ChainPattern if follow_up_is_chain => Self::ChainBank,
Self::ChainPattern => Self::FollowUp,
}
}
}

View File

@@ -1,4 +1,4 @@
use crate::model::{LaunchQuantization, PatternSpeed, SyncMode};
use crate::model::{FollowUp, LaunchQuantization, PatternSpeed, SyncMode};
use crate::state::editor::{EuclideanField, PatternField, PatternPropsField};
use crate::state::file_browser::FileBrowserState;
@@ -77,6 +77,7 @@ pub enum Modal {
speed: PatternSpeed,
quantization: LaunchQuantization,
sync_mode: SyncMode,
follow_up: FollowUp,
},
KeybindingsHelp {
scroll: usize,

View File

@@ -1,5 +1,5 @@
use crate::engine::PatternChange;
use crate::model::{LaunchQuantization, PatternSpeed, SyncMode};
use crate::model::{FollowUp, LaunchQuantization, PatternSpeed, SyncMode};
use std::collections::{HashMap, HashSet};
#[derive(Clone)]
@@ -21,6 +21,7 @@ pub struct StagedPropChange {
pub speed: PatternSpeed,
pub quantization: LaunchQuantization,
pub sync_mode: SyncMode,
pub follow_up: FollowUp,
}
pub struct PlaybackState {