mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 20:56:43 +01:00
use Arc<str> where applicable; use konst split_at
This commit is contained in:
parent
411fc0c4bc
commit
305481adee
35 changed files with 286 additions and 273 deletions
|
|
@ -52,7 +52,9 @@ impl MidiPlayer {
|
|||
midi_from: &[impl AsRef<str>],
|
||||
midi_to: &[impl AsRef<str>],
|
||||
) -> Usually<Self> {
|
||||
let name = name.as_ref();
|
||||
let name = name.as_ref();
|
||||
let midi_in = jack.midi_in(&format!("M/{name}"), midi_from)?;
|
||||
let midi_out = jack.midi_out(&format!("{name}/M"), midi_to)?;
|
||||
Ok(Self {
|
||||
clock: Clock::from(jack),
|
||||
play_phrase: None,
|
||||
|
|
@ -62,19 +64,20 @@ impl MidiPlayer {
|
|||
overdub: false,
|
||||
|
||||
notes_in: RwLock::new([false;128]).into(),
|
||||
midi_ins: vec![
|
||||
jack.midi_in(&format!("M/{name}"), midi_from)?,
|
||||
],
|
||||
|
||||
midi_outs: vec![
|
||||
jack.midi_out(&format!("{name}/M"), midi_to)?,
|
||||
],
|
||||
midi_ins: vec![midi_in],
|
||||
midi_outs: vec![midi_out],
|
||||
notes_out: RwLock::new([false;128]).into(),
|
||||
reset: true,
|
||||
|
||||
note_buf: vec![0;8],
|
||||
})
|
||||
}
|
||||
pub fn play_status (&self) -> impl Content<TuiOut> {
|
||||
ClipSelected::play_phrase(self)
|
||||
}
|
||||
pub fn next_status (&self) -> impl Content<TuiOut> {
|
||||
ClipSelected::next_phrase(self)
|
||||
}
|
||||
}
|
||||
impl std::fmt::Debug for MidiPlayer {
|
||||
fn fmt (&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue