mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
wip: down to 25 errors woo
This commit is contained in:
parent
89288f2920
commit
6ce83fb27a
25 changed files with 688 additions and 620 deletions
|
|
@ -5,6 +5,7 @@ version = { workspace = true }
|
|||
|
||||
[dependencies]
|
||||
tengri = { workspace = true }
|
||||
tengri_proc = { workspace = true }
|
||||
jack = { workspace = true }
|
||||
midly = { workspace = true }
|
||||
uuid = { workspace = true }
|
||||
|
|
|
|||
|
|
@ -2,6 +2,12 @@ use crate::*;
|
|||
use super::*;
|
||||
use self::JackState::*;
|
||||
|
||||
impl<T: Has<Jack>> HasJack for T {
|
||||
fn jack (&self) -> &Jack {
|
||||
self.get()
|
||||
}
|
||||
}
|
||||
|
||||
/// Things that can provide a [jack::Client] reference.
|
||||
pub trait HasJack {
|
||||
/// Return the internal [jack::Client] handle
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ pub(crate) use std::sync::{Arc, atomic::{AtomicUsize, AtomicBool, Ordering::Rela
|
|||
pub(crate) use std::fmt::Debug;
|
||||
pub(crate) use std::ops::{Add, Sub, Mul, Div, Rem};
|
||||
|
||||
pub(crate) use ::tengri::{from, Usually, tui::*};
|
||||
pub(crate) use ::tengri::{from, Usually, Perhaps, tui::*};
|
||||
|
||||
pub use ::atomic_float; pub(crate) use atomic_float::*;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
use crate::*;
|
||||
|
||||
#[tengri_proc::command(JackMidiIn)]
|
||||
impl MidiInputCommand {
|
||||
}
|
||||
|
||||
impl<T: Has<Vec<JackMidiIn>>> HasMidiIns for T {
|
||||
fn midi_ins (&self) -> &Vec<JackMidiIn> {
|
||||
self.get()
|
||||
|
|
@ -32,11 +36,20 @@ pub trait HasMidiIns {
|
|||
data
|
||||
})
|
||||
}
|
||||
fn midi_in_add (&mut self, jack: &Jack) -> Usually<()> {
|
||||
}
|
||||
|
||||
pub type CollectedMidiInput<'a> = Vec<Vec<(u32, Result<LiveEvent<'a>, MidiError>)>>;
|
||||
|
||||
impl<T: HasMidiIns + HasJack> AddMidiIn for T {
|
||||
fn midi_in_add (&mut self) -> Usually<()> {
|
||||
let index = self.midi_ins().len();
|
||||
self.midi_ins_mut().push(JackMidiIn::new(jack, &format!("M/{index}"), &[])?);
|
||||
let port = JackMidiIn::new(self.jack(), &format!("M/{index}"), &[])?;
|
||||
self.midi_ins_mut().push(port);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
pub type CollectedMidiInput<'a> = Vec<Vec<(u32, Result<LiveEvent<'a>, MidiError>)>>;
|
||||
/// May create new MIDI input ports.
|
||||
pub trait AddMidiIn {
|
||||
fn midi_in_add (&mut self) -> Usually<()>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
use crate::*;
|
||||
|
||||
#[tengri_proc::command(JackMidiOut)]
|
||||
impl MidiOutputCommand {
|
||||
}
|
||||
|
||||
impl<T: Has<Vec<JackMidiOut>>> HasMidiOuts for T {
|
||||
fn midi_outs (&self) -> &Vec<JackMidiOut> {
|
||||
self.get()
|
||||
|
|
@ -25,9 +29,19 @@ pub trait HasMidiOuts {
|
|||
data
|
||||
})
|
||||
}
|
||||
fn midi_out_add (&mut self, jack: &Jack) -> Usually<()> {
|
||||
}
|
||||
|
||||
/// Trail for thing that may gain new MIDI ports.
|
||||
impl<T: HasMidiOuts + HasJack> AddMidiOut for T {
|
||||
fn midi_out_add (&mut self) -> Usually<()> {
|
||||
let index = self.midi_outs().len();
|
||||
self.midi_outs_mut().push(JackMidiOut::new(&jack, &format!("{index}/M"), &[])?);
|
||||
let port = JackMidiOut::new(self.jack(), &format!("{index}/M"), &[])?;
|
||||
self.midi_outs_mut().push(port);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// May create new MIDI output ports.
|
||||
pub trait AddMidiOut {
|
||||
fn midi_out_add (&mut self) -> Usually<()>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue