This commit is contained in:
@@ -41,6 +41,32 @@ impl PatternPropsField {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Default)]
|
||||
pub enum EuclideanField {
|
||||
#[default]
|
||||
Pulses,
|
||||
Steps,
|
||||
Rotation,
|
||||
}
|
||||
|
||||
impl EuclideanField {
|
||||
pub fn next(&self) -> Self {
|
||||
match self {
|
||||
Self::Pulses => Self::Steps,
|
||||
Self::Steps => Self::Rotation,
|
||||
Self::Rotation => Self::Rotation,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn prev(&self) -> Self {
|
||||
match self {
|
||||
Self::Pulses => Self::Pulses,
|
||||
Self::Steps => Self::Pulses,
|
||||
Self::Rotation => Self::Steps,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct EditorContext {
|
||||
pub bank: usize,
|
||||
pub pattern: usize,
|
||||
|
||||
@@ -30,7 +30,8 @@ pub mod ui;
|
||||
pub use audio::{AudioSettings, DeviceKind, EngineSection, MainLayout, Metrics, SettingKind};
|
||||
pub use color_scheme::ColorScheme;
|
||||
pub use editor::{
|
||||
CopiedStepData, CopiedSteps, EditorContext, PatternField, PatternPropsField, StackCache,
|
||||
CopiedStepData, CopiedSteps, EditorContext, EuclideanField, PatternField, PatternPropsField,
|
||||
StackCache,
|
||||
};
|
||||
pub use live_keys::LiveKeyState;
|
||||
pub use modal::Modal;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::model::{LaunchQuantization, PatternSpeed, SyncMode};
|
||||
use crate::state::editor::{PatternField, PatternPropsField};
|
||||
use crate::state::editor::{EuclideanField, PatternField, PatternPropsField};
|
||||
use crate::state::file_browser::FileBrowserState;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
@@ -66,4 +66,13 @@ pub enum Modal {
|
||||
KeybindingsHelp {
|
||||
scroll: usize,
|
||||
},
|
||||
EuclideanDistribution {
|
||||
bank: usize,
|
||||
pattern: usize,
|
||||
source_step: usize,
|
||||
field: EuclideanField,
|
||||
pulses: String,
|
||||
steps: String,
|
||||
rotation: String,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ use super::CyclicEnum;
|
||||
pub enum OptionsFocus {
|
||||
#[default]
|
||||
ColorScheme,
|
||||
HueRotation,
|
||||
RefreshRate,
|
||||
RuntimeHighlight,
|
||||
ShowScope,
|
||||
@@ -26,6 +27,7 @@ pub enum OptionsFocus {
|
||||
impl CyclicEnum for OptionsFocus {
|
||||
const VARIANTS: &'static [Self] = &[
|
||||
Self::ColorScheme,
|
||||
Self::HueRotation,
|
||||
Self::RefreshRate,
|
||||
Self::RuntimeHighlight,
|
||||
Self::ShowScope,
|
||||
|
||||
@@ -50,6 +50,7 @@ pub struct UiState {
|
||||
pub event_flash: f32,
|
||||
pub flash_brightness: f32,
|
||||
pub color_scheme: ColorScheme,
|
||||
pub hue_rotation: f32,
|
||||
}
|
||||
|
||||
impl Default for UiState {
|
||||
@@ -78,6 +79,7 @@ impl Default for UiState {
|
||||
event_flash: 0.0,
|
||||
flash_brightness: 1.0,
|
||||
color_scheme: ColorScheme::default(),
|
||||
hue_rotation: 0.0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user