mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-11 14:16:42 +01:00
wip: refactor pt.42 (84e) lotta todo!
This commit is contained in:
parent
bf0e14c252
commit
638298ad32
11 changed files with 536 additions and 335 deletions
|
|
@ -34,12 +34,24 @@ impl<T: PlayheadApi> Command<T> for PlayheadCommand {
|
|||
}
|
||||
|
||||
pub trait PlayheadApi: ClockApi {
|
||||
/// Current moment in time
|
||||
fn current (&self) -> &Instant;
|
||||
/// Handle to JACK transport
|
||||
fn transport (&self) -> &jack::Transport;
|
||||
/// Playback state
|
||||
fn playing (&self) -> &RwLock<Option<TransportState>>;
|
||||
/// Global sample and usec at which playback started
|
||||
fn started (&self) -> &RwLock<Option<(usize, usize)>>;
|
||||
|
||||
fn is_stopped (&self) -> bool {
|
||||
*self.playing().read().unwrap() == Some(TransportState::Stopped)
|
||||
}
|
||||
|
||||
fn is_rolling (&self) -> bool {
|
||||
*self.playing().read().unwrap() == Some(TransportState::Rolling)
|
||||
}
|
||||
|
||||
/// Current pulse
|
||||
fn pulse (&self) -> f64 {
|
||||
self.current().pulse.get()
|
||||
}
|
||||
|
|
@ -67,13 +79,6 @@ pub trait PlayheadApi: ClockApi {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn is_stopped (&self) -> bool {
|
||||
*self.playing().read().unwrap() == Some(TransportState::Stopped)
|
||||
}
|
||||
|
||||
fn is_rolling (&self) -> bool {
|
||||
*self.playing().read().unwrap() == Some(TransportState::Rolling)
|
||||
}
|
||||
}
|
||||
|
||||
/// Hosts the JACK callback for updating the temporal pointer and playback status.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue