mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
wip: refactor arranger to device
This commit is contained in:
parent
fa73821a0b
commit
89288f2920
40 changed files with 2015 additions and 1919 deletions
|
|
@ -22,11 +22,11 @@ impl<T: MidiSequencer> Audio for PlayerAudio<'_, T> {
|
|||
if model.play(scope, note_buf, midi_buf) {
|
||||
model.switchover(scope, note_buf, midi_buf);
|
||||
}
|
||||
if model.has_midi_ins() {
|
||||
if !model.midi_ins().is_empty() {
|
||||
if model.recording() || model.monitoring() {
|
||||
// Record and/or monitor input
|
||||
model.record(scope, midi_buf)
|
||||
} else if model.has_midi_outs() && model.monitoring() {
|
||||
} else if model.midi_outs().is_empty() && model.monitoring() {
|
||||
// Monitor input to output
|
||||
model.monitor(scope, midi_buf)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,17 +103,8 @@ impl std::fmt::Debug for Sequencer {
|
|||
}
|
||||
|
||||
has_clock!(|self: Sequencer|self.clock);
|
||||
|
||||
impl HasMidiIns for Sequencer {
|
||||
fn midi_ins (&self) -> &Vec<JackMidiIn> { &self.midi_ins }
|
||||
fn midi_ins_mut (&mut self) -> &mut Vec<JackMidiIn> { &mut self.midi_ins }
|
||||
}
|
||||
|
||||
impl HasMidiOuts for Sequencer {
|
||||
fn midi_outs (&self) -> &Vec<JackMidiOut> { &self.midi_outs }
|
||||
fn midi_outs_mut (&mut self) -> &mut Vec<JackMidiOut> { &mut self.midi_outs }
|
||||
fn midi_note (&mut self) -> &mut Vec<u8> { &mut self.note_buf }
|
||||
}
|
||||
has!(Vec<JackMidiIn>: |self:Sequencer| self.midi_ins);
|
||||
has!(Vec<JackMidiOut>: |self:Sequencer| self.midi_outs);
|
||||
|
||||
impl MidiRecorder for Sequencer {
|
||||
fn recording (&self) -> bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue