mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
refactor jack ports again
This commit is contained in:
parent
c13eff95ca
commit
6c8f85ab84
16 changed files with 558 additions and 609 deletions
|
|
@ -81,11 +81,10 @@ pub struct Clock {
|
|||
/// Size of buffer in samples
|
||||
pub chunk: Arc<AtomicUsize>,
|
||||
}
|
||||
impl From<&Arc<RwLock<JackConnection>>> for Clock {
|
||||
fn from (jack: &Arc<RwLock<JackConnection>>) -> Self {
|
||||
let jack = jack.read().unwrap();
|
||||
let chunk = jack.client().buffer_size();
|
||||
let transport = jack.client().transport();
|
||||
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());
|
||||
Self {
|
||||
quant: Arc::new(24.into()),
|
||||
|
|
@ -114,7 +113,7 @@ impl std::fmt::Debug for Clock {
|
|||
}
|
||||
}
|
||||
impl Clock {
|
||||
pub fn new (jack: &Arc<RwLock<JackConnection>>, bpm: Option<f64>) -> Self {
|
||||
pub fn new (jack: &JackClient, 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