mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-08-07 22:17:07 +02:00
drawing and singing fixes
This commit is contained in:
parent
e0781571c4
commit
0273d2ac75
7 changed files with 244 additions and 195 deletions
22
src/sing/jack_perf.rs
Normal file
22
src/sing/jack_perf.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
use crate::{*, time::PerfModel};
|
||||
pub use ::jack::{*, contrib::{*, ClosureProcessHandler}};
|
||||
|
||||
pub trait JackPerfModel {
|
||||
fn update_from_jack_scope (&self, t0: Option<u64>, scope: &ProcessScope);
|
||||
}
|
||||
|
||||
impl JackPerfModel for PerfModel {
|
||||
fn update_from_jack_scope (&self, t0: Option<u64>, scope: &ProcessScope) {
|
||||
if let Some(t0) = t0 {
|
||||
let t1 = self.clock.raw();
|
||||
self.used.store(
|
||||
self.clock.delta_as_nanos(t0, t1) as f64,
|
||||
Relaxed,
|
||||
);
|
||||
self.window.store(
|
||||
scope.cycle_times().unwrap().period_usecs as f64,
|
||||
Relaxed,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue