Init
This commit is contained in:
21
src/state/playback.rs
Normal file
21
src/state/playback.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use crate::engine::PatternChange;
|
||||
|
||||
pub struct PlaybackState {
|
||||
pub playing: bool,
|
||||
pub queued_changes: Vec<PatternChange>,
|
||||
}
|
||||
|
||||
impl Default for PlaybackState {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
playing: true,
|
||||
queued_changes: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl PlaybackState {
|
||||
pub fn toggle(&mut self) {
|
||||
self.playing = !self.playing;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user