mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
extract Sequencer model
This commit is contained in:
parent
f347ca838b
commit
aa478099d9
14 changed files with 211 additions and 348 deletions
26
src/model.rs
26
src/model.rs
|
|
@ -1,8 +1,8 @@
|
|||
//! Application state.
|
||||
|
||||
submod! { arranger looper mixer phrase plugin sampler scene track transport }
|
||||
submod! { arranger looper mixer phrase plugin sampler sequencer scene track transport }
|
||||
|
||||
use crate::{core::*, view::*};
|
||||
use crate::core::*;
|
||||
|
||||
/// Root of application state.
|
||||
pub struct App {
|
||||
|
|
@ -14,8 +14,10 @@ pub struct App {
|
|||
pub section: AppFocus,
|
||||
/// Transport model and view.
|
||||
pub transport: TransportToolbar,
|
||||
/// Arraneger model and view.
|
||||
/// Arranger model and view.
|
||||
pub arranger: Arranger,
|
||||
/// Phrase editor
|
||||
pub sequencer: Sequencer,
|
||||
/// Main JACK client.
|
||||
pub jack: Option<JackClient>,
|
||||
/// Map of external MIDI outs in the jack graph
|
||||
|
|
@ -31,17 +33,6 @@ pub struct App {
|
|||
pub audio_outs: Vec<Arc<Port<Unowned>>>,
|
||||
/// Number of frames requested by process callback
|
||||
chunk_size: usize,
|
||||
|
||||
/// Display mode of sequencer seciton
|
||||
pub seq_mode: bool,
|
||||
/// Display buffer for sequencer
|
||||
pub seq_buf: BufferedSequencerView,
|
||||
/// Display position of cursor within note range
|
||||
pub note_cursor: usize,
|
||||
/// Range of notes to display
|
||||
pub note_start: usize,
|
||||
/// Display position of cursor within time range
|
||||
pub time_cursor: usize,
|
||||
}
|
||||
|
||||
impl App {
|
||||
|
|
@ -58,6 +49,7 @@ impl App {
|
|||
section: AppFocus::default(),
|
||||
transport: TransportToolbar::new(Some(jack.transport())),
|
||||
arranger: Arranger::new(),
|
||||
sequencer: Sequencer::new(),
|
||||
jack: Some(jack),
|
||||
audio_outs: vec![],
|
||||
chain_mode: false,
|
||||
|
|
@ -65,12 +57,6 @@ impl App {
|
|||
midi_in: None,
|
||||
midi_ins: vec![],
|
||||
xdg: Some(xdg),
|
||||
|
||||
seq_mode: false,
|
||||
seq_buf: BufferedSequencerView::new(96, 16384),
|
||||
note_cursor: 0,
|
||||
note_start: 2,
|
||||
time_cursor: 0,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue