mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
remodularize 3
This commit is contained in:
parent
d38dc14e84
commit
113e7b0bad
24 changed files with 262 additions and 370 deletions
|
|
@ -11,3 +11,35 @@ tek_time = { path = "../time" }
|
|||
jack = { path = "../rust-jack" }
|
||||
midly = "0.5"
|
||||
uuid = { version = "1.10.0", features = [ "v4" ] }
|
||||
|
||||
#[[bin]]
|
||||
#name = "tek_arranger"
|
||||
#path = "bin/cli_arranger.rs"
|
||||
|
||||
#[[bin]]
|
||||
#name = "tek_sequencer"
|
||||
#path = "bin/cli_sequencer.rs"
|
||||
|
||||
#[[bin]]
|
||||
#name = "tek_groovebox"
|
||||
#path = "bin/cli_groovebox.rs"
|
||||
|
||||
#[[bin]]
|
||||
#name = "tek_clock"
|
||||
#path = "bin/cli_clock.rs"
|
||||
|
||||
#[[bin]]
|
||||
#name = "tek_sampler"
|
||||
#path = "bin/cli_sampler.rs"
|
||||
|
||||
#[[bin]]
|
||||
#name = "tek_mixer"
|
||||
#path = "src/cli_mixer.rs"
|
||||
|
||||
#[[bin]]
|
||||
#name = "tek_track"
|
||||
#path = "src/cli_track.rs"
|
||||
|
||||
#[[bin]]
|
||||
#name = "tek_plugin"
|
||||
#path = "src/cli_plugin.rs"
|
||||
|
|
|
|||
|
|
@ -1,22 +1,22 @@
|
|||
mod midi_pool; pub(crate) use midi_pool::*;
|
||||
mod midi_clip; pub(crate) use midi_clip::*;
|
||||
mod midi_launch; pub(crate) use midi_launch::*;
|
||||
mod midi_player; pub(crate) use midi_player::*;
|
||||
mod midi_in; pub(crate) use midi_in::*;
|
||||
mod midi_out; pub(crate) use midi_out::*;
|
||||
mod midi_pool; pub use midi_pool::*;
|
||||
mod midi_clip; pub use midi_clip::*;
|
||||
mod midi_launch; pub use midi_launch::*;
|
||||
mod midi_player; pub use midi_player::*;
|
||||
mod midi_in; pub use midi_in::*;
|
||||
mod midi_out; pub use midi_out::*;
|
||||
|
||||
mod midi_pitch; pub(crate) use midi_pitch::*;
|
||||
mod midi_range; pub(crate) use midi_range::*;
|
||||
mod midi_point; pub(crate) use midi_point::*;
|
||||
mod midi_view; pub(crate) use midi_view::*;
|
||||
mod midi_editor; pub(crate) use midi_editor::*;
|
||||
mod midi_select; pub(crate) use midi_select::*;
|
||||
mod midi_pitch; pub use midi_pitch::*;
|
||||
mod midi_range; pub use midi_range::*;
|
||||
mod midi_point; pub use midi_point::*;
|
||||
mod midi_view; pub use midi_view::*;
|
||||
mod midi_editor; pub use midi_editor::*;
|
||||
mod midi_select; pub use midi_select::*;
|
||||
|
||||
mod piano_h; pub(crate) use self::piano_h::*;
|
||||
mod piano_h_cursor; pub(crate) use self::piano_h_cursor::*;
|
||||
mod piano_h_keys; pub(crate) use self::piano_h_keys::*;
|
||||
mod piano_h_notes; pub(crate) use self::piano_h_notes::*;
|
||||
mod piano_h_time; pub(crate) use self::piano_h_time::*;
|
||||
mod piano_h; pub use self::piano_h::*;
|
||||
mod piano_h_cursor; pub use self::piano_h_cursor::*;
|
||||
mod piano_h_keys; pub use self::piano_h_keys::*;
|
||||
mod piano_h_notes; pub use self::piano_h_notes::*;
|
||||
mod piano_h_time; pub use self::piano_h_time::*;
|
||||
|
||||
pub(crate) use ::tek_time::*;
|
||||
pub(crate) use ::tek_jack::{*, jack::*};
|
||||
|
|
|
|||
|
|
@ -21,29 +21,29 @@ pub trait HasPlayer {
|
|||
/// Contains state for playing a phrase
|
||||
pub struct MidiPlayer {
|
||||
/// State of clock and playhead
|
||||
pub(crate) clock: Clock,
|
||||
pub clock: Clock,
|
||||
/// Start time and phrase being played
|
||||
pub(crate) play_phrase: Option<(Moment, Option<Arc<RwLock<MidiClip>>>)>,
|
||||
pub play_phrase: Option<(Moment, Option<Arc<RwLock<MidiClip>>>)>,
|
||||
/// Start time and next phrase
|
||||
pub(crate) next_phrase: Option<(Moment, Option<Arc<RwLock<MidiClip>>>)>,
|
||||
pub next_phrase: Option<(Moment, Option<Arc<RwLock<MidiClip>>>)>,
|
||||
/// Play input through output.
|
||||
pub(crate) monitoring: bool,
|
||||
pub monitoring: bool,
|
||||
/// Write input to sequence.
|
||||
pub(crate) recording: bool,
|
||||
pub recording: bool,
|
||||
/// Overdub input to sequence.
|
||||
pub(crate) overdub: bool,
|
||||
pub overdub: bool,
|
||||
/// Send all notes off
|
||||
pub(crate) reset: bool, // TODO?: after Some(nframes)
|
||||
pub reset: bool, // TODO?: after Some(nframes)
|
||||
/// Record from MIDI ports to current sequence.
|
||||
pub midi_ins: Vec<Port<MidiIn>>,
|
||||
pub midi_ins: Vec<Port<MidiIn>>,
|
||||
/// Play from current sequence to MIDI ports
|
||||
pub midi_outs: Vec<Port<MidiOut>>,
|
||||
pub midi_outs: Vec<Port<MidiOut>>,
|
||||
/// Notes currently held at input
|
||||
pub(crate) notes_in: Arc<RwLock<[bool; 128]>>,
|
||||
pub notes_in: Arc<RwLock<[bool; 128]>>,
|
||||
/// Notes currently held at output
|
||||
pub(crate) notes_out: Arc<RwLock<[bool; 128]>>,
|
||||
pub notes_out: Arc<RwLock<[bool; 128]>>,
|
||||
/// MIDI output buffer
|
||||
pub note_buf: Vec<u8>,
|
||||
pub note_buf: Vec<u8>,
|
||||
}
|
||||
impl MidiPlayer {
|
||||
pub fn new (
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ pub trait HasPhrases {
|
|||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum PhrasePoolCommand {
|
||||
pub enum MidiPoolCommand {
|
||||
Add(usize, MidiClip),
|
||||
Delete(usize),
|
||||
Swap(usize, usize),
|
||||
|
|
@ -26,9 +26,9 @@ pub enum PhrasePoolCommand {
|
|||
SetColor(usize, ItemColor),
|
||||
}
|
||||
|
||||
impl<T: HasPhrases> Command<T> for PhrasePoolCommand {
|
||||
impl<T: HasPhrases> Command<T> for MidiPoolCommand {
|
||||
fn execute (self, model: &mut T) -> Perhaps<Self> {
|
||||
use PhrasePoolCommand::*;
|
||||
use MidiPoolCommand::*;
|
||||
Ok(match self {
|
||||
Add(mut index, phrase) => {
|
||||
let phrase = Arc::new(RwLock::new(phrase));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue