/// A [MIDI source](https://developer.apple.com/reference/coremidi/midiendpointref)owned by an entity. /// /// A source can be created from an index like this: /// /// ```rust,no_run /// let source = coremidi::Destination::from_index(0).unwrap(); /// println!("The source at index 0 has display name '{}'", source.display_name().unwrap()); /// ``` /// #[derive(Debug)] pubstruct Destination { pub(crate) endpoint: Endpoint,
}
impl Destination { /// Create a destination endpoint from its index. /// See [MIDIGetDestination](https://developer.apple.com/reference/coremidi/1495108-midigetdestination) /// pubfn from_index(index: usize) -> Option<Destination> { let endpoint_ref = unsafe { MIDIGetDestination(index as ItemCount) }; match endpoint_ref { 0 => None,
_ => Some(Destination {
endpoint: Endpoint {
object: Object(endpoint_ref),
},
}),
}
}
}
impl Deref for Destination { type Target = Endpoint;
fn deref(&self) -> &Endpoint {
&self.endpoint
}
}
/// Destination endpoints available in the system. /// /// The number of destinations available in the system can be retrieved with: /// /// ``` /// let number_of_destinations = coremidi::Destinations::count(); /// ``` /// /// The destinations in the system can be iterated as: /// /// ```rust,no_run /// for destination in coremidi::Destinations { /// println!("{}", destination.display_name().unwrap()); /// } /// ``` /// pubstruct Destinations;
/// A [MIDI virtual destination](https://developer.apple.com/reference/coremidi/1495347-mididestinationcreate) owned by a client. /// /// A virtual destination can be created like: /// /// ```rust,no_run /// let client = coremidi::Client::new("example-client").unwrap(); /// client.virtual_destination("example-destination", |packet_list| println!("{}", packet_list)).unwrap(); /// ``` /// #[derive(Debug)] pubstruct VirtualDestination { // Note: the order is important here, endpoint needs to be dropped first pub(crate) endpoint: Endpoint, pub(crate) callback: BoxedCallback<PacketList>,
}
impl VirtualDestination {}
impl Deref for VirtualDestination { type Target = Endpoint;
fn deref(&self) -> &Endpoint {
&self.endpoint
}
}
impl Drop for VirtualDestination { fn drop(&mutself) { unsafe { MIDIEndpointDispose(self.endpoint.object.0) };
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-06-19)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.