objc2_core_midi/generated/
MIDIUMPCI.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3#[cfg(feature = "objc2")]
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8/// [Apple's documentation](https://developer.apple.com/documentation/coremidi/midi2devicemanufacturer?language=objc)
9#[repr(C)]
10#[derive(Clone, Copy, Debug, PartialEq)]
11pub struct MIDI2DeviceManufacturer {
12    pub sysExIDByte: [Byte; 3],
13}
14
15#[cfg(feature = "objc2")]
16unsafe impl Encode for MIDI2DeviceManufacturer {
17    const ENCODING: Encoding = Encoding::Struct("?", &[<[Byte; 3]>::ENCODING]);
18}
19
20#[cfg(feature = "objc2")]
21unsafe impl RefEncode for MIDI2DeviceManufacturer {
22    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
23}
24
25/// [Apple's documentation](https://developer.apple.com/documentation/coremidi/midi2devicerevisionlevel?language=objc)
26#[repr(C)]
27#[derive(Clone, Copy, Debug, PartialEq)]
28pub struct MIDI2DeviceRevisionLevel {
29    pub revisionLevel: [Byte; 4],
30}
31
32#[cfg(feature = "objc2")]
33unsafe impl Encode for MIDI2DeviceRevisionLevel {
34    const ENCODING: Encoding = Encoding::Struct("?", &[<[Byte; 4]>::ENCODING]);
35}
36
37#[cfg(feature = "objc2")]
38unsafe impl RefEncode for MIDI2DeviceRevisionLevel {
39    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
40}
41
42/// MIDI Capability category supported (bitmap: D6 D5 D4 D3 D2 D1 D0)
43/// Bit    Category    Sub-ID Range    Description
44/// D0            0x00~0x0F    Reserved - No Messages Defined Yet
45/// D1            0x10~0x1F    Protocol Negotiation (Deprecated)
46/// D2            0x20~0x2F    Profile Configuration Supported
47/// D3            0x30~0x3F    Property Exchange Supported
48/// D4            0x40~0x4F    Process Inquiry Supported
49/// D5            0x50~0x5F    Reserved - No Messages Defined Yet
50/// D6            0x60~0x6F    Reserved - No Messages Defined Yet
51///
52/// e.g., a MIDICIDevice supporting Profile Configuration and Property Exchange has
53/// category 0xC.
54///
55/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midicicategoryoptions?language=objc)
56// NS_OPTIONS
57#[cfg(feature = "MIDIMessages")]
58#[repr(transparent)]
59#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
60pub struct MIDICICategoryOptions(pub MIDIUInteger7);
61#[cfg(feature = "MIDIMessages")]
62bitflags::bitflags! {
63    impl MIDICICategoryOptions: MIDIUInteger7 {
64        #[doc(alias = "kMIDICICategoryOptionsProtocolNegotiation")]
65        const ProtocolNegotiation = 1<<1;
66        #[doc(alias = "kMIDICICategoryOptionsProfileConfigurationSupported")]
67        const ProfileConfigurationSupported = 1<<2;
68        #[doc(alias = "kMIDICICategoryOptionsPropertyExchangeSupported")]
69        const PropertyExchangeSupported = 1<<3;
70        #[doc(alias = "kMIDICICategoryOptionsProcessInquirySupported")]
71        const ProcessInquirySupported = 1<<4;
72    }
73}
74
75#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
76unsafe impl Encode for MIDICICategoryOptions {
77    const ENCODING: Encoding = MIDIUInteger7::ENCODING;
78}
79
80#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
81unsafe impl RefEncode for MIDICICategoryOptions {
82    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
83}
84
85/// The device-unique Function Block ID.
86///
87/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiumpfunctionblockid?language=objc)
88#[cfg(feature = "MIDIMessages")]
89pub type MIDIUMPFunctionBlockID = MIDIUInteger7;
90
91/// [Apple's documentation](https://developer.apple.com/documentation/coremidi/midicidevicetype?language=objc)
92// NS_ENUM
93#[repr(transparent)]
94#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
95pub struct MIDICIDeviceType(pub u8);
96impl MIDICIDeviceType {
97    #[doc(alias = "kMIDICIDeviceTypeUnknown")]
98    pub const Unknown: Self = Self(0);
99    #[doc(alias = "kMIDICIDeviceTypeLegacyMIDI1")]
100    pub const LegacyMIDI1: Self = Self(1);
101    #[doc(alias = "kMIDICIDeviceTypeVirtual")]
102    pub const Virtual: Self = Self(2);
103    #[doc(alias = "kMIDICIDeviceTypeUSBMIDI")]
104    pub const USBMIDI: Self = Self(3);
105}
106
107#[cfg(feature = "objc2")]
108unsafe impl Encode for MIDICIDeviceType {
109    const ENCODING: Encoding = u8::ENCODING;
110}
111
112#[cfg(feature = "objc2")]
113unsafe impl RefEncode for MIDICIDeviceType {
114    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
115}
116
117/// MIDI-CI Profile message sub-ID values.
118///
119/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiciprofilemessagetype?language=objc)
120// NS_ENUM
121#[cfg(feature = "MIDIMessages")]
122#[repr(transparent)]
123#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
124pub struct MIDICIProfileMessageType(pub MIDIUInteger7);
125#[cfg(feature = "MIDIMessages")]
126impl MIDICIProfileMessageType {
127    #[doc(alias = "kMIDICIProfileMessageTypeProfileInquiry")]
128    pub const ProfileInquiry: Self = Self(0x20);
129    #[doc(alias = "kMIDICIProfileMessageTypeReplyToProfileInquiry")]
130    pub const ReplyToProfileInquiry: Self = Self(0x21);
131    #[doc(alias = "kMIDICIProfileMessageTypeSetProfileOn")]
132    pub const SetProfileOn: Self = Self(0x22);
133    #[doc(alias = "kMIDICIProfileMessageTypeSetProfileOff")]
134    pub const SetProfileOff: Self = Self(0x23);
135    #[doc(alias = "kMIDICIProfileMessageTypeProfileEnabledReport")]
136    pub const ProfileEnabledReport: Self = Self(0x24);
137    #[doc(alias = "kMIDICIProfileMessageTypeProfileDisabledReport")]
138    pub const ProfileDisabledReport: Self = Self(0x25);
139    #[doc(alias = "kMIDICIProfileMessageTypeProfileAdded")]
140    pub const ProfileAdded: Self = Self(0x26);
141    #[doc(alias = "kMIDICIProfileMessageTypeProfileRemoved")]
142    pub const ProfileRemoved: Self = Self(0x27);
143    #[doc(alias = "kMIDICIProfileMessageTypeDetailsInquiry")]
144    pub const DetailsInquiry: Self = Self(0x28);
145    #[doc(alias = "kMIDICIProfileMessageTypeReplyToDetailsInquiry")]
146    pub const ReplyToDetailsInquiry: Self = Self(0x29);
147    #[doc(alias = "kMIDICIProfileMessageTypeProfileSpecificData")]
148    pub const ProfileSpecificData: Self = Self(0x2F);
149}
150
151#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
152unsafe impl Encode for MIDICIProfileMessageType {
153    const ENCODING: Encoding = MIDIUInteger7::ENCODING;
154}
155
156#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
157unsafe impl RefEncode for MIDICIProfileMessageType {
158    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
159}
160
161/// MIDI-CI Property Exchange Message sub-ID values.
162///
163/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midicipropertyexchangemessagetype?language=objc)
164// NS_ENUM
165#[cfg(feature = "MIDIMessages")]
166#[repr(transparent)]
167#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
168pub struct MIDICIPropertyExchangeMessageType(pub MIDIUInteger7);
169#[cfg(feature = "MIDIMessages")]
170impl MIDICIPropertyExchangeMessageType {
171    #[doc(alias = "kMIDICIPropertyExchangeMessageTypeInquiryPropertyExchangeCapabilities")]
172    pub const InquiryPropertyExchangeCapabilities: Self = Self(0x30);
173    #[doc(alias = "kMIDICIPropertyExchangeMessageTypeReplyToPropertyExchangeCapabilities")]
174    pub const ReplyToPropertyExchangeCapabilities: Self = Self(0x31);
175    #[doc(alias = "kMIDICIPropertyExchangeMessageTypeInquiryHasPropertyData_Reserved")]
176    pub const InquiryHasPropertyData_Reserved: Self = Self(0x32);
177    #[doc(alias = "kMIDICIPropertyExchangeMessageTypeInquiryReplyToHasPropertyData_Reserved")]
178    pub const InquiryReplyToHasPropertyData_Reserved: Self = Self(0x33);
179    #[doc(alias = "kMIDICIPropertyExchangeMessageTypeInquiryGetPropertyData")]
180    pub const InquiryGetPropertyData: Self = Self(0x34);
181    #[doc(alias = "kMIDICIPropertyExchangeMessageTypeReplyToGetProperty")]
182    pub const ReplyToGetProperty: Self = Self(0x35);
183    #[doc(alias = "kMIDICIPropertyExchangeMessageTypeInquirySetPropertyData")]
184    pub const InquirySetPropertyData: Self = Self(0x36);
185    #[doc(alias = "kMIDICIPropertyExchangeMessageTypeReplyToSetPropertyData")]
186    pub const ReplyToSetPropertyData: Self = Self(0x37);
187    #[doc(alias = "kMIDICIPropertyExchangeMessageTypeSubscription")]
188    pub const Subscription: Self = Self(0x38);
189    #[doc(alias = "kMIDICIPropertyExchangeMessageTypeReplyToSubscription")]
190    pub const ReplyToSubscription: Self = Self(0x39);
191    #[doc(alias = "kMIDICIPropertyExchangeMessageTypeNotify")]
192    pub const Notify: Self = Self(0x3F);
193}
194
195#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
196unsafe impl Encode for MIDICIPropertyExchangeMessageType {
197    const ENCODING: Encoding = MIDIUInteger7::ENCODING;
198}
199
200#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
201unsafe impl RefEncode for MIDICIPropertyExchangeMessageType {
202    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
203}
204
205/// MIDI-CI Process Inquiry sub-ID values.
206///
207/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiciprocessinquirymessagetype?language=objc)
208// NS_ENUM
209#[cfg(feature = "MIDIMessages")]
210#[repr(transparent)]
211#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
212pub struct MIDICIProcessInquiryMessageType(pub MIDIUInteger7);
213#[cfg(feature = "MIDIMessages")]
214impl MIDICIProcessInquiryMessageType {
215    #[doc(alias = "kMIDICIProcessInquiryMessageTypeInquiryProcessInquiryCapabilities")]
216    pub const InquiryProcessInquiryCapabilities: Self = Self(0x40);
217    #[doc(alias = "kMIDICIProcessInquiryMessageTypeReplyToProcessInquiryCapabilities")]
218    pub const ReplyToProcessInquiryCapabilities: Self = Self(0x41);
219    #[doc(alias = "kMIDICIProcessInquiryMessageTypeInquiryMIDIMessageReport")]
220    pub const InquiryMIDIMessageReport: Self = Self(0x42);
221    #[doc(alias = "kMIDICIProcessInquiryMessageTypeReplyToMIDIMessageReport")]
222    pub const ReplyToMIDIMessageReport: Self = Self(0x43);
223    #[doc(alias = "kMIDICIProcessInquiryMessageTypeEndOfMIDIMessageReport")]
224    pub const EndOfMIDIMessageReport: Self = Self(0x44);
225}
226
227#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
228unsafe impl Encode for MIDICIProcessInquiryMessageType {
229    const ENCODING: Encoding = MIDIUInteger7::ENCODING;
230}
231
232#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
233unsafe impl RefEncode for MIDICIProcessInquiryMessageType {
234    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
235}
236
237/// MIDI-CI Management sub-ID values.
238///
239/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midicimanagementmessagetype?language=objc)
240// NS_ENUM
241#[cfg(feature = "MIDIMessages")]
242#[repr(transparent)]
243#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
244pub struct MIDICIManagementMessageType(pub MIDIUInteger7);
245#[cfg(feature = "MIDIMessages")]
246impl MIDICIManagementMessageType {
247    #[doc(alias = "kMIDICIManagementMessageTypeDiscovery")]
248    pub const Discovery: Self = Self(0x70);
249    #[doc(alias = "kMIDICIManagementMessageTypeReplyToDiscovery")]
250    pub const ReplyToDiscovery: Self = Self(0x71);
251    #[doc(alias = "kMIDICIManagementMessageTypeInquiryEndpointInformation")]
252    pub const InquiryEndpointInformation: Self = Self(0x72);
253    #[doc(alias = "kMIDICIManagementMessageTypeReplyToEndpointInformation")]
254    pub const ReplyToEndpointInformation: Self = Self(0x73);
255    #[doc(alias = "kMIDICIManagementMessageTypeMIDICIACK")]
256    pub const MIDICIACK: Self = Self(0x7D);
257    #[doc(alias = "kMIDICIManagementMessageTypeInvalidateMUID")]
258    pub const InvalidateMUID: Self = Self(0x7E);
259    #[doc(alias = "kMIDICIManagementMessageTypeMIDICINAK")]
260    pub const MIDICINAK: Self = Self(0x7F);
261}
262
263#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
264unsafe impl Encode for MIDICIManagementMessageType {
265    const ENCODING: Encoding = MIDIUInteger7::ENCODING;
266}
267
268#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
269unsafe impl RefEncode for MIDICIManagementMessageType {
270    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
271}
272
273/// MIDI-CI Profile variants.
274///
275/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiciprofiletype?language=objc)
276// NS_ENUM
277#[repr(transparent)]
278#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
279pub struct MIDICIProfileType(pub u8);
280impl MIDICIProfileType {
281    #[doc(alias = "kMIDICIProfileTypeSingleChannel")]
282    pub const SingleChannel: Self = Self(1);
283    #[doc(alias = "kMIDICIProfileTypeGroup")]
284    pub const Group: Self = Self(2);
285    #[doc(alias = "kMIDICIProfileTypeFunctionBlock")]
286    pub const FunctionBlock: Self = Self(3);
287    #[doc(alias = "kMIDICIProfileTypeMultichannel")]
288    pub const Multichannel: Self = Self(4);
289}
290
291#[cfg(feature = "objc2")]
292unsafe impl Encode for MIDICIProfileType {
293    const ENCODING: Encoding = u8::ENCODING;
294}
295
296#[cfg(feature = "objc2")]
297unsafe impl RefEncode for MIDICIProfileType {
298    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
299}
300
301/// The underlying transport / backing device type variants.
302///
303/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiumpciobjectbackingtype?language=objc)
304// NS_ENUM
305#[repr(transparent)]
306#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
307pub struct MIDIUMPCIObjectBackingType(pub u8);
308impl MIDIUMPCIObjectBackingType {
309    #[doc(alias = "kMIDIUMPCIObjectBackingTypeUnknown")]
310    pub const Unknown: Self = Self(0);
311    #[doc(alias = "kMIDIUMPCIObjectBackingTypeVirtual")]
312    pub const Virtual: Self = Self(1);
313    #[doc(alias = "kMIDIUMPCIObjectBackingTypeDriverDevice")]
314    pub const DriverDevice: Self = Self(2);
315    #[doc(alias = "kMIDIUMPCIObjectBackingTypeUSBMIDI")]
316    pub const USBMIDI: Self = Self(3);
317}
318
319#[cfg(feature = "objc2")]
320unsafe impl Encode for MIDIUMPCIObjectBackingType {
321    const ENCODING: Encoding = u8::ENCODING;
322}
323
324#[cfg(feature = "objc2")]
325unsafe impl RefEncode for MIDIUMPCIObjectBackingType {
326    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
327}
328
329/// A C-style struct containing a standard profile ID.
330///
331/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiciprofileidstandard?language=objc)
332#[cfg(feature = "MIDIMessages")]
333#[repr(C)]
334#[derive(Clone, Copy, Debug, PartialEq)]
335pub struct MIDICIProfileIDStandard {
336    pub profileIDByte1: MIDIUInteger7,
337    pub profileBank: MIDIUInteger7,
338    pub profileNumber: MIDIUInteger7,
339    pub profileVersion: MIDIUInteger7,
340    pub profileLevel: MIDIUInteger7,
341}
342
343#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
344unsafe impl Encode for MIDICIProfileIDStandard {
345    const ENCODING: Encoding = Encoding::Struct(
346        "?",
347        &[
348            <MIDIUInteger7>::ENCODING,
349            <MIDIUInteger7>::ENCODING,
350            <MIDIUInteger7>::ENCODING,
351            <MIDIUInteger7>::ENCODING,
352            <MIDIUInteger7>::ENCODING,
353        ],
354    );
355}
356
357#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
358unsafe impl RefEncode for MIDICIProfileIDStandard {
359    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
360}
361
362/// A C-style struct containing a Manufacturer Specific profile ID.
363///
364/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiciprofileidmanufacturerspecific?language=objc)
365#[cfg(feature = "MIDIMessages")]
366#[repr(C)]
367#[derive(Clone, Copy, Debug, PartialEq)]
368pub struct MIDICIProfileIDManufacturerSpecific {
369    pub sysExID1: MIDIUInteger7,
370    pub sysExID2: MIDIUInteger7,
371    pub sysExID3: MIDIUInteger7,
372    pub info1: MIDIUInteger7,
373    pub info2: MIDIUInteger7,
374}
375
376#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
377unsafe impl Encode for MIDICIProfileIDManufacturerSpecific {
378    const ENCODING: Encoding = Encoding::Struct(
379        "?",
380        &[
381            <MIDIUInteger7>::ENCODING,
382            <MIDIUInteger7>::ENCODING,
383            <MIDIUInteger7>::ENCODING,
384            <MIDIUInteger7>::ENCODING,
385            <MIDIUInteger7>::ENCODING,
386        ],
387    );
388}
389
390#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
391unsafe impl RefEncode for MIDICIProfileIDManufacturerSpecific {
392    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
393}
394
395/// A C-style struct containing the profile ID.
396///
397///
398/// There are two general types of Profiles -- standard defined Profiles and
399/// manufacturer-specific Profiles.
400///
401/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midiciprofileid?language=objc)
402#[cfg(feature = "MIDIMessages")]
403#[repr(C)]
404#[derive(Clone, Copy)]
405pub union MIDICIProfileID {
406    pub standard: MIDICIProfileIDStandard,
407    pub manufacturerSpecific: MIDICIProfileIDManufacturerSpecific,
408}
409
410#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
411unsafe impl Encode for MIDICIProfileID {
412    const ENCODING: Encoding = Encoding::Union(
413        "?",
414        &[
415            <MIDICIProfileIDStandard>::ENCODING,
416            <MIDICIProfileIDManufacturerSpecific>::ENCODING,
417        ],
418    );
419}
420
421#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
422unsafe impl RefEncode for MIDICIProfileID {
423    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
424}
425
426/// The request ID associated with a Property Exchange request.
427///
428///
429/// As the respose context of a Property Exchange message is assumed to be known
430/// by the initiator, the requestID of each request is included with the response such
431/// that it can be correlated with the initial request.
432///
433/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/midicipropertyexchangerequestid?language=objc)
434// NS_TYPED_EXTENSIBLE_ENUM
435pub type MIDICIPropertyExchangeRequestID = u8;
436
437/// Returned when MIDI-CI Property Messages were not dispatched due to an error.
438///
439/// See also [Apple's documentation](https://developer.apple.com/documentation/coremidi/kmidicipropertyexchangebadrequestid?language=objc)
440pub static kMIDICIPropertyExchangeBadRequestID: MIDICIPropertyExchangeRequestID = 0xFF;