transport toolbar docs and cleanup

This commit is contained in:
🪞👃🪞 2024-10-19 23:36:10 +03:00
parent b3db10607a
commit 5671e19910
2 changed files with 26 additions and 13 deletions

View file

@ -11,19 +11,36 @@ pub struct TransportToolbar<E: Engine> {
pub jack: Option<JackClient>,
/// JACK transport handle.
pub transport: Option<Transport>,
/// Quantization factor
/// Global frame and usec at which playback started
pub started: Option<(usize, usize)>,
/// Whether the toolbar is focused
pub focused: bool,
/// Which part of the toolbar is focused
pub focus: TransportToolbarFocus,
/// Playback state
pub playing: Option<TransportState>,
/// Current tempo
pub bpm: f64,
/// Quantization factor
pub quant: usize,
/// Launch sync
pub sync: usize,
/// Current time in frames
pub frame: usize,
/// Current time in pulses
pub pulse: usize,
pub ppq: usize,
/// Current time in microseconds
pub usecs: usize,
/// Pulses per quarter note
pub ppq: usize,
}
#[derive(Clone, Copy, PartialEq)]
pub enum TransportToolbarFocus {
Bpm,
Sync,
PlayPause,
Clock,
Quant,
}
impl<E: Engine> TransportToolbar<E> {
@ -112,17 +129,6 @@ impl<E: Engine> TransportToolbar<E> {
}
}
impl<E: Engine> Audio for TransportToolbar<E> {
fn process (&mut self, _: &Client, scope: &ProcessScope) -> Control {
self.update(&scope);
Control::Continue
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////
#[derive(Clone, Copy, PartialEq)]
pub enum TransportToolbarFocus { PlayPause, Bpm, Quant, Sync, Clock, }
impl TransportToolbarFocus {
pub fn next (&mut self) {
*self = match self {

View file

@ -0,0 +1,7 @@
use crate::*;
impl<E: Engine> Audio for TransportToolbar<E> {
fn process (&mut self, _: &Client, scope: &ProcessScope) -> Control {
self.update(&scope);
Control::Continue
}
}