wip: p.42, e=22, more intermediary trait layers

This commit is contained in:
🪞👃🪞 2024-11-16 21:31:04 +01:00
parent 638298ad32
commit dbf6e353b7
15 changed files with 937 additions and 688 deletions

View file

@ -0,0 +1,150 @@
use crate::*;
#[derive(Debug)]
pub struct ArrangerTrack {
/// Name of track
name: Arc<RwLock<String>>,
/// Preferred width of track column
width: usize,
/// Identifying color of track
color: ItemColor,
/// Start time and phrase being played
play_phrase: Option<(Instant, Option<Arc<RwLock<Phrase>>>)>,
/// Start time and next phrase
next_phrase: Option<(Instant, Option<Arc<RwLock<Phrase>>>)>,
/// Play input through output.
monitoring: bool,
/// Write input to sequence.
recording: bool,
/// Overdub input to sequence.
overdub: bool,
/// Send all notes off
reset: bool, // TODO?: after Some(nframes)
/// Record from MIDI ports to current sequence.
midi_ins: Vec<Port<MidiIn>>,
/// Play from current sequence to MIDI ports
midi_outs: Vec<Port<MidiOut>>,
/// Notes currently held at input
notes_in: Arc<RwLock<[bool; 128]>>,
/// Notes currently held at output
notes_out: Arc<RwLock<[bool; 128]>>,
///// MIDI output buffer
//midi_note: Vec<u8>,
///// MIDI output buffer
//midi_chunk: Vec<Vec<Vec<u8>>>,
}
impl ArrangerTrackApi for ArrangerTrack {
/// Name of track
fn name (&self) -> &Arc<RwLock<String>> {
&self.name
}
/// Preferred width of track column
fn width (&self) -> usize {
self.width
}
/// Preferred width of track column
fn width_mut (&mut self) -> &mut usize {
&mut self.width
}
/// Identifying color of track
fn color (&self) -> ItemColor {
self.color
}
}
impl HasPhrase for ArrangerTrack {
fn reset (&self) -> bool {
self.reset
}
fn reset_mut (&mut self) -> &mut bool {
&mut self.reset
}
fn phrase (&self) -> &Option<(Instant, Option<Arc<RwLock<Phrase>>>)> {
todo!()
}
fn phrase_mut (&self) -> &mut Option<(Instant, Option<Arc<RwLock<Phrase>>>)> {
todo!()
}
fn next_phrase (&self) -> &Option<(Instant, Option<Arc<RwLock<Phrase>>>)> {
todo!()
}
fn next_phrase_mut (&mut self) -> &mut Option<(Instant, Option<Arc<RwLock<Phrase>>>)> {
todo!()
}
}
impl MidiInputApi for ArrangerTrack {
fn midi_ins (&self) -> &Vec<Port<jack::MidiIn>> {
todo!()
}
fn midi_ins_mut (&self) -> &mut Vec<Port<jack::MidiIn>> {
todo!()
}
fn recording (&self) -> bool {
todo!()
}
fn recording_mut (&mut self) -> &mut bool {
todo!()
}
fn monitoring (&self) -> bool {
todo!()
}
fn monitoring_mut (&mut self) -> &mut bool {
todo!()
}
fn overdub (&self) -> bool {
todo!()
}
fn overdub_mut (&mut self) -> &mut bool {
todo!()
}
fn notes_in (&self) -> &Arc<RwLock<[bool; 128]>> {
todo!()
}
}
impl MidiOutputApi for ArrangerTrack {
fn midi_outs (&self) -> &Vec<Port<jack::MidiOut>> {
todo!()
}
fn midi_outs_mut (&mut self) -> &mut Vec<Port<jack::MidiOut>> {
todo!()
}
fn midi_note (&mut self) -> &mut Vec<u8> {
todo!()
}
fn notes_out (&self) -> &Arc<RwLock<[bool; 128]>> {
todo!()
}
}
impl ClockApi for ArrangerTrack {
fn timebase (&self) -> &Arc<Timebase> {
todo!()
}
fn quant (&self) -> &Quantize {
todo!()
}
fn sync (&self) -> &LaunchSync {
todo!()
}
}
impl PlayheadApi for ArrangerTrack {
fn current (&self) -> &Instant {
todo!()
}
fn transport (&self) -> &Transport {
todo!()
}
fn playing (&self) -> &RwLock<Option<TransportState>> {
todo!()
}
fn started (&self) -> &RwLock<Option<(usize, usize)>> {
todo!()
}
}
impl PlayerApi for ArrangerTrack {}