32 lines
671 B
Rust
32 lines
671 B
Rust
use crate::engine::PatternChange;
|
|
use crate::model::{LaunchQuantization, SyncMode};
|
|
|
|
#[derive(Clone)]
|
|
pub struct StagedChange {
|
|
pub change: PatternChange,
|
|
pub quantization: LaunchQuantization,
|
|
pub sync_mode: SyncMode,
|
|
}
|
|
|
|
pub struct PlaybackState {
|
|
pub playing: bool,
|
|
pub staged_changes: Vec<StagedChange>,
|
|
pub queued_changes: Vec<StagedChange>,
|
|
}
|
|
|
|
impl Default for PlaybackState {
|
|
fn default() -> Self {
|
|
Self {
|
|
playing: true,
|
|
staged_changes: Vec::new(),
|
|
queued_changes: Vec::new(),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl PlaybackState {
|
|
pub fn toggle(&mut self) {
|
|
self.playing = !self.playing;
|
|
}
|
|
}
|