objc2-avf-audio 0.3.2

Bindings to the AVFAudio framework
Documentation
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-audio-types")]
use objc2_core_audio_types::*;
use objc2_foundation::*;

use crate::*;

/// The location of a data source on an iOS device.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionlocation?language=objc)
// NS_TYPED_ENUM
pub type AVAudioSessionLocation = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionlocationupper?language=objc)
    pub static AVAudioSessionLocationUpper: &'static AVAudioSessionLocation;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionlocationlower?language=objc)
    pub static AVAudioSessionLocationLower: &'static AVAudioSessionLocation;
}

/// The orientation or directionality of a data source on an iOS device.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionorientation?language=objc)
// NS_TYPED_ENUM
pub type AVAudioSessionOrientation = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionorientationtop?language=objc)
    pub static AVAudioSessionOrientationTop: &'static AVAudioSessionOrientation;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionorientationbottom?language=objc)
    pub static AVAudioSessionOrientationBottom: &'static AVAudioSessionOrientation;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionorientationfront?language=objc)
    pub static AVAudioSessionOrientationFront: &'static AVAudioSessionOrientation;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionorientationback?language=objc)
    pub static AVAudioSessionOrientationBack: &'static AVAudioSessionOrientation;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionorientationleft?language=objc)
    pub static AVAudioSessionOrientationLeft: &'static AVAudioSessionOrientation;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionorientationright?language=objc)
    pub static AVAudioSessionOrientationRight: &'static AVAudioSessionOrientation;
}

/// The possible polar patterns for a data source on an iOS device.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionpolarpattern?language=objc)
// NS_TYPED_ENUM
pub type AVAudioSessionPolarPattern = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionpolarpatternomnidirectional?language=objc)
    pub static AVAudioSessionPolarPatternOmnidirectional: &'static AVAudioSessionPolarPattern;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionpolarpatterncardioid?language=objc)
    pub static AVAudioSessionPolarPatternCardioid: &'static AVAudioSessionPolarPattern;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionpolarpatternsubcardioid?language=objc)
    pub static AVAudioSessionPolarPatternSubcardioid: &'static AVAudioSessionPolarPattern;
}

extern "C" {
    /// If you select a data source with AVAudioSessionPolarPatternStereo, then you must call setPreferredInputOrientation:error: on your Audio Session so that left and right are presented from the correct directions.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionpolarpatternstereo?language=objc)
    pub static AVAudioSessionPolarPatternStereo: &'static AVAudioSessionPolarPattern;
}

extern_class!(
    /// Information about a port's audio channels.
    ///
    /// AudioQueue, AURemoteIO and AUVoiceIO instances can be assigned to communicate with specific
    /// hardware channels by setting an array of
    /// <port
    /// UID, channel index> pairs.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionchanneldescription?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVAudioSessionChannelDescription;
);

unsafe impl Send for AVAudioSessionChannelDescription {}

unsafe impl Sync for AVAudioSessionChannelDescription {}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVAudioSessionChannelDescription {}
);

impl AVAudioSessionChannelDescription {
    extern_methods!(
        /// A human-readable name for the channel.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(channelName))]
        #[unsafe(method_family = none)]
        pub unsafe fn channelName(&self) -> Retained<NSString>;

        /// The UID (unique identifier) of the port owning the channel.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(owningPortUID))]
        #[unsafe(method_family = none)]
        pub unsafe fn owningPortUID(&self) -> Retained<NSString>;

        /// The index of this channel in its owning port's array of channels.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(channelNumber))]
        #[unsafe(method_family = none)]
        pub unsafe fn channelNumber(&self) -> NSUInteger;

        #[cfg(feature = "objc2-core-audio-types")]
        /// Description of the physical location of this channel.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(channelLabel))]
        #[unsafe(method_family = none)]
        pub unsafe fn channelLabel(&self) -> AudioChannelLabel;
    );
}

/// Methods declared on superclass `NSObject`.
impl AVAudioSessionChannelDescription {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// Information about one of potentially multiple data sources associated with a port.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessiondatasourcedescription?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVAudioSessionDataSourceDescription;
);

unsafe impl Send for AVAudioSessionDataSourceDescription {}

unsafe impl Sync for AVAudioSessionDataSourceDescription {}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVAudioSessionDataSourceDescription {}
);

impl AVAudioSessionDataSourceDescription {
    extern_methods!(
        /// System-assigned ID for the data source.
        #[unsafe(method(dataSourceID))]
        #[unsafe(method_family = none)]
        pub unsafe fn dataSourceID(&self) -> Retained<NSNumber>;

        /// Human-readable name for the data source.
        #[unsafe(method(dataSourceName))]
        #[unsafe(method_family = none)]
        pub unsafe fn dataSourceName(&self) -> Retained<NSString>;

        /// Describes the general location of a data source. Will be nil for data sources for which the
        /// location is not known.
        #[unsafe(method(location))]
        #[unsafe(method_family = none)]
        pub unsafe fn location(&self) -> Option<Retained<AVAudioSessionLocation>>;

        /// Describes the orientation of a data source.  Will be nil for data sources for which the
        /// orientation is not known.
        #[unsafe(method(orientation))]
        #[unsafe(method_family = none)]
        pub unsafe fn orientation(&self) -> Option<Retained<AVAudioSessionOrientation>>;

        /// Array of one or more AVAudioSessionPolarPatterns describing the supported polar patterns for a
        /// data source.  Will be nil for data sources that have no selectable patterns.
        #[unsafe(method(supportedPolarPatterns))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportedPolarPatterns(
            &self,
        ) -> Option<Retained<NSArray<AVAudioSessionPolarPattern>>>;

        /// Describes the currently selected polar pattern.  Will be nil for data sources that have no
        /// selectable patterns.
        #[unsafe(method(selectedPolarPattern))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedPolarPattern(&self) -> Option<Retained<AVAudioSessionPolarPattern>>;

        /// Describes the preferred polar pattern.  Will be nil for data sources that have no selectable
        /// patterns or if no preference has been set.
        #[unsafe(method(preferredPolarPattern))]
        #[unsafe(method_family = none)]
        pub unsafe fn preferredPolarPattern(&self) -> Option<Retained<AVAudioSessionPolarPattern>>;

        /// Select the desired polar pattern from the set of available patterns. Setting a nil value
        /// will clear the preference.
        ///
        ///
        /// Note: If the owning port and data source are part of the active audio route, changing the polar
        /// pattern will likely result in a route reconfiguration. If the owning port and data source are
        /// not part of the active route, selecting a polar pattern will not result in an immediate route
        /// reconfiguration.  Use AVAudioSession's setPreferredInput:error: method to activate the port. Use
        /// setPreferredDataSource:error: to active the data source on the port.
        /// You must call setPreferredInputOrientation:error: on the AVAudioSession if you chose the
        /// AVAudioSessionPolarPatternStereo polar pattern.
        #[unsafe(method(setPreferredPolarPattern:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPreferredPolarPattern_error(
            &self,
            pattern: Option<&AVAudioSessionPolarPattern>,
        ) -> Result<(), Retained<NSError>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl AVAudioSessionDataSourceDescription {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// Describes whether a specific capability is supported and if that capability is currently enabled
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessioncapability?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVAudioSessionCapability;
);

unsafe impl Send for AVAudioSessionCapability {}

unsafe impl Sync for AVAudioSessionCapability {}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVAudioSessionCapability {}
);

impl AVAudioSessionCapability {
    extern_methods!(
        /// A Boolean value that indicates whether the capability is supported.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(isSupported))]
        #[unsafe(method_family = none)]
        pub unsafe fn isSupported(&self) -> bool;

        /// A Boolean value that indicates whether the capability is enabled.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(isEnabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn isEnabled(&self) -> bool;
    );
}

/// Methods declared on superclass `NSObject`.
impl AVAudioSessionCapability {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// An object that describes capabilities of Bluetooth microphone ports.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportextensionbluetoothmicrophone?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVAudioSessionPortExtensionBluetoothMicrophone;
);

unsafe impl Send for AVAudioSessionPortExtensionBluetoothMicrophone {}

unsafe impl Sync for AVAudioSessionPortExtensionBluetoothMicrophone {}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVAudioSessionPortExtensionBluetoothMicrophone {}
);

impl AVAudioSessionPortExtensionBluetoothMicrophone {
    extern_methods!(
        /// Describes whether this port supports Bluetooth high-quality recording.
        ///
        /// Please see ``AVAudioSessionCategoryOptions/AVAudioSessionCategoryOptionBluetoothHighQualityRecording`` for details.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(highQualityRecording))]
        #[unsafe(method_family = none)]
        pub unsafe fn highQualityRecording(&self) -> Retained<AVAudioSessionCapability>;

        /// Describes whether this port supports far-field input capture.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(farFieldCapture))]
        #[unsafe(method_family = none)]
        pub unsafe fn farFieldCapture(&self) -> Retained<AVAudioSessionCapability>;
    );
}

/// Methods declared on superclass `NSObject`.
impl AVAudioSessionPortExtensionBluetoothMicrophone {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// Information about a port, a physical connector or audio device.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportdescription?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVAudioSessionPortDescription;
);

unsafe impl Send for AVAudioSessionPortDescription {}

unsafe impl Sync for AVAudioSessionPortDescription {}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVAudioSessionPortDescription {}
);

impl AVAudioSessionPortDescription {
    extern_methods!(
        #[cfg(feature = "AVAudioSessionTypes")]
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(portType))]
        #[unsafe(method_family = none)]
        pub unsafe fn portType(&self) -> Retained<AVAudioSessionPort>;

        /// A descriptive name for the associated hardware port
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(portName))]
        #[unsafe(method_family = none)]
        pub unsafe fn portName(&self) -> Retained<NSString>;

        /// A system-assigned unique identifier for the associated hardware port
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(UID))]
        #[unsafe(method_family = none)]
        pub unsafe fn UID(&self) -> Retained<NSString>;

        /// This property's value will be true if the associated hardware port has built-in
        /// processing for two-way voice communication.
        ///
        /// Applications that use their own proprietary voice processing algorithms should use this property
        /// to decide when to disable processing.  On the other hand, if using Apple's Voice Processing I/O
        /// unit (subtype kAudioUnitSubType_VoiceProcessingIO), the system will automatically manage this
        /// for the application. In particular, ports of type AVAudioSessionPortBluetoothHFP and
        /// AVAudioSessionPortCarAudio often have hardware voice processing.
        #[unsafe(method(hasHardwareVoiceCallProcessing))]
        #[unsafe(method_family = none)]
        pub unsafe fn hasHardwareVoiceCallProcessing(&self) -> bool;

        /// This property's value will be true if the port supports spatial audio playback and the feature is
        /// enabled.
        ///
        /// 'Now Playing' apps should also inform the system if they support multichannel audio content using
        /// -setSupportsMultichannelContent:error: method. Apps may also register to receive the
        /// AVAudioSessionSpatialPlaybackCapabilitiesChanged notification to detect changes in user preferences that
        /// affect spatial audio playback.
        ///
        /// This property is only relevant in the context of ports that have a small number of hardware channels
        /// (typically 2), but have enhanced capabilities for rendering multi-channel content. Note that some port
        /// types such as USB and HDMI may support multi-channel playback because they have hardware formats supporting
        /// more than 2 channels. For example, many HDMI receivers are connected to multiple speakers and are capable of
        /// rendering 5.1, 7.1, or other popular surround sound formats. Applications interested in utilizing multi-channel
        /// formats should also query AVAudioSession's maximumOutputNumberOfChannels property and make use of
        /// -setPreferredOutputNumberOfChannels:error: to set the preferred number of hardware channels.
        #[unsafe(method(isSpatialAudioEnabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn isSpatialAudioEnabled(&self) -> bool;

        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(channels))]
        #[unsafe(method_family = none)]
        pub unsafe fn channels(
            &self,
        ) -> Option<Retained<NSArray<AVAudioSessionChannelDescription>>>;

        /// Will be nil if there are no selectable data sources.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(dataSources))]
        #[unsafe(method_family = none)]
        pub unsafe fn dataSources(
            &self,
        ) -> Option<Retained<NSArray<AVAudioSessionDataSourceDescription>>>;

        /// Will be nil if there are no selectable data sources. In all other cases, this property reflects
        /// the currently selected data source.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(selectedDataSource))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedDataSource(
            &self,
        ) -> Option<Retained<AVAudioSessionDataSourceDescription>>;

        /// This property reflects the application's preferred data source for the Port. Will be nil if
        /// there are no selectable data sources or if no preference has been set.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(preferredDataSource))]
        #[unsafe(method_family = none)]
        pub unsafe fn preferredDataSource(
            &self,
        ) -> Option<Retained<AVAudioSessionDataSourceDescription>>;

        /// Select the preferred data source for this port. The input dataSource parameter must be
        /// one of the dataSources exposed by the dataSources property. Setting a nil value will clear the
        /// preference. Note: if the port is part of the active audio route, changing the data source will
        /// likely result in a route reconfiguration.  If the port is not part of the active route,
        /// selecting a new data source will not result in an immediate route reconfiguration.  Use
        /// AVAudioSession's -setPreferredInput:error: method to activate the port.
        #[unsafe(method(setPreferredDataSource:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPreferredDataSource_error(
            &self,
            data_source: Option<&AVAudioSessionDataSourceDescription>,
        ) -> Result<(), Retained<NSError>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl AVAudioSessionPortDescription {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

/// BluetoothMicrophoneExtension.
impl AVAudioSessionPortDescription {
    extern_methods!(
        /// An optional port extension that describes capabilities relevant to Bluetooth microphone ports.
        ///
        /// This property is optional and will be `nil` for all ports for which this capability set doesn't apply.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(bluetoothMicrophoneExtension))]
        #[unsafe(method_family = none)]
        pub unsafe fn bluetoothMicrophoneExtension(
            &self,
        ) -> Option<Retained<AVAudioSessionPortExtensionBluetoothMicrophone>>;
    );
}

extern_class!(
    /// A description of the input and output ports which comprise a route.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionroutedescription?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVAudioSessionRouteDescription;
);

unsafe impl Send for AVAudioSessionRouteDescription {}

unsafe impl Sync for AVAudioSessionRouteDescription {}

extern_conformance!(
    unsafe impl NSObjectProtocol for AVAudioSessionRouteDescription {}
);

impl AVAudioSessionRouteDescription {
    extern_methods!(
        /// Flattened list of all input port descriptions associated with all the streams as part of the route.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(inputs))]
        #[unsafe(method_family = none)]
        pub unsafe fn inputs(&self) -> Retained<NSArray<AVAudioSessionPortDescription>>;

        /// Flattened list of all output port descriptions associated with all the streams as part of the route.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(outputs))]
        #[unsafe(method_family = none)]
        pub unsafe fn outputs(&self) -> Retained<NSArray<AVAudioSessionPortDescription>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl AVAudioSessionRouteDescription {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}