mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
51 lines
1.3 KiB
Rust
51 lines
1.3 KiB
Rust
use crate::*;
|
|
|
|
/// Phrase editor.
|
|
pub struct Sequencer {
|
|
pub name: String,
|
|
pub mode: bool,
|
|
pub focused: bool,
|
|
pub entered: bool,
|
|
|
|
pub phrase: Option<Arc<RwLock<Phrase>>>,
|
|
pub transport: Option<Arc<RwLock<TransportToolbar>>>,
|
|
pub buffer: BigBuffer,
|
|
pub keys: Buffer,
|
|
/// Highlight input keys
|
|
pub keys_in: [bool; 128],
|
|
/// Highlight output keys
|
|
pub keys_out: [bool; 128],
|
|
|
|
pub now: usize,
|
|
pub ppq: usize,
|
|
pub note_axis: FixedAxis<usize>,
|
|
pub time_axis: ScaledAxis<usize>,
|
|
}
|
|
|
|
impl Sequencer {
|
|
pub fn new () -> Self {
|
|
Self {
|
|
name: "".into(),
|
|
buffer: Default::default(),
|
|
keys: keys_vert(),
|
|
entered: false,
|
|
focused: false,
|
|
mode: false,
|
|
keys_in: [false;128],
|
|
keys_out: [false;128],
|
|
phrase: None,
|
|
now: 0,
|
|
ppq: 96,
|
|
transport: None,
|
|
note_axis: FixedAxis {
|
|
start: 12,
|
|
point: Some(36)
|
|
},
|
|
time_axis: ScaledAxis {
|
|
start: 0,
|
|
scale: 24,
|
|
point: Some(0)
|
|
},
|
|
}
|
|
}
|
|
}
|