objc2_core_midi/generated/
MIDIUMPEndpointManager.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4#[cfg(feature = "objc2")]
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-foundation")]
7use objc2_foundation::*;
8
9use crate::*;
10
11extern "C" {
12    /// A notification posted when a MIDI UMP Endpoint has been added to the subsystem.
13    ///
14    ///
15    /// The MIDIUMPEndpoint sent in userInfo is the endpoint which was recently discovered.
16    ///
17    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiumpendpointwasaddednotification?language=objc)
18    #[cfg(feature = "objc2-foundation")]
19    pub static MIDIUMPEndpointWasAddedNotification: &'static NSNotificationName;
20}
21
22extern "C" {
23    /// A notification posted when a MIDI UMP Endpoint has been removed from the subsystem.
24    ///
25    ///
26    /// Any MIDIUMPEndpoint sent with this notification is no longer available to the system. Any
27    /// attempt to perform I/O with its source or destination may fail, as the MIDIEndpointRef
28    /// associated with the UMP endpoint may no longer be valid. If this notification is posted,
29    /// any resources related to communication with this UMP endpoint may be safely
30    /// disposed.
31    ///
32    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiumpendpointwasremovednotification?language=objc)
33    #[cfg(feature = "objc2-foundation")]
34    pub static MIDIUMPEndpointWasRemovedNotification: &'static NSNotificationName;
35}
36
37extern "C" {
38    /// A notification posted when an UMP endpoint updates its stream configuration or changes the
39    /// state of one of its Function Blocks.
40    ///
41    ///
42    /// If this notification is posted, an Endpoint Info Notification was sent from the UMP endpoint in userInfo.
43    ///
44    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiumpendpointwasupdatednotification?language=objc)
45    #[cfg(feature = "objc2-foundation")]
46    pub static MIDIUMPEndpointWasUpdatedNotification: &'static NSNotificationName;
47}
48
49extern "C" {
50    /// A notification posted when a Function Block is updated.
51    ///
52    ///
53    /// If this notification is posted, the supplied Function Block in userInfo has had a change to its
54    /// enabled state, Group configuration, UI hint, MIDI 1.0 status, etc..
55    ///
56    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiumpfunctionblockwasupdatednotification?language=objc)
57    #[cfg(feature = "objc2-foundation")]
58    pub static MIDIUMPFunctionBlockWasUpdatedNotification: &'static NSNotificationName;
59}
60
61/// [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiumpendpointmanagerdictionarykey?language=objc)
62// NS_TYPED_ENUM
63#[cfg(feature = "objc2-foundation")]
64pub type MIDIUMPEndpointManagerDictionaryKey = NSString;
65
66extern "C" {
67    /// Value is a MIDIUMPEndpoint
68    ///
69    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiumpendpointobjectkey?language=objc)
70    #[cfg(feature = "objc2-foundation")]
71    pub static MIDIUMPEndpointObjectKey: &'static MIDIUMPEndpointManagerDictionaryKey;
72}
73
74extern "C" {
75    /// Value is a MIDIUMPFunctionBlock
76    ///
77    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiumpfunctionblockobjectkey?language=objc)
78    #[cfg(feature = "objc2-foundation")]
79    pub static MIDIUMPFunctionBlockObjectKey: &'static MIDIUMPEndpointManagerDictionaryKey;
80}
81
82#[cfg(feature = "objc2")]
83extern_class!(
84    /// A singleton object that performs system-wide UMP Endpoint bookkeeping.
85    ///
86    ///
87    /// MIDIUMPEndpointManager is used to retrieve information about UMP Endpoint
88    /// pairs detected by or explicitly declared to the MIDI UMP subsystem.
89    ///
90    /// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiumpendpointmanager?language=objc)
91    #[unsafe(super(NSObject))]
92    #[derive(Debug, PartialEq, Eq, Hash)]
93    #[cfg(feature = "objc2")]
94    pub struct MIDIUMPEndpointManager;
95);
96
97#[cfg(feature = "objc2")]
98extern_conformance!(
99    unsafe impl NSObjectProtocol for MIDIUMPEndpointManager {}
100);
101
102#[cfg(feature = "objc2")]
103impl MIDIUMPEndpointManager {
104    extern_methods!(
105        /// Retrieve the shared UMP Endpoint manager for the client process.
106        ///
107        ///
108        /// After first access to this property, the client process may begin observing notifications
109        /// which are posted when the system-wide cache changes.
110        #[unsafe(method(sharedInstance))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn sharedInstance() -> Retained<MIDIUMPEndpointManager>;
113
114        #[cfg(all(feature = "MIDIUMPEndpoint", feature = "objc2-foundation"))]
115        /// A  list of UMP endpoints discovered using UMP endpoint discovery.
116        #[unsafe(method(UMPEndpoints))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn UMPEndpoints(&self) -> Retained<NSArray<MIDIUMPEndpoint>>;
119    );
120}
121
122/// Methods declared on superclass `NSObject`.
123#[cfg(feature = "objc2")]
124impl MIDIUMPEndpointManager {
125    extern_methods!(
126        #[unsafe(method(init))]
127        #[unsafe(method_family = init)]
128        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
129
130        #[unsafe(method(new))]
131        #[unsafe(method_family = new)]
132        pub unsafe fn new() -> Retained<Self>;
133    );
134}