1 use libc;
2 
3 use client::client_status::ClientStatus;
4 
5 /// An error that can occur in JACK.
6 #[derive(Clone, Debug, Eq, PartialEq)]
7 pub enum JackErr {
8     CallbackDeregistrationError,
9     CallbackRegistrationError,
10     ClientActivationError,
11     ClientDeactivationError,
12     ClientError(ClientStatus),
13     FreewheelError,
14     InvalidDeactivation,
15     NotEnoughSpace,
16     PortAliasError,
17     PortAlreadyConnected(String, String),
18     PortConnectionError(String, String),
19     PortDisconnectionError,
20     PortMonitorError,
21     PortNamingError,
22     PortRegistrationError(String),
23     SetBufferSizeError,
24     TimeError,
25     WeakFunctionNotFound,
26     UnknownError,
27 }
28 
29 /// Used by `NotificationHandler::latency()`.
30 #[derive(Clone, Copy, Debug)]
31 pub enum LatencyType {
32     Capture,
33     Playback,
34 }
35 
36 /// Specify an option, either to continue processing, or to stop.
37 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
38 pub enum JackControl {
39     /// Continue processing.
40     Continue,
41 
42     /// Stop processing.
43     Quit,
44 }
45 
46 impl JackControl {
to_ffi(self) -> libc::c_int47     pub fn to_ffi(self) -> libc::c_int {
48         match self {
49             JackControl::Continue => 0,
50             JackControl::Quit => -1,
51         }
52     }
53 }
54 
55 impl Default for JackControl {
default() -> Self56     fn default() -> Self {
57         JackControl::Continue
58     }
59 }
60