objc2_core_midi/generated/
MIDIUMPEndpoint.rs1use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "objc2")]
6use objc2::__framework_prelude::*;
7#[cfg(feature = "objc2-foundation")]
8use objc2_foundation::*;
9
10use crate::*;
11
12#[cfg(feature = "objc2")]
13extern_class!(
14 #[unsafe(super(NSObject))]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 #[cfg(feature = "objc2")]
21 pub struct MIDI2DeviceInfo;
22);
23
24#[cfg(feature = "objc2")]
25extern_conformance!(
26 unsafe impl NSObjectProtocol for MIDI2DeviceInfo {}
27);
28
29#[cfg(feature = "objc2")]
30impl MIDI2DeviceInfo {
31 extern_methods!(
32 #[cfg(feature = "MIDIUMPCI")]
33 #[unsafe(method(manufacturerID))]
37 #[unsafe(method_family = none)]
38 pub unsafe fn manufacturerID(&self) -> MIDI2DeviceManufacturer;
39
40 #[cfg(feature = "MIDIMessages")]
41 #[unsafe(method(family))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn family(&self) -> MIDIUInteger14;
45
46 #[cfg(feature = "MIDIMessages")]
47 #[unsafe(method(modelNumber))]
49 #[unsafe(method_family = none)]
50 pub unsafe fn modelNumber(&self) -> MIDIUInteger14;
51
52 #[cfg(feature = "MIDIUMPCI")]
53 #[unsafe(method(revisionLevel))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn revisionLevel(&self) -> MIDI2DeviceRevisionLevel;
57
58 #[unsafe(method(init))]
59 #[unsafe(method_family = init)]
60 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
61
62 #[cfg(all(feature = "MIDIMessages", feature = "MIDIUMPCI"))]
63 #[unsafe(method(initWithManufacturerID:family:modelNumber:revisionLevel:))]
78 #[unsafe(method_family = init)]
79 pub unsafe fn initWithManufacturerID_family_modelNumber_revisionLevel(
80 this: Allocated<Self>,
81 manufacturer_id: MIDI2DeviceManufacturer,
82 family: MIDIUInteger14,
83 model_number: MIDIUInteger14,
84 revision_level: MIDI2DeviceRevisionLevel,
85 ) -> Retained<Self>;
86 );
87}
88
89#[cfg(feature = "objc2")]
91impl MIDI2DeviceInfo {
92 extern_methods!(
93 #[unsafe(method(new))]
94 #[unsafe(method_family = new)]
95 pub unsafe fn new() -> Retained<Self>;
96 );
97}
98
99#[cfg(feature = "MIDIMessages")]
110#[repr(transparent)]
111#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
112pub struct MIDIUMPProtocolOptions(pub MIDIUInteger4);
113#[cfg(feature = "MIDIMessages")]
114bitflags::bitflags! {
115 impl MIDIUMPProtocolOptions: MIDIUInteger4 {
116 #[doc(alias = "kMIDIUMPProtocolOptionsMIDI1")]
117 const MIDI1 = 1;
118 #[doc(alias = "kMIDIUMPProtocolOptionsMIDI2")]
119 const MIDI2 = 1<<1;
120 }
121}
122
123#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
124unsafe impl Encode for MIDIUMPProtocolOptions {
125 const ENCODING: Encoding = MIDIUInteger4::ENCODING;
126}
127
128#[cfg(all(feature = "MIDIMessages", feature = "objc2"))]
129unsafe impl RefEncode for MIDIUMPProtocolOptions {
130 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
131}
132
133#[cfg(feature = "objc2")]
134extern_class!(
135 #[unsafe(super(NSObject))]
149 #[derive(Debug, PartialEq, Eq, Hash)]
150 #[cfg(feature = "objc2")]
151 pub struct MIDIUMPEndpoint;
152);
153
154#[cfg(feature = "objc2")]
155extern_conformance!(
156 unsafe impl NSObjectProtocol for MIDIUMPEndpoint {}
157);
158
159#[cfg(feature = "objc2")]
160impl MIDIUMPEndpoint {
161 extern_methods!(
162 #[cfg(feature = "objc2-foundation")]
163 #[unsafe(method(name))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn name(&self) -> Retained<NSString>;
170
171 #[cfg(feature = "MIDIServices")]
172 #[unsafe(method(MIDIProtocol))]
174 #[unsafe(method_family = none)]
175 pub unsafe fn MIDIProtocol(&self) -> MIDIProtocolID;
176
177 #[cfg(feature = "MIDIMessages")]
178 #[unsafe(method(supportedMIDIProtocols))]
180 #[unsafe(method_family = none)]
181 pub unsafe fn supportedMIDIProtocols(&self) -> MIDIUMPProtocolOptions;
182
183 #[cfg(feature = "MIDIServices")]
184 #[unsafe(method(MIDIDestination))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn MIDIDestination(&self) -> MIDIEndpointRef;
188
189 #[cfg(feature = "MIDIServices")]
190 #[unsafe(method(MIDISource))]
192 #[unsafe(method_family = none)]
193 pub unsafe fn MIDISource(&self) -> MIDIEndpointRef;
194
195 #[unsafe(method(deviceInfo))]
197 #[unsafe(method_family = none)]
198 pub unsafe fn deviceInfo(&self) -> Retained<MIDI2DeviceInfo>;
199
200 #[cfg(feature = "objc2-foundation")]
201 #[unsafe(method(productInstanceID))]
204 #[unsafe(method_family = none)]
205 pub unsafe fn productInstanceID(&self) -> Retained<NSString>;
206
207 #[unsafe(method(hasStaticFunctionBlocks))]
209 #[unsafe(method_family = none)]
210 pub unsafe fn hasStaticFunctionBlocks(&self) -> bool;
211
212 #[unsafe(method(hasJRTSReceiveCapability))]
214 #[unsafe(method_family = none)]
215 pub unsafe fn hasJRTSReceiveCapability(&self) -> bool;
216
217 #[unsafe(method(hasJRTSTransmitCapability))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn hasJRTSTransmitCapability(&self) -> bool;
221
222 #[cfg(feature = "MIDIUMPCI")]
223 #[unsafe(method(endpointType))]
225 #[unsafe(method_family = none)]
226 pub unsafe fn endpointType(&self) -> MIDIUMPCIObjectBackingType;
227
228 #[cfg(all(feature = "MIDIUMPFunctionBlock", feature = "objc2-foundation"))]
229 #[unsafe(method(functionBlocks))]
231 #[unsafe(method_family = none)]
232 pub unsafe fn functionBlocks(&self) -> Retained<NSArray<MIDIUMPFunctionBlock>>;
233
234 #[cfg(all(feature = "MIDIUMPFunctionBlock", feature = "objc2-foundation"))]
235 #[unsafe(method(setFunctionBlocks:))]
239 #[unsafe(method_family = none)]
240 pub unsafe fn setFunctionBlocks(&self, function_blocks: &NSArray<MIDIUMPFunctionBlock>);
241
242 #[unsafe(method(init))]
243 #[unsafe(method_family = init)]
244 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
245 );
246}
247
248#[cfg(feature = "objc2")]
250impl MIDIUMPEndpoint {
251 extern_methods!(
252 #[unsafe(method(new))]
253 #[unsafe(method_family = new)]
254 pub unsafe fn new() -> Retained<Self>;
255 );
256}