mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
rewrite jack init
This commit is contained in:
parent
6c8f85ab84
commit
b2c9bfc0e2
19 changed files with 448 additions and 679 deletions
|
|
@ -81,11 +81,10 @@ pub struct Clock {
|
|||
/// Size of buffer in samples
|
||||
pub chunk: Arc<AtomicUsize>,
|
||||
}
|
||||
impl From<&JackClient> for Clock {
|
||||
fn from (jack: &JackClient) -> Self {
|
||||
let chunk = jack.inner().buffer_size();
|
||||
let transport = jack.inner().transport();
|
||||
let timebase = Arc::new(Timebase::default());
|
||||
impl From<&Jack> for Clock {
|
||||
fn from (jack: &Jack) -> Self {
|
||||
let (chunk, transport) = jack.with_client(|c|(c.buffer_size(), c.transport()));
|
||||
let timebase = Arc::new(Timebase::default());
|
||||
Self {
|
||||
quant: Arc::new(24.into()),
|
||||
sync: Arc::new(384.into()),
|
||||
|
|
@ -113,7 +112,7 @@ impl std::fmt::Debug for Clock {
|
|||
}
|
||||
}
|
||||
impl Clock {
|
||||
pub fn new (jack: &JackClient, bpm: Option<f64>) -> Self {
|
||||
pub fn new (jack: &Jack, bpm: Option<f64>) -> Self {
|
||||
let clock = Self::from(jack);
|
||||
if let Some(bpm) = bpm {
|
||||
clock.timebase.bpm.set(bpm);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue