Struct coremidi::Client [−][src]
pub struct Client { /* fields omitted */ }
Expand description
A MIDI client.
An object maintaining per-client state.
A simple example to create a Client:
let client = coremidi::Client::new("example-client").unwrap();
Implementations
pub fn new_with_notifications<F>(
name: &str,
callback: F
) -> Result<Client, OSStatus> where
F: Into<NotifyCallback>,
pub fn new_with_notifications<F>(
name: &str,
callback: F
) -> Result<Client, OSStatus> where
F: Into<NotifyCallback>,
Creates a new CoreMIDI client with support for notifications. See MIDIClientCreateWithBlock.
The notification callback will be called on the run loop that was current when this associated function is called.
It follows that this particular run loop needs to be running in order to actually receive notifications. The run loop can be started after the client has been created if need be. Please see the examples to know how.
Creates a new CoreMIDI client. See MIDIClientCreate.
Creates an output port through which the client may send outgoing MIDI messages to any MIDI destination. See MIDIOutputPortCreate.
pub fn input_port<F>(
&self,
name: &str,
callback: F
) -> Result<InputPort, OSStatus> where
F: FnMut(&PacketList) + Send + 'static,
pub fn input_port<F>(
&self,
name: &str,
callback: F
) -> Result<InputPort, OSStatus> where
F: FnMut(&PacketList) + Send + 'static,
Creates an input port through which the client may receive incoming MIDI 1.0 messages from any MIDI source. See MIDIInputPortCreate.
MIDIInputPortCreate is deprecated in CoreMIDI. Please consider using input_port_with_protocol
instead
Creates an input port through which the client may receive incoming MIDI messages from any MIDI source. It allows to choose which MIDI Protocol to use. See MIDIInputPortCreateWithProtocol.
Creates a virtual source in the client. See MIDISourceCreate.
pub fn virtual_destination<F>(
&self,
name: &str,
callback: F
) -> Result<VirtualDestination, OSStatus> where
F: FnMut(&PacketList) + Send + 'static,
pub fn virtual_destination<F>(
&self,
name: &str,
callback: F
) -> Result<VirtualDestination, OSStatus> where
F: FnMut(&PacketList) + Send + 'static,
Creates a virtual destination in the client. See MIDIDestinationCreate.
MIDIDestinationCreate is deprecated in CoreMIDI. Please consider using virtual_destination_with_protocol
instead
pub fn virtual_destination_with_protocol<F>(
&self,
name: &str,
protocol: Protocol,
callback: F
) -> Result<VirtualDestination, OSStatus> where
F: FnMut(&EventList) + Send + 'static,
pub fn virtual_destination_with_protocol<F>(
&self,
name: &str,
protocol: Protocol,
callback: F
) -> Result<VirtualDestination, OSStatus> where
F: FnMut(&EventList) + Send + 'static,
Creates a virtual destination in the client. It allows to choose which MIDI Protocol to use. See MIDIDestinationCreate.
Methods from Deref<Target = Object>
Get the display name for the object.
Sets an object’s string-type property.
Gets an object’s string-type property.
Sets an object’s integer-type property.
Gets an object’s integer-type property.
Sets an object’s boolean-type property.
CoreMIDI treats booleans as integers (0/1) but this API uses native bool types
Gets an object’s boolean-type property.
CoreMIDI treats booleans as integers (0/1) but this API uses native bool types