mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
wip: now just gotta fix 26 type errors
This commit is contained in:
parent
ee7f9dcf12
commit
16d267523b
6 changed files with 259 additions and 209 deletions
|
|
@ -12,15 +12,15 @@ impl<T: HasClock> Command<T> for ClockCommand {
|
|||
|
||||
#[tengri_proc::command(Clock)]
|
||||
impl ClockCommand {
|
||||
fn play (self, state: &mut Clock, position: Option<u32>) -> Perhaps<Self> {
|
||||
fn play (state: &mut Clock, position: Option<u32>) -> Perhaps<Self> {
|
||||
state.play_from(position)?;
|
||||
Ok(None) // TODO Some(Pause(previousPosition))
|
||||
}
|
||||
fn pause (self, state: &mut Clock, position: Option<u32>) -> Perhaps<Self> {
|
||||
fn pause (state: &mut Clock, position: Option<u32>) -> Perhaps<Self> {
|
||||
state.pause_at(position)?;
|
||||
Ok(None)
|
||||
}
|
||||
fn toggle_playback (self, state: &mut Clock, position: Option<u32>) -> Perhaps<Self> {
|
||||
fn toggle_playback (state: &mut Clock, position: Option<u32>) -> Perhaps<Self> {
|
||||
if state.is_rolling() {
|
||||
state.pause_at(position)?;
|
||||
} else {
|
||||
|
|
@ -28,25 +28,25 @@ impl ClockCommand {
|
|||
}
|
||||
Ok(None)
|
||||
}
|
||||
fn seek_usec (self, state: &mut Clock, usec: f64) -> Perhaps<Self> {
|
||||
fn seek_usec (state: &mut Clock, usec: f64) -> Perhaps<Self> {
|
||||
state.playhead.update_from_usec(usec);
|
||||
Ok(None)
|
||||
}
|
||||
fn seek_sample (self, state: &mut Clock, sample: f64) -> Perhaps<Self> {
|
||||
fn seek_sample (state: &mut Clock, sample: f64) -> Perhaps<Self> {
|
||||
state.playhead.update_from_sample(sample);
|
||||
Ok(None)
|
||||
}
|
||||
fn seek_pulse (self, state: &mut Clock, pulse: f64) -> Perhaps<Self> {
|
||||
fn seek_pulse (state: &mut Clock, pulse: f64) -> Perhaps<Self> {
|
||||
state.playhead.update_from_pulse(pulse);
|
||||
Ok(None)
|
||||
}
|
||||
fn set_bpm (self, state: &mut Clock, bpm: f64) -> Perhaps<Self> {
|
||||
fn set_bpm (state: &mut Clock, bpm: f64) -> Perhaps<Self> {
|
||||
Ok(Some(Self::SetBpm { bpm: state.timebase().bpm.set(bpm) }))
|
||||
}
|
||||
fn set_quant (self, state: &mut Clock, quant: f64) -> Perhaps<Self> {
|
||||
fn set_quant (state: &mut Clock, quant: f64) -> Perhaps<Self> {
|
||||
Ok(Some(Self::SetQuant { quant: state.quant.set(quant) }))
|
||||
}
|
||||
fn set_sync (self, state: &mut Clock, sync: f64) -> Perhaps<Self> {
|
||||
fn set_sync (state: &mut Clock, sync: f64) -> Perhaps<Self> {
|
||||
Ok(Some(Self::SetSync { sync: state.sync.set(sync) }))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue