mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-10 21:56:42 +01:00
wip: refactor pt.4, reduce number of files
This commit is contained in:
parent
adf5b3f0f8
commit
8c37c95cc6
60 changed files with 2185 additions and 2187 deletions
65
crates/tek_api/src/arrange.rs
Normal file
65
crates/tek_api/src/arrange.rs
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
use scene::*;
|
||||
|
||||
pub struct Arrangement {
|
||||
/// JACK client handle (needs to not be dropped for standalone mode to work).
|
||||
pub jack: Arc<RwLock<JackClient>>,
|
||||
/// Global timebase
|
||||
pub clock: Arc<Clock>,
|
||||
/// Name of arranger
|
||||
pub name: Arc<RwLock<String>>,
|
||||
/// Collection of phrases.
|
||||
pub phrases: Arc<RwLock<Vec<Phrase>>>,
|
||||
/// Collection of tracks.
|
||||
pub tracks: Vec<SequencerTrack>,
|
||||
/// Collection of scenes.
|
||||
pub scenes: Vec<Scene>,
|
||||
}
|
||||
|
||||
impl Audio for Arrangement {
|
||||
fn process (&mut self, client: &Client, scope: &ProcessScope) -> Control {
|
||||
for track in self.tracks.iter_mut() {
|
||||
track.player.process(client, scope);
|
||||
}
|
||||
Control::Continue
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub enum ArrangementCommand {
|
||||
New,
|
||||
Load,
|
||||
Save,
|
||||
ToggleViewMode,
|
||||
Delete,
|
||||
Activate,
|
||||
Increment,
|
||||
Decrement,
|
||||
ZoomIn,
|
||||
ZoomOut,
|
||||
Go(Direction),
|
||||
Edit(Option<Arc<RwLock<Phrase>>>),
|
||||
Scene(SceneCommand),
|
||||
Track(TrackCommand),
|
||||
Clip(ClipCommand),
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub enum ArrangementTrackCommand {
|
||||
Next,
|
||||
Prev,
|
||||
Add,
|
||||
Delete,
|
||||
MoveForward,
|
||||
MoveBack,
|
||||
RandomColor,
|
||||
SetSize(usize),
|
||||
SetZoom(usize),
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub enum ArrangementClipCommand {
|
||||
SetLoop(bool),
|
||||
Get(usize, usize),
|
||||
Put(usize, usize, Option<Arc<RwLock<Phrase>>>),
|
||||
Edit(Option<Arc<RwLock<Phrase>>>),
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue