mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
wip(p61,e38)
This commit is contained in:
parent
9d4fcaa32b
commit
76da19d9c6
12 changed files with 172 additions and 141 deletions
|
|
@ -1,11 +1,11 @@
|
|||
use crate::*;
|
||||
|
||||
pub trait HasPlayer: JackApi {
|
||||
fn player (&self) -> &impl PlayerApi;
|
||||
fn player_mut (&mut self) -> &mut impl PlayerApi;
|
||||
fn player (&self) -> &impl MidiPlayerApi;
|
||||
fn player_mut (&mut self) -> &mut impl MidiPlayerApi;
|
||||
}
|
||||
|
||||
pub trait PlayerApi: MidiInputApi + MidiOutputApi + Send + Sync {}
|
||||
pub trait MidiPlayerApi: MidiInputApi + MidiOutputApi + Send + Sync {}
|
||||
|
||||
pub trait HasPhrase: PlayheadApi {
|
||||
fn reset (&self) -> bool;
|
||||
|
|
@ -293,7 +293,7 @@ pub fn update_keys (keys: &mut[bool;128], message: &MidiMessage) {
|
|||
}
|
||||
|
||||
/// Hosts the JACK callback for a single MIDI player
|
||||
pub struct PlayerAudio<'a, T: PlayerApi>(
|
||||
pub struct PlayerAudio<'a, T: MidiPlayerApi>(
|
||||
/// Player
|
||||
pub &'a mut T,
|
||||
/// Note buffer
|
||||
|
|
@ -303,7 +303,7 @@ pub struct PlayerAudio<'a, T: PlayerApi>(
|
|||
);
|
||||
|
||||
/// JACK process callback for a sequencer's phrase player/recorder.
|
||||
impl<'a, T: PlayerApi> Audio for PlayerAudio<'a, T> {
|
||||
impl<'a, T: MidiPlayerApi> Audio for PlayerAudio<'a, T> {
|
||||
fn process (&mut self, _: &Client, scope: &ProcessScope) -> Control {
|
||||
let model = &mut self.0;
|
||||
let note_buf = &mut self.1;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ pub enum ArrangerTrackCommand {
|
|||
SetZoom(usize),
|
||||
}
|
||||
|
||||
pub trait ArrangerTrackApi: PlayerApi + Send + Sync + Sized {
|
||||
pub trait ArrangerTrackApi: MidiPlayerApi + Send + Sync + Sized {
|
||||
/// Name of track
|
||||
fn name (&self) -> &Arc<RwLock<String>>;
|
||||
/// Preferred width of track column
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue