mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
move ClockModel to tek_api
This commit is contained in:
parent
4fdc3911e4
commit
a26a1f2967
13 changed files with 214 additions and 222 deletions
|
|
@ -91,30 +91,6 @@ impl TuiTheme {
|
|||
}
|
||||
}
|
||||
|
||||
macro_rules! impl_clock_api {
|
||||
($Struct:ident $(:: $field:ident)*) => {
|
||||
impl ClockApi for $Struct {
|
||||
fn quant (&self) -> &Arc<Quantize> {
|
||||
&self$(.$field)*.quant
|
||||
}
|
||||
fn sync (&self) -> &Arc<LaunchSync> {
|
||||
&self$(.$field)*.sync
|
||||
}
|
||||
fn current (&self) -> &Arc<Instant> {
|
||||
&self$(.$field)*.current
|
||||
}
|
||||
fn transport_handle (&self) -> &Arc<Transport> {
|
||||
&self$(.$field)*.transport
|
||||
}
|
||||
fn transport_state (&self) -> &Arc<RwLock<Option<TransportState>>> {
|
||||
&self$(.$field)*.playing
|
||||
}
|
||||
fn transport_offset (&self) -> &Arc<RwLock<Option<(usize, usize)>>> {
|
||||
&self$(.$field)*.started
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
macro_rules! impl_midi_player {
|
||||
($Struct:ident $(:: $field:ident)*) => {
|
||||
impl HasPhrase for $Struct {
|
||||
|
|
@ -184,12 +160,6 @@ macro_rules! impl_midi_player {
|
|||
}
|
||||
}
|
||||
|
||||
impl_clock_api!(TransportTui::clock);
|
||||
impl_clock_api!(SequencerTui::clock);
|
||||
impl_clock_api!(ArrangerTui::clock);
|
||||
impl_clock_api!(PhrasePlayerModel::clock);
|
||||
impl_clock_api!(ArrangerTrack::player::clock);
|
||||
|
||||
impl_midi_player!(SequencerTui::player);
|
||||
impl_midi_player!(ArrangerTrack::player);
|
||||
impl_midi_player!(PhrasePlayerModel);
|
||||
|
|
@ -197,18 +167,6 @@ impl_midi_player!(PhrasePlayerModel);
|
|||
use std::fmt::{Debug, Formatter, Error};
|
||||
type DebugResult = std::result::Result<(), Error>;
|
||||
|
||||
impl Debug for ClockModel {
|
||||
fn fmt (&self, f: &mut Formatter<'_>) -> DebugResult {
|
||||
f.debug_struct("editor")
|
||||
.field("playing", &self.playing)
|
||||
.field("started", &self.started)
|
||||
.field("current", &self.current)
|
||||
.field("quant", &self.quant)
|
||||
.field("sync", &self.sync)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl Debug for TransportTui {
|
||||
fn fmt (&self, f: &mut Formatter<'_>) -> DebugResult {
|
||||
f.debug_struct("Measure")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue