mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
extract transport
This commit is contained in:
parent
449615eea8
commit
5a9ec0a63d
12 changed files with 178 additions and 182 deletions
10
src/edn.rs
10
src/edn.rs
|
|
@ -21,7 +21,7 @@ impl App {
|
|||
}
|
||||
pub fn load_edn (&mut self, mut src: &str) -> Usually<&mut Self> {
|
||||
loop {
|
||||
match clojure_reader::edn::read(src) {
|
||||
match read(src) {
|
||||
Ok((edn, rest)) => {
|
||||
self.load_edn_one(edn)?;
|
||||
if rest.len() > 0 {
|
||||
|
|
@ -46,8 +46,10 @@ impl App {
|
|||
match items.get(0) {
|
||||
Some(Edn::Symbol("bpm")) => {
|
||||
match items.get(1) {
|
||||
Some(Edn::Int(b)) => self.timebase.set_bpm(*b as f64),
|
||||
Some(Edn::Double(b)) => self.timebase.set_bpm(f64::from(*b)),
|
||||
Some(Edn::Int(b)) =>
|
||||
self.transport.timebase.set_bpm(*b as f64),
|
||||
Some(Edn::Double(b)) =>
|
||||
self.transport.timebase.set_bpm(f64::from(*b)),
|
||||
_ => panic!("unspecified bpm")
|
||||
}
|
||||
},
|
||||
|
|
@ -99,7 +101,7 @@ impl Scene {
|
|||
|
||||
impl Track {
|
||||
fn load_edn <'a, 'e> (app: &'a mut App, args: &[Edn<'e>]) -> Usually<&'a mut Self> {
|
||||
let ppq = app.timebase.ppq() as usize;
|
||||
let ppq = app.transport.ppq();
|
||||
let mut name = app.new_track_name();
|
||||
let mut _gain = 0.0f64;
|
||||
let mut devices: Vec<JackDevice> = vec![];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue