diff --git a/src/client/client_impl.rs b/src/client/client_impl.rs index 17482563..e9f26a40 100644 --- a/src/client/client_impl.rs +++ b/src/client/client_impl.rs @@ -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 diff --git a/src/jack_enums.rs b/src/jack_enums.rs index b4e33c1d..d6b81229 100644 --- a/src/jack_enums.rs +++ b/src/jack_enums.rs @@ -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, @@ -23,6 +24,7 @@ pub enum Error { WeakFunctionNotFound(&'static str), ClientIsNoLongerAlive, RingbufferCreateFailed, + SetSyncTimeoutError, UnknownError, }