wrap JackClient in Arc

This commit is contained in:
🪞👃🪞 2024-10-27 02:33:15 +03:00
parent b9cf6b8008
commit 5a325666fd
4 changed files with 4 additions and 4 deletions

View file

@ -50,7 +50,7 @@ impl ArrangerCli {
|state: &Arc<RwLock<TransportToolbar<Tui>>>, client, scope| { |state: &Arc<RwLock<TransportToolbar<Tui>>>, client, scope| {
state.write().unwrap().process(client, scope) state.write().unwrap().process(client, scope)
} }
)? )?.into()
); );
Tui::run(Arc::new(RwLock::new(Arranger::new( Tui::run(Arc::new(RwLock::new(Arranger::new(
self.transport.then_some(transport), self.transport.then_some(transport),

View file

@ -27,7 +27,7 @@ impl SequencerCli {
|state: &Arc<RwLock<TransportToolbar<Tui>>>, client, scope| { |state: &Arc<RwLock<TransportToolbar<Tui>>>, client, scope| {
state.write().unwrap().process(client, scope) state.write().unwrap().process(client, scope)
} }
)? )?.into()
); );
let focus_cursor = (1, 1); let focus_cursor = (1, 1);
let clock = transport.read().unwrap().clock.clone(); let clock = transport.read().unwrap().clock.clone();

View file

@ -24,7 +24,7 @@ pub struct TransportToolbar<E: Engine> {
/// Enable metronome? /// Enable metronome?
pub metronome: bool, pub metronome: bool,
/// JACK client handle (needs to not be dropped for standalone mode to work). /// JACK client handle (needs to not be dropped for standalone mode to work).
pub jack: Option<JackClient>, pub jack: Option<Arc<JackClient>>,
/// JACK transport handle. /// JACK transport handle.
pub transport: Option<Transport>, pub transport: Option<Transport>,
/// Global sample and usec at which playback started /// Global sample and usec at which playback started

View file

@ -13,7 +13,7 @@ pub fn main () -> Usually<()> {
|state: &Arc<RwLock<TransportToolbar<Tui>>>, client, scope| { |state: &Arc<RwLock<TransportToolbar<Tui>>>, client, scope| {
state.write().unwrap().process(client, scope) state.write().unwrap().process(client, scope)
} }
)? )?.into()
); );
Tui::run(transport)?; Tui::run(transport)?;
Ok(()) Ok(())