mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
44 lines
910 B
Rust
44 lines
910 B
Rust
mod handle;
|
|
mod jack;
|
|
mod render;
|
|
pub use self::handle::*;
|
|
pub use self::jack::*;
|
|
pub use self::render::*;
|
|
use crate::prelude::*;
|
|
|
|
pub const ACTIONS: [(&'static str, &'static str);3] = [
|
|
("(Shift-)Tab", "Switch pane"),
|
|
("Arrows", "Navigate"),
|
|
("(Shift-)Space", "⯈ Play/pause"),
|
|
];
|
|
|
|
pub struct Transport {
|
|
exited: bool,
|
|
sample_rate: u64,
|
|
position: u64,
|
|
bpm: f64,
|
|
}
|
|
|
|
impl Transport {
|
|
pub fn new () -> Result<Self, Box<dyn Error>> {
|
|
Ok(Self {
|
|
exited: false,
|
|
sample_rate: 48000,
|
|
position: 0,
|
|
bpm: 120.0
|
|
})
|
|
}
|
|
pub fn play_from_start_or_stop_and_rewind (&mut self) {
|
|
}
|
|
pub fn play_or_pause (&mut self) {
|
|
}
|
|
}
|
|
|
|
impl Exitable for Transport {
|
|
fn exit (&mut self) {
|
|
self.exited = true
|
|
}
|
|
fn exited (&self) -> bool {
|
|
self.exited
|
|
}
|
|
}
|