This commit is contained in:
2026-01-21 17:05:30 +01:00
commit 67322381c3
59 changed files with 10421 additions and 0 deletions

42
src/state/editor.rs Normal file
View File

@@ -0,0 +1,42 @@
use tui_textarea::TextArea;
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Focus {
Sequencer,
Editor,
}
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum PatternField {
Length,
Speed,
}
pub struct EditorContext {
pub bank: usize,
pub pattern: usize,
pub step: usize,
pub focus: Focus,
pub text: TextArea<'static>,
pub copied_step: Option<CopiedStep>,
}
#[derive(Clone, Copy)]
pub struct CopiedStep {
pub bank: usize,
pub pattern: usize,
pub step: usize,
}
impl Default for EditorContext {
fn default() -> Self {
Self {
bank: 0,
pattern: 0,
step: 0,
focus: Focus::Sequencer,
text: TextArea::default(),
copied_step: None,
}
}
}