Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/client/client_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ impl Client {
}
}

/// Set the maximum length of time that a client can hold transport start as it gets ready.
pub fn set_sync_timeout(&self, timeout:std::time::Duration) -> Result<(), Error> {
let timeout = timeout.as_micros() as u64;
let res = unsafe { j::jack_set_sync_timeout(self.raw(), timeout) };
match res {
0 => Ok(()),
_ => Err(Error::SetSyncTimeoutError),
}
}

/// Get the numeric `uuid` of this client.
///
/// # Remarks
Expand Down
2 changes: 2 additions & 0 deletions src/jack_enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::ClientStatus;

/// An error that can occur in JACK.
#[derive(Clone, Debug, Eq, PartialEq)]
#[non_exhaustive]
pub enum Error {
CallbackDeregistrationError,
CallbackRegistrationError,
Expand All @@ -23,6 +24,7 @@ pub enum Error {
WeakFunctionNotFound(&'static str),
ClientIsNoLongerAlive,
RingbufferCreateFailed,
SetSyncTimeoutError,
UnknownError,
}

Expand Down