pub struct Client { /* private fields */ }io only.Expand description
MIDI client for sending and receiving MIDI messages
Implementations§
Source§impl Client
impl Client
Sourcepub async fn new(name: &str) -> Result<Self, Error>
pub async fn new(name: &str) -> Result<Self, Error>
Create a new midi client.
On macOS and iOS, CoreMIDI permanently routes hotplug notifications to
whichever thread created the first MIDI client in the process. Create this
client before anything else in the process uses CoreMIDI, or
source_changes and
destination_changes may never receive events.
Sourcepub async fn sources(&self) -> Result<Vec<Source>, Error>
pub async fn sources(&self) -> Result<Vec<Source>, Error>
Enumerate the available sources from the platform.
Sourcepub async fn destinations(&self) -> Result<Vec<Destination>, Error>
pub async fn destinations(&self) -> Result<Vec<Destination>, Error>
Enumerate the available destinations from the platform.
Sourcepub fn source_changes(&self) -> SourceChanges
pub fn source_changes(&self) -> SourceChanges
Subscribe to a stream of source change events.
Sourcepub fn destination_changes(&self) -> DestinationChanges
pub fn destination_changes(&self) -> DestinationChanges
Subscribe to a stream of destination change events.
Sourcepub async fn connect_source(
&self,
port: &Source,
) -> Result<SourceConnection, Error>
pub async fn connect_source( &self, port: &Source, ) -> Result<SourceConnection, Error>
Connect to a known source. Use the sources method to query currently available sources.
Sourcepub async fn connect_destination(
&self,
port: &Destination,
) -> Result<DestinationConnection, Error>
pub async fn connect_destination( &self, port: &Destination, ) -> Result<DestinationConnection, Error>
Connect to a known destination. Use the destinations method to query currently available destinations.
Sourcepub async fn create_virtual_source(
&self,
name: &str,
) -> Result<VirtualSource, Error>
pub async fn create_virtual_source( &self, name: &str, ) -> Result<VirtualSource, Error>
Creates a virtual source that can be used to send midi to destinations
Sourcepub async fn create_virtual_destination(
&self,
name: &str,
) -> Result<VirtualDestination, Error>
pub async fn create_virtual_destination( &self, name: &str, ) -> Result<VirtualDestination, Error>
Creates a virtual destination that can be used to receive midi from sources