1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-foundation")]
use objc2_foundation::*;
use crate::*;
#[cfg(feature = "objc2")]
extern_class!(
/// An NSObject containing basic information about a MIDI 2.0 device. Used by
/// MIDIUMPEndpointPair and MIDICIDevice.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midi2deviceinfo?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2")]
pub struct MIDI2DeviceInfo;
);
#[cfg(feature = "objc2")]
extern_conformance!(
unsafe impl NSObjectProtocol for MIDI2DeviceInfo {}
);
#[cfg(feature = "objc2")]
impl MIDI2DeviceInfo {
extern_methods!(
#[cfg(feature = "MIDIUMPCI")]
/// The MIDI System Exclusive ID of the device manufacturer, up to 3-Bytes.
///
/// One-byte SysEx IDs use only the least significant byte (e.g., Apple's System Exclusive ID, 0x11).
#[unsafe(method(manufacturerID))]
#[unsafe(method_family = none)]
pub unsafe fn manufacturerID(&self) -> MIDI2DeviceManufacturer;
#[cfg(feature = "MIDIMessages")]
/// The family of models to which the device belongs, up to 14 bits.
#[unsafe(method(family))]
#[unsafe(method_family = none)]
pub unsafe fn family(&self) -> MIDIUInteger14;
#[cfg(feature = "MIDIMessages")]
/// The specific model from the device manufacturer, up to 14 bits.
#[unsafe(method(modelNumber))]
#[unsafe(method_family = none)]
pub unsafe fn modelNumber(&self) -> MIDIUInteger14;
#[cfg(feature = "MIDIUMPCI")]
/// The version number of a device model number.
#[unsafe(method(revisionLevel))]
#[unsafe(method_family = none)]
pub unsafe fn revisionLevel(&self) -> MIDI2DeviceRevisionLevel;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(all(feature = "MIDIMessages", feature = "MIDIUMPCI"))]
/// The initializer for constructing the MIDI2DeviceInfo object.
///
///
/// Parameter `manufacturerID`: The 3-Byte manufacturer System Exclusive ID.
///
/// Parameter `family`: The 14-bit device family.
///
/// Parameter `modelNumber`: The 14-bit model number.
///
/// Parameter `revisionLevel`: The 4-Byte revision level.
///
///
/// Provided values for family or modelNumber must be within their expected
/// bit range. For example, if modelNumber is outside of the range of a 14-bit number.
#[unsafe(method(initWithManufacturerID:family:modelNumber:revisionLevel:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithManufacturerID_family_modelNumber_revisionLevel(
this: Allocated<Self>,
manufacturer_id: MIDI2DeviceManufacturer,
family: MIDIUInteger14,
model_number: MIDIUInteger14,
revision_level: MIDI2DeviceRevisionLevel,
) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(feature = "objc2")]
impl MIDI2DeviceInfo {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
/// The UMP protocols that can be supported by a UMP endpoint.
///
///
/// Support for MIDI 1.0 in Universal Packets, or MIDI-1UP.
///
///
/// Support for MIDI 2.0 protocol.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiumpprotocoloptions?language=objc)
// NS_OPTIONS
#[cfg(feature = "MIDIMessages")]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MIDIUMPProtocolOptions(pub MIDIUInteger4);
#[cfg(feature = "MIDIMessages")]
bitflags::bitflags! {
impl MIDIUMPProtocolOptions: MIDIUInteger4 {
#[doc(alias = "kMIDIUMPProtocolOptionsMIDI1")]
const MIDI1 = 1;
#[doc(alias = "kMIDIUMPProtocolOptionsMIDI2")]
const MIDI2 = 1<<1;
}
}
#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
unsafe impl Encode for MIDIUMPProtocolOptions {
const ENCODING: Encoding = MIDIUInteger4::ENCODING;
}
#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
unsafe impl RefEncode for MIDIUMPProtocolOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(feature = "objc2")]
extern_class!(
/// An object representating a UMP Endpoint.
///
///
/// MIDIUMPEndpoint encapsulates a MIDI source and MIDI destination as a
/// bidirectional MIDI 2.0 communication node along with any associated stream
/// configuration metadata.
///
/// It is not necessary to create a MIDIUMPEndpoint or other MIDI endpoint in order to
/// use UMP natively. Any standard MIDI endpoint created with a specified MIDIProtocolID
/// is assumed to use all 16 UMP groups for the same unspecified function and to neither
/// transmit nor receive jitter-reduction timestamps.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiumpendpoint?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2")]
pub struct MIDIUMPEndpoint;
);
#[cfg(feature = "objc2")]
extern_conformance!(
unsafe impl NSObjectProtocol for MIDIUMPEndpoint {}
);
#[cfg(feature = "objc2")]
impl MIDIUMPEndpoint {
extern_methods!(
#[cfg(feature = "objc2-foundation")]
/// The UTF-8 encoded name of the UMP endpoint.
///
///
/// The name shall not be any longer than 98 bytes of UTF-8 Text.
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub unsafe fn name(&self) -> Retained<NSString>;
#[cfg(feature = "MIDIServices")]
/// The MIDI protocol currently used by the UMP endpoint.
#[unsafe(method(MIDIProtocol))]
#[unsafe(method_family = none)]
pub unsafe fn MIDIProtocol(&self) -> MIDIProtocolID;
#[cfg(feature = "MIDIMessages")]
/// All protocols the UMP endpoint is capable of using for communication.
#[unsafe(method(supportedMIDIProtocols))]
#[unsafe(method_family = none)]
pub unsafe fn supportedMIDIProtocols(&self) -> MIDIUMPProtocolOptions;
#[cfg(feature = "MIDIServices")]
/// The MIDI destination for the UMP endpoint.
#[unsafe(method(MIDIDestination))]
#[unsafe(method_family = none)]
pub unsafe fn MIDIDestination(&self) -> MIDIEndpointRef;
#[cfg(feature = "MIDIServices")]
/// The MIDI source for the UMP endpoint.
#[unsafe(method(MIDISource))]
#[unsafe(method_family = none)]
pub unsafe fn MIDISource(&self) -> MIDIEndpointRef;
/// The MIDI 2.0 Device identity information associated with the device.
#[unsafe(method(deviceInfo))]
#[unsafe(method_family = none)]
pub unsafe fn deviceInfo(&self) -> Retained<MIDI2DeviceInfo>;
#[cfg(feature = "objc2-foundation")]
/// Serial number (or similar value) uniquely identifying this manufacturer/family/model,
/// up to 42 bytes of ASCII Text in the ordinal range 32-126.
#[unsafe(method(productInstanceID))]
#[unsafe(method_family = none)]
pub unsafe fn productInstanceID(&self) -> Retained<NSString>;
/// Indicates if the Function Block state will never change once discovered.
#[unsafe(method(hasStaticFunctionBlocks))]
#[unsafe(method_family = none)]
pub unsafe fn hasStaticFunctionBlocks(&self) -> bool;
/// Jitter-reduction timestamp receive capability.
#[unsafe(method(hasJRTSReceiveCapability))]
#[unsafe(method_family = none)]
pub unsafe fn hasJRTSReceiveCapability(&self) -> bool;
/// Jitter-reduction timestamp transmit capability
#[unsafe(method(hasJRTSTransmitCapability))]
#[unsafe(method_family = none)]
pub unsafe fn hasJRTSTransmitCapability(&self) -> bool;
#[cfg(feature = "MIDIUMPCI")]
/// Indicates the type of UMP Endpoint, if known.
#[unsafe(method(endpointType))]
#[unsafe(method_family = none)]
pub unsafe fn endpointType(&self) -> MIDIUMPCIObjectBackingType;
#[cfg(all(feature = "MIDIUMPFunctionBlock", feature = "objc2-foundation"))]
/// The Function Blocks associated with the UMP endpoint, if any.
#[unsafe(method(functionBlocks))]
#[unsafe(method_family = none)]
pub unsafe fn functionBlocks(&self) -> Retained<NSArray<MIDIUMPFunctionBlock>>;
#[cfg(all(feature = "MIDIUMPFunctionBlock", feature = "objc2-foundation"))]
/// Setter for [`functionBlocks`][Self::functionBlocks].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setFunctionBlocks:))]
#[unsafe(method_family = none)]
pub unsafe fn setFunctionBlocks(&self, function_blocks: &NSArray<MIDIUMPFunctionBlock>);
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(feature = "objc2")]
impl MIDIUMPEndpoint {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}