objc2_avf_audio/generated/
AVAudioSessionTypes.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use objc2::__framework_prelude::*;
4use objc2_foundation::*;
5
6use crate::*;
7
8/// A port describes a specific type of audio input or output device or connector.
9///
10/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionport?language=objc)
11// NS_TYPED_ENUM
12pub type AVAudioSessionPort = NSString;
13
14extern "C" {
15    /// Continuity microphone for appletv.
16    ///
17    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportcontinuitymicrophone?language=objc)
18    pub static AVAudioSessionPortContinuityMicrophone: Option<&'static AVAudioSessionPort>;
19}
20
21extern "C" {
22    /// Line level input on a dock connector
23    ///
24    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportlinein?language=objc)
25    pub static AVAudioSessionPortLineIn: Option<&'static AVAudioSessionPort>;
26}
27
28extern "C" {
29    /// Built-in microphone on an iOS device
30    ///
31    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportbuiltinmic?language=objc)
32    pub static AVAudioSessionPortBuiltInMic: Option<&'static AVAudioSessionPort>;
33}
34
35extern "C" {
36    /// Microphone on a wired headset.  Headset refers to an accessory that has headphone outputs paired with a
37    /// microphone.
38    ///
39    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportheadsetmic?language=objc)
40    pub static AVAudioSessionPortHeadsetMic: Option<&'static AVAudioSessionPort>;
41}
42
43extern "C" {
44    /// Line level output on a dock connector
45    ///
46    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportlineout?language=objc)
47    pub static AVAudioSessionPortLineOut: Option<&'static AVAudioSessionPort>;
48}
49
50extern "C" {
51    /// Headphone or headset output
52    ///
53    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportheadphones?language=objc)
54    pub static AVAudioSessionPortHeadphones: Option<&'static AVAudioSessionPort>;
55}
56
57extern "C" {
58    /// Output on a Bluetooth A2DP device
59    ///
60    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportbluetootha2dp?language=objc)
61    pub static AVAudioSessionPortBluetoothA2DP: Option<&'static AVAudioSessionPort>;
62}
63
64extern "C" {
65    /// The speaker you hold to your ear when on a phone call
66    ///
67    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportbuiltinreceiver?language=objc)
68    pub static AVAudioSessionPortBuiltInReceiver: Option<&'static AVAudioSessionPort>;
69}
70
71extern "C" {
72    /// Built-in speaker on an iOS device
73    ///
74    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportbuiltinspeaker?language=objc)
75    pub static AVAudioSessionPortBuiltInSpeaker: Option<&'static AVAudioSessionPort>;
76}
77
78extern "C" {
79    /// Output via High-Definition Multimedia Interface
80    ///
81    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionporthdmi?language=objc)
82    pub static AVAudioSessionPortHDMI: Option<&'static AVAudioSessionPort>;
83}
84
85extern "C" {
86    /// Output on a remote Air Play device
87    ///
88    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportairplay?language=objc)
89    pub static AVAudioSessionPortAirPlay: Option<&'static AVAudioSessionPort>;
90}
91
92extern "C" {
93    /// Output on a Bluetooth Low Energy device
94    ///
95    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportbluetoothle?language=objc)
96    pub static AVAudioSessionPortBluetoothLE: Option<&'static AVAudioSessionPort>;
97}
98
99extern "C" {
100    /// Input or output on a Bluetooth Hands-Free Profile device
101    ///
102    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportbluetoothhfp?language=objc)
103    pub static AVAudioSessionPortBluetoothHFP: Option<&'static AVAudioSessionPort>;
104}
105
106extern "C" {
107    /// Input or output on a Universal Serial Bus device
108    ///
109    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportusbaudio?language=objc)
110    pub static AVAudioSessionPortUSBAudio: Option<&'static AVAudioSessionPort>;
111}
112
113extern "C" {
114    /// Input or output via Car Audio
115    ///
116    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportcaraudio?language=objc)
117    pub static AVAudioSessionPortCarAudio: Option<&'static AVAudioSessionPort>;
118}
119
120extern "C" {
121    /// Input or output that does not correspond to real audio hardware
122    ///
123    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportvirtual?language=objc)
124    pub static AVAudioSessionPortVirtual: Option<&'static AVAudioSessionPort>;
125}
126
127extern "C" {
128    /// Input or output connected via the PCI (Peripheral Component Interconnect) bus
129    ///
130    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportpci?language=objc)
131    pub static AVAudioSessionPortPCI: Option<&'static AVAudioSessionPort>;
132}
133
134extern "C" {
135    /// Input or output connected via FireWire
136    ///
137    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportfirewire?language=objc)
138    pub static AVAudioSessionPortFireWire: Option<&'static AVAudioSessionPort>;
139}
140
141extern "C" {
142    /// Input or output connected via DisplayPort
143    ///
144    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportdisplayport?language=objc)
145    pub static AVAudioSessionPortDisplayPort: Option<&'static AVAudioSessionPort>;
146}
147
148extern "C" {
149    /// Input or output connected via AVB (Audio Video Bridging)
150    ///
151    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportavb?language=objc)
152    pub static AVAudioSessionPortAVB: Option<&'static AVAudioSessionPort>;
153}
154
155extern "C" {
156    /// Input or output connected via Thunderbolt
157    ///
158    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportthunderbolt?language=objc)
159    pub static AVAudioSessionPortThunderbolt: Option<&'static AVAudioSessionPort>;
160}
161
162/// A category defines a broad set of behaviors for a session.
163///
164/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessioncategory?language=objc)
165// NS_TYPED_ENUM
166pub type AVAudioSessionCategory = NSString;
167
168extern "C" {
169    /// Use this category for background sounds such as rain, car engine noise, etc.
170    /// Mixes with other music.
171    ///
172    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessioncategoryambient?language=objc)
173    pub static AVAudioSessionCategoryAmbient: Option<&'static AVAudioSessionCategory>;
174}
175
176extern "C" {
177    /// Use this category for background sounds.  Other music will stop playing.
178    ///
179    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessioncategorysoloambient?language=objc)
180    pub static AVAudioSessionCategorySoloAmbient: Option<&'static AVAudioSessionCategory>;
181}
182
183extern "C" {
184    /// Use this category for music tracks.
185    ///
186    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessioncategoryplayback?language=objc)
187    pub static AVAudioSessionCategoryPlayback: Option<&'static AVAudioSessionCategory>;
188}
189
190extern "C" {
191    /// Use this category when recording audio.
192    ///
193    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessioncategoryrecord?language=objc)
194    pub static AVAudioSessionCategoryRecord: Option<&'static AVAudioSessionCategory>;
195}
196
197extern "C" {
198    /// Use this category when recording and playing back audio.
199    ///
200    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessioncategoryplayandrecord?language=objc)
201    pub static AVAudioSessionCategoryPlayAndRecord: Option<&'static AVAudioSessionCategory>;
202}
203
204extern "C" {
205    /// Use this category when using a hardware codec or signal processor while
206    /// not playing or recording audio.
207    ///
208    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessioncategoryaudioprocessing?language=objc)
209    pub static AVAudioSessionCategoryAudioProcessing: Option<&'static AVAudioSessionCategory>;
210}
211
212extern "C" {
213    /// Use this category to customize the usage of available audio accessories and built-in audio hardware.
214    /// For example, this category provides an application with the ability to use an available USB output
215    /// and headphone output simultaneously for separate, distinct streams of audio data. Use of
216    /// this category by an application requires a more detailed knowledge of, and interaction with,
217    /// the capabilities of the available audio routes.  May be used for input, output, or both.
218    /// Note that not all output types and output combinations are eligible for multi-route.  Input is limited
219    /// to the last-in input port. Eligible inputs consist of the following:
220    /// AVAudioSessionPortUSBAudio, AVAudioSessionPortHeadsetMic, and AVAudioSessionPortBuiltInMic.
221    /// Eligible outputs consist of the following:
222    /// AVAudioSessionPortUSBAudio, AVAudioSessionPortLineOut, AVAudioSessionPortHeadphones, AVAudioSessionPortHDMI,
223    /// and AVAudioSessionPortBuiltInSpeaker.
224    /// Note that AVAudioSessionPortBuiltInSpeaker is only allowed to be used when there are no other eligible
225    /// outputs connected.
226    ///
227    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessioncategorymultiroute?language=objc)
228    pub static AVAudioSessionCategoryMultiRoute: Option<&'static AVAudioSessionCategory>;
229}
230
231/// Modes modify the audio category in order to introduce behavior that is tailored to the specific
232/// use of audio within an application.  Available in iOS 5.0 and greater.
233///
234/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionmode?language=objc)
235// NS_TYPED_ENUM
236pub type AVAudioSessionMode = NSString;
237
238extern "C" {
239    /// The default mode
240    ///
241    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionmodedefault?language=objc)
242    pub static AVAudioSessionModeDefault: Option<&'static AVAudioSessionMode>;
243}
244
245extern "C" {
246    /// Only valid with AVAudioSessionCategoryPlayAndRecord.  Appropriate for Voice over IP
247    /// (VoIP) applications.  Reduces the number of allowable audio routes to be only those
248    /// that are appropriate for VoIP applications and may engage appropriate system-supplied
249    /// signal processing.  Has the side effect of setting AVAudioSessionCategoryOptionAllowBluetooth.
250    /// Using this mode without the VoiceProcessing IO unit or AVAudioEngine with voice processing enabled will result in the following:
251    /// - Chat-specific signal processing such as echo cancellation or automatic gain correction will not be loaded
252    /// - Dynamic processing on input and output will be disabled resulting in a lower output playback level.
253    ///
254    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionmodevoicechat?language=objc)
255    pub static AVAudioSessionModeVoiceChat: Option<&'static AVAudioSessionMode>;
256}
257
258extern "C" {
259    /// Set by Game Kit on behalf of an application that uses a GKVoiceChat object; valid
260    /// only with the AVAudioSessionCategoryPlayAndRecord category.
261    /// Do not set this mode directly. If you need similar behavior and are not using
262    /// a GKVoiceChat object, use AVAudioSessionModeVoiceChat instead.
263    ///
264    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionmodegamechat?language=objc)
265    pub static AVAudioSessionModeGameChat: Option<&'static AVAudioSessionMode>;
266}
267
268extern "C" {
269    /// Only valid with AVAudioSessionCategoryPlayAndRecord or AVAudioSessionCategoryRecord.
270    /// Modifies the audio routing options and may engage appropriate system-supplied signal processing.
271    ///
272    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionmodevideorecording?language=objc)
273    pub static AVAudioSessionModeVideoRecording: Option<&'static AVAudioSessionMode>;
274}
275
276extern "C" {
277    /// Appropriate for applications that wish to minimize the effect of system-supplied signal
278    /// processing for input and/or output audio signals.
279    /// This mode disables some dynamics processing on input and output resulting in a lower output playback level.
280    ///
281    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionmodemeasurement?language=objc)
282    pub static AVAudioSessionModeMeasurement: Option<&'static AVAudioSessionMode>;
283}
284
285extern "C" {
286    /// Appropriate for applications playing movie content. Only valid with AVAudioSessionCategoryPlayback.
287    /// Setting this mode engages appropriate output signal processing for movie playback scenarios.
288    /// Content using this mode is eligible for Enhance Dialogue processing on supported routes with capable hardware
289    ///
290    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionmodemovieplayback?language=objc)
291    pub static AVAudioSessionModeMoviePlayback: Option<&'static AVAudioSessionMode>;
292}
293
294extern "C" {
295    /// Only valid with kAudioSessionCategory_PlayAndRecord. Reduces the number of allowable audio
296    /// routes to be only those that are appropriate for video chat applications. May engage appropriate
297    /// system-supplied signal processing.  Has the side effect of setting
298    /// AVAudioSessionCategoryOptionAllowBluetooth and AVAudioSessionCategoryOptionDefaultToSpeaker.
299    /// Using this mode without the VoiceProcessing IO unit or AVAudioEngine with voice processing enabled will result in the following:
300    /// - Chat-specific signal processing such as echo cancellation or automatic gain correction will not be loaded
301    /// - Dynamic processing on input and output will be disabled resulting in a lower output playback level.
302    ///
303    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionmodevideochat?language=objc)
304    pub static AVAudioSessionModeVideoChat: Option<&'static AVAudioSessionMode>;
305}
306
307extern "C" {
308    /// Appropriate for applications which play spoken audio and wish to be paused (via audio session interruption) rather than ducked
309    /// if another app (such as a navigation app) plays a spoken audio prompt.  Examples of apps that would use this are podcast players and
310    /// audio books.  For more information, see the related category option AVAudioSessionCategoryOptionInterruptSpokenAudioAndMixWithOthers.
311    ///
312    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionmodespokenaudio?language=objc)
313    pub static AVAudioSessionModeSpokenAudio: Option<&'static AVAudioSessionMode>;
314}
315
316extern "C" {
317    /// Appropriate for applications which play audio using text to speech. Setting this mode allows for different routing behaviors when
318    /// connected to certain audio devices such as CarPlay. An example of an app that would use this mode is a turn by turn navigation app that
319    /// plays short prompts to the user. Typically, these same types of applications would also configure their session to use
320    /// AVAudioSessionCategoryOptionDuckOthers and AVAudioSessionCategoryOptionInterruptSpokenAudioAndMixWithOthers
321    ///
322    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionmodevoiceprompt?language=objc)
323    pub static AVAudioSessionModeVoicePrompt: Option<&'static AVAudioSessionMode>;
324}
325
326/// For use with activateWithOptions:completionHandler:
327///
328/// Reserved for future use. Added in watchOS 5.0.
329///
330/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionactivationoptions?language=objc)
331// NS_OPTIONS
332#[repr(transparent)]
333#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
334pub struct AVAudioSessionActivationOptions(pub NSUInteger);
335bitflags::bitflags! {
336    impl AVAudioSessionActivationOptions: NSUInteger {
337        #[doc(alias = "AVAudioSessionActivationOptionNone")]
338        const None = 0;
339    }
340}
341
342unsafe impl Encode for AVAudioSessionActivationOptions {
343    const ENCODING: Encoding = NSUInteger::ENCODING;
344}
345
346unsafe impl RefEncode for AVAudioSessionActivationOptions {
347    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
348}
349
350/// For use with overrideOutputAudioPort:error:
351///
352/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionportoverride?language=objc)
353// NS_ENUM
354#[repr(transparent)]
355#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
356pub struct AVAudioSessionPortOverride(pub NSUInteger);
357impl AVAudioSessionPortOverride {
358    /// No override.  Return audio routing to the default state for the current audio category.
359    #[doc(alias = "AVAudioSessionPortOverrideNone")]
360    pub const None: Self = Self(0);
361    /// Route audio output to speaker.  Use this override with AVAudioSessionCategoryPlayAndRecord,
362    /// which by default routes the output to the receiver.
363    #[doc(alias = "AVAudioSessionPortOverrideSpeaker")]
364    pub const Speaker: Self = Self(0x73706b72);
365}
366
367unsafe impl Encode for AVAudioSessionPortOverride {
368    const ENCODING: Encoding = NSUInteger::ENCODING;
369}
370
371unsafe impl RefEncode for AVAudioSessionPortOverride {
372    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
373}
374
375/// Values for AVAudioSessionRouteChangeReasonKey in AVAudioSessionRouteChangeNotification's
376/// userInfo dictionary
377///
378/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionroutechangereason?language=objc)
379// NS_ENUM
380#[repr(transparent)]
381#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
382pub struct AVAudioSessionRouteChangeReason(pub NSUInteger);
383impl AVAudioSessionRouteChangeReason {
384    /// The reason is unknown.
385    #[doc(alias = "AVAudioSessionRouteChangeReasonUnknown")]
386    pub const Unknown: Self = Self(0);
387    /// A new device became available (e.g. headphones have been plugged in).
388    #[doc(alias = "AVAudioSessionRouteChangeReasonNewDeviceAvailable")]
389    pub const NewDeviceAvailable: Self = Self(1);
390    /// The old device became unavailable (e.g. headphones have been unplugged).
391    #[doc(alias = "AVAudioSessionRouteChangeReasonOldDeviceUnavailable")]
392    pub const OldDeviceUnavailable: Self = Self(2);
393    /// The audio category has changed (e.g. AVAudioSessionCategoryPlayback has been changed to
394    /// AVAudioSessionCategoryPlayAndRecord).
395    #[doc(alias = "AVAudioSessionRouteChangeReasonCategoryChange")]
396    pub const CategoryChange: Self = Self(3);
397    /// The route has been overridden (e.g. category is AVAudioSessionCategoryPlayAndRecord and
398    /// the output has been changed from the receiver, which is the default, to the speaker).
399    #[doc(alias = "AVAudioSessionRouteChangeReasonOverride")]
400    pub const Override: Self = Self(4);
401    /// The device woke from sleep.
402    #[doc(alias = "AVAudioSessionRouteChangeReasonWakeFromSleep")]
403    pub const WakeFromSleep: Self = Self(6);
404    /// Returned when there is no route for the current category (for instance, the category is
405    /// AVAudioSessionCategoryRecord but no input device is available).
406    #[doc(alias = "AVAudioSessionRouteChangeReasonNoSuitableRouteForCategory")]
407    pub const NoSuitableRouteForCategory: Self = Self(7);
408    /// Indicates that the set of input and/our output ports has not changed, but some aspect of
409    /// their configuration has changed.  For example, a port's selected data source has changed.
410    /// (Introduced in iOS 7.0, watchOS 2.0, tvOS 9.0).
411    #[doc(alias = "AVAudioSessionRouteChangeReasonRouteConfigurationChange")]
412    pub const RouteConfigurationChange: Self = Self(8);
413}
414
415unsafe impl Encode for AVAudioSessionRouteChangeReason {
416    const ENCODING: Encoding = NSUInteger::ENCODING;
417}
418
419unsafe impl RefEncode for AVAudioSessionRouteChangeReason {
420    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
421}
422
423/// Customization of various aspects of a category's behavior. Use with
424/// setCategory:mode:options:error:.
425///
426/// Applications must be prepared for changing category options to fail as behavior may change
427/// in future releases. If an application changes its category, it should reassert the options,
428/// since they are not sticky across category changes. Introduced in iOS 6.0 / watchOS 2.0 /
429/// tvOS 9.0.
430///
431///
432/// Controls whether other active audio apps will be interrupted or mixed with when your app's
433/// audio session goes active. Details depend on the category.
434///
435/// AVAudioSessionCategoryPlayAndRecord or AVAudioSessionCategoryMultiRoute:
436/// MixWithOthers defaults to false, but can be set to true, allowing other applications to
437/// play in the background while your app has both audio input and output enabled.
438///
439/// AVAudioSessionCategoryPlayback:
440/// MixWithOthers defaults to false, but can be set to true, allowing other applications to
441/// play in the background. Your app will still be able to play regardless of the setting
442/// of the ringer switch.
443///
444/// Other categories:
445/// MixWithOthers defaults to false and cannot be changed.
446///
447/// MixWithOthers is only valid with AVAudioSessionCategoryPlayAndRecord,
448/// AVAudioSessionCategoryPlayback, and AVAudioSessionCategoryMultiRoute.
449///
450///
451/// Controls whether or not other active audio apps will be ducked when when your app's audio
452/// session goes active. An example of this is a workout app, which provides periodic updates to
453/// the user. It reduces the volume of any music currently being played while it provides its
454/// status.
455///
456/// Defaults to off. Note that the other audio will be ducked for as long as the current session
457/// is active. You will need to deactivate your audio session when you want to restore full
458/// volume playback (un-duck) other sessions.
459///
460/// Setting this option will also make your session mixable with others
461/// (AVAudioSessionCategoryOptionMixWithOthers will be set).
462///
463/// DuckOthers is only valid with AVAudioSessionCategoryAmbient,
464/// AVAudioSessionCategoryPlayAndRecord, AVAudioSessionCategoryPlayback, and
465/// AVAudioSessionCategoryMultiRoute.
466///
467///
468/// Allows an application to change the default behavior of some audio session categories with
469/// regard to whether Bluetooth Hands-Free Profile (HFP) devices are available for routing. The
470/// exact behavior depends on the category.
471///
472/// AVAudioSessionCategoryPlayAndRecord:
473/// AllowBluetooth defaults to false, but can be set to true, allowing a paired bluetooth
474/// HFP device to appear as an available route for input, while playing through the
475/// category-appropriate output.
476///
477/// AVAudioSessionCategoryRecord:
478/// AllowBluetooth defaults to false, but can be set to true, allowing a paired Bluetooth
479/// HFP device to appear as an available route for input
480///
481/// Other categories:
482/// AllowBluetooth defaults to false and cannot be changed. Enabling Bluetooth for input in
483/// these categories is not allowed.
484///
485///
486/// Allows an application to change the default behavior of some audio session categories with
487/// regard to the audio route. The exact behavior depends on the category.
488///
489/// AVAudioSessionCategoryPlayAndRecord:
490/// DefaultToSpeaker will default to false, but can be set to true, routing to Speaker
491/// (instead of Receiver) when no other audio route is connected.
492///
493/// Other categories:
494/// DefaultToSpeaker is always false and cannot be changed.
495///
496///
497/// When a session with InterruptSpokenAudioAndMixWithOthers set goes active, then if there is
498/// another playing app whose session mode is AVAudioSessionModeSpokenAudio (for podcast
499/// playback in the background, for example), then the spoken-audio session will be
500/// interrupted. A good use of this is for a navigation app that provides prompts to its user:
501/// it pauses any spoken audio currently being played while it plays the prompt.
502///
503/// InterruptSpokenAudioAndMixWithOthers defaults to off. Note that the other app's audio will
504/// be paused for as long as the current session is active. You will need to deactivate your
505/// audio session to allow the other session to resume playback. Setting this option will also
506/// make your category mixable with others (AVAudioSessionCategoryOptionMixWithOthers will be
507/// set). If you want other non-spoken audio apps to duck their audio when your app's session
508/// goes active, also set AVAudioSessionCategoryOptionDuckOthers.
509///
510/// Only valid with AVAudioSessionCategoryPlayAndRecord, AVAudioSessionCategoryPlayback, and
511/// AVAudioSessionCategoryMultiRoute. Introduced in iOS 9.0 / watchOS 2.0 / tvOS 9.0.
512///
513///
514/// Allows an application to change the default behavior of some audio session categories with
515/// regard to whether Bluetooth Advanced Audio Distribution Profile (A2DP) devices are
516/// available for routing. The exact behavior depends on the category.
517///
518/// AVAudioSessionCategoryPlayAndRecord:
519/// AllowBluetoothA2DP defaults to false, but can be set to true, allowing a paired
520/// Bluetooth A2DP device to appear as an available route for output, while recording
521/// through the category-appropriate input.
522///
523/// AVAudioSessionCategoryMultiRoute and AVAudioSessionCategoryRecord:
524/// AllowBluetoothA2DP is false, and cannot be set to true.
525///
526/// Other categories:
527/// AllowBluetoothA2DP is always implicitly true and cannot be changed; Bluetooth A2DP ports
528/// are always supported in output-only categories.
529///
530/// Setting both AVAudioSessionCategoryOptionAllowBluetooth and
531/// AVAudioSessionCategoryOptionAllowBluetoothA2DP is allowed. In cases where a single
532/// Bluetooth device supports both HFP and A2DP, the HFP ports will be given a higher priority
533/// for routing. For HFP and A2DP ports on separate hardware devices, the last-in wins rule
534/// applies.
535///
536/// Introduced in iOS 10.0 / watchOS 3.0 / tvOS 10.0.
537///
538///
539/// Allows an application to change the default behavior of some audio session categories
540/// with regard to showing AirPlay devices as available routes. This option applies to
541/// various categories in the same way as AVAudioSessionCategoryOptionAllowBluetoothA2DP;
542/// see above for details.
543///
544/// Only valid with AVAudioSessionCategoryPlayAndRecord. Introduced in iOS 10.0 / tvOS 10.0.
545///
546///
547/// Some devices include a privacy feature that mutes the built-in microphone at a hardware level
548/// under certain conditions e.g. when the Smart Folio of an iPad is closed. The default behavior is
549/// to interrupt the session using the built-in microphone when that microphone is muted in hardware.
550/// This option allows an application to opt out of the default behavior if it is using a category that
551/// supports both input and output, such as AVAudioSessionCategoryPlayAndRecord, and wants to
552/// allow its session to stay activated even when the microphone has been muted. The result would be
553/// that playback continues as normal, and microphone sample buffers would continue to be produced
554/// but all microphone samples would have a value of zero.
555///
556/// This may be useful if an application knows that it wants to allow playback to continue and
557/// recording/monitoring a muted microphone will not lead to a poor user experience. Attempting to use
558/// this option with a session category that doesn't support the use of audio input will result in an error.
559///
560/// Note that under the default policy, a session will be interrupted if it is running input at the time when
561/// the microphone is muted in hardware. Similarly, attempting to start input when the microphone is
562/// muted will fail.
563/// Note that this option has no relation to the recordPermission property, which indicates whether or
564/// not the user has granted permission to use microphone input.
565///
566/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessioncategoryoptions?language=objc)
567// NS_OPTIONS
568#[repr(transparent)]
569#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
570pub struct AVAudioSessionCategoryOptions(pub NSUInteger);
571bitflags::bitflags! {
572    impl AVAudioSessionCategoryOptions: NSUInteger {
573        #[doc(alias = "AVAudioSessionCategoryOptionMixWithOthers")]
574        const MixWithOthers = 0x1;
575        #[doc(alias = "AVAudioSessionCategoryOptionDuckOthers")]
576        const DuckOthers = 0x2;
577        #[doc(alias = "AVAudioSessionCategoryOptionAllowBluetooth")]
578        const AllowBluetooth = 0x4;
579        #[doc(alias = "AVAudioSessionCategoryOptionDefaultToSpeaker")]
580        const DefaultToSpeaker = 0x8;
581        #[doc(alias = "AVAudioSessionCategoryOptionInterruptSpokenAudioAndMixWithOthers")]
582        const InterruptSpokenAudioAndMixWithOthers = 0x11;
583        #[doc(alias = "AVAudioSessionCategoryOptionAllowBluetoothA2DP")]
584        const AllowBluetoothA2DP = 0x20;
585        #[doc(alias = "AVAudioSessionCategoryOptionAllowAirPlay")]
586        const AllowAirPlay = 0x40;
587        #[doc(alias = "AVAudioSessionCategoryOptionOverrideMutedMicrophoneInterruption")]
588        const OverrideMutedMicrophoneInterruption = 0x80;
589    }
590}
591
592unsafe impl Encode for AVAudioSessionCategoryOptions {
593    const ENCODING: Encoding = NSUInteger::ENCODING;
594}
595
596unsafe impl RefEncode for AVAudioSessionCategoryOptions {
597    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
598}
599
600/// Values for AVAudioSessionInterruptionTypeKey in AVAudioSessionInterruptionNotification's
601/// userInfo dictionary.
602///
603/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessioninterruptiontype?language=objc)
604// NS_ENUM
605#[repr(transparent)]
606#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
607pub struct AVAudioSessionInterruptionType(pub NSUInteger);
608impl AVAudioSessionInterruptionType {
609    /// the system has interrupted your audio session
610    #[doc(alias = "AVAudioSessionInterruptionTypeBegan")]
611    pub const Began: Self = Self(1);
612    /// the interruption has ended
613    #[doc(alias = "AVAudioSessionInterruptionTypeEnded")]
614    pub const Ended: Self = Self(0);
615}
616
617unsafe impl Encode for AVAudioSessionInterruptionType {
618    const ENCODING: Encoding = NSUInteger::ENCODING;
619}
620
621unsafe impl RefEncode for AVAudioSessionInterruptionType {
622    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
623}
624
625/// Values for AVAudioSessionInterruptionOptionKey in AVAudioSessionInterruptionNotification's
626/// userInfo dictionary.
627///
628/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessioninterruptionoptions?language=objc)
629// NS_OPTIONS
630#[repr(transparent)]
631#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
632pub struct AVAudioSessionInterruptionOptions(pub NSUInteger);
633bitflags::bitflags! {
634    impl AVAudioSessionInterruptionOptions: NSUInteger {
635/// Indicates that you should resume playback now that the interruption has ended.
636        #[doc(alias = "AVAudioSessionInterruptionOptionShouldResume")]
637        const ShouldResume = 1;
638    }
639}
640
641unsafe impl Encode for AVAudioSessionInterruptionOptions {
642    const ENCODING: Encoding = NSUInteger::ENCODING;
643}
644
645unsafe impl RefEncode for AVAudioSessionInterruptionOptions {
646    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
647}
648
649/// Values for AVAudioSessionInterruptionReasonKey in AVAudioSessionInterruptionNotification's userInfo dictionary.
650///
651///
652/// The audio session was interrupted because another session was activated.
653///
654///
655/// The audio session was interrupted due to the app being suspended by the operating sytem.
656/// Deprecated. Interruption notifications with reason 'wasSuspended' not present from iOS 16 onwards.
657///
658///
659/// The audio session was interrupted due to the built-in mic being muted e.g. due to an iPad's Smart Folio being closed.
660///
661///
662/// The audio session was interrupted due to route getting disconnected.
663///
664///
665/// The audio session was interrupted due to device being doffed or locked.
666///
667/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessioninterruptionreason?language=objc)
668// NS_ENUM
669#[repr(transparent)]
670#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
671pub struct AVAudioSessionInterruptionReason(pub NSUInteger);
672impl AVAudioSessionInterruptionReason {
673    #[doc(alias = "AVAudioSessionInterruptionReasonDefault")]
674    pub const Default: Self = Self(0);
675    #[doc(alias = "AVAudioSessionInterruptionReasonAppWasSuspended")]
676    #[deprecated = "wasSuspended reason no longer present"]
677    pub const AppWasSuspended: Self = Self(1);
678    #[doc(alias = "AVAudioSessionInterruptionReasonBuiltInMicMuted")]
679    pub const BuiltInMicMuted: Self = Self(2);
680    /// The audio session was interrupted because route was disconnected.
681    #[doc(alias = "AVAudioSessionInterruptionReasonRouteDisconnected")]
682    pub const RouteDisconnected: Self = Self(4);
683}
684
685unsafe impl Encode for AVAudioSessionInterruptionReason {
686    const ENCODING: Encoding = NSUInteger::ENCODING;
687}
688
689unsafe impl RefEncode for AVAudioSessionInterruptionReason {
690    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
691}
692
693/// options for use when calling setActive:withOptions:error:
694///
695/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionsetactiveoptions?language=objc)
696// NS_OPTIONS
697#[repr(transparent)]
698#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
699pub struct AVAudioSessionSetActiveOptions(pub NSUInteger);
700bitflags::bitflags! {
701    impl AVAudioSessionSetActiveOptions: NSUInteger {
702/// Notify an interrupted app that the interruption has ended and it may resume playback. Only
703/// valid on session deactivation.
704        #[doc(alias = "AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation")]
705        const NotifyOthersOnDeactivation = 1;
706    }
707}
708
709unsafe impl Encode for AVAudioSessionSetActiveOptions {
710    const ENCODING: Encoding = NSUInteger::ENCODING;
711}
712
713unsafe impl RefEncode for AVAudioSessionSetActiveOptions {
714    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
715}
716
717/// Values for AVAudioSessionSilenceSecondaryAudioHintTypeKey in
718/// AVAudioSessionSilenceSecondaryAudioHintNotification's userInfo dictionary, to indicate whether
719/// optional secondary audio muting should begin or end.
720///
721/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionsilencesecondaryaudiohinttype?language=objc)
722// NS_ENUM
723#[repr(transparent)]
724#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
725pub struct AVAudioSessionSilenceSecondaryAudioHintType(pub NSUInteger);
726impl AVAudioSessionSilenceSecondaryAudioHintType {
727    /// Another application's primary audio has started.
728    #[doc(alias = "AVAudioSessionSilenceSecondaryAudioHintTypeBegin")]
729    pub const Begin: Self = Self(1);
730    /// Another application's primary audio has stopped.
731    #[doc(alias = "AVAudioSessionSilenceSecondaryAudioHintTypeEnd")]
732    pub const End: Self = Self(0);
733}
734
735unsafe impl Encode for AVAudioSessionSilenceSecondaryAudioHintType {
736    const ENCODING: Encoding = NSUInteger::ENCODING;
737}
738
739unsafe impl RefEncode for AVAudioSessionSilenceSecondaryAudioHintType {
740    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
741}
742
743/// Values to be used by setAggregatedIOPreference:error: method.
744///
745/// Starting in iOS 10, applications that use AVCaptureSession on iPads and iPhones that
746/// support taking Live Photos, will have non-aggregated audio I/O unless the app opts out by
747/// setting its AVAudioSessionIOType to Aggregated. Non-aggregated audio I/O means that separate
748/// threads will be used to service audio I/O for input and output directions.
749///
750/// Note that in cases where the I/O is not aggregated, the sample rate and IO buffer duration
751/// properties will map to the output audio device. In this scenario, the input and
752/// output audio hardware may be running at different sample rates and with different IO buffer
753/// durations. If your app requires input and output audio to be presented in the same realtime
754/// I/O callback, or requires that input and output audio have the same sample rate or IO buffer
755/// duration, or if your app requires the ability to set a preferred sample rate or IO buffer duration
756/// for audio input, set the AVAudioSessionIOType to Aggregated.
757///
758/// Apps that don't use AVCaptureSession and use AVAudioSessionCategoryPlayAndRecord will continue
759/// to have aggregated audio I/O, as in previous versions of iOS.
760///
761///
762/// The default value.  If your app does not use AVCaptureSession or does not have any specific
763/// requirement for aggregating input and output audio in the same realtime I/O callback, use this
764/// value. Note that if your app does not use AVCaptureSession, it will get aggregated I/O when using
765/// AVAudioSessionCategoryPlayAndRecord.
766///
767/// If your app does utilize AVCaptureSession, use of this value will allow AVCaptureSession to
768/// start recording without glitching already running output audio and will allow the system to
769/// utilize power-saving optimizations.
770///
771///
772/// Use this value if your session uses AVAudioSessionCategoryPlayAndRecord and requires input and
773/// output audio to be presented in the same realtime I/O callback. For example, if your app will be using
774/// a RemoteIO with both input and output enabled.
775///
776/// Note that your session's preference to use aggregated IO will not be honored if it specifies
777/// AVAudioSessionCategoryOptionMixWithOthers AND another app's audio session was already active
778/// with non-mixable, non-aggregated input/output.
779///
780/// Added in iOS 10.0. Not applicable on watchos, tvos, macos.
781///
782/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessioniotype?language=objc)
783// NS_ENUM
784#[repr(transparent)]
785#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
786pub struct AVAudioSessionIOType(pub NSUInteger);
787impl AVAudioSessionIOType {
788    #[doc(alias = "AVAudioSessionIOTypeNotSpecified")]
789    pub const NotSpecified: Self = Self(0);
790    #[doc(alias = "AVAudioSessionIOTypeAggregated")]
791    pub const Aggregated: Self = Self(1);
792}
793
794unsafe impl Encode for AVAudioSessionIOType {
795    const ENCODING: Encoding = NSUInteger::ENCODING;
796}
797
798unsafe impl RefEncode for AVAudioSessionIOType {
799    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
800}
801
802/// Starting in iOS 11, tvOS 11, and watchOS 5, the route sharing policy allows a session
803/// to specify that its output audio should be routed somewhere other than the default system output,
804/// when appropriate alternative routes are available.
805///
806/// Follow normal rules for routing audio output.
807///
808/// Route output to the shared long-form audio output. A session whose primary use case is as a
809/// music or podcast player may use this value to play to the same output as the built-in Music (iOS),
810/// Podcasts, or iTunes (macOS) applications. Typically applications that use this policy will also
811/// want sign up for remote control events as documented in “Event Handling Guide for UIKit Apps”
812/// and will want to utilize MediaPlayer framework’s MPNowPlayingInfoCenter class. All applications
813/// on the system that use the long-form audio route sharing policy will have their audio routed to the
814/// same location.
815/// Apps running on watchOS using this policy will also be able to play audio in the background,
816/// as long as an eligible audio route can be activated. Apps running on watchOS using this policy
817/// must use -activateWithOptions:completionHandler: instead of -setActive:withOptions:error: in
818/// order to ensure that the user will be given the opportunity to pick an appropriate audio route
819/// in cases where the system is unable to automatically pick the route.
820///
821/// Deprecated. Replaced by AVAudioSessionRouteSharingPolicyLongFormAudio.
822///
823/// Applications should not attempt to set this value directly. On iOS, this value will be set by
824/// the system in cases where route picker UI is used to direct video to a wireless route.
825///
826/// Route output to the shared long-form video output. A session whose primary use case is as a
827/// movie or other long-form video content player may use this value to play to the same output as
828/// other long-form video content applications such as the built-in TV (iOS) application. Applications
829/// that use this policy will also want to also set the AVInitialRouteSharingPolicy key
830/// in their Info.plist to "LongFormVideo". All applications on the system that use the long-form video
831/// route sharing policy will have their audio and video routed to the same location (e.g. AppleTV when
832/// an AirPlay route is selected). Video content not using this route sharing policy will remain local
833/// to the playback device even when long form video content is being routed to AirPlay.
834///
835/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionroutesharingpolicy?language=objc)
836// NS_ENUM
837#[repr(transparent)]
838#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
839pub struct AVAudioSessionRouteSharingPolicy(pub NSUInteger);
840impl AVAudioSessionRouteSharingPolicy {
841    #[doc(alias = "AVAudioSessionRouteSharingPolicyDefault")]
842    pub const Default: Self = Self(0);
843    #[doc(alias = "AVAudioSessionRouteSharingPolicyLongFormAudio")]
844    pub const LongFormAudio: Self = Self(1);
845    #[doc(alias = "AVAudioSessionRouteSharingPolicyLongForm")]
846    #[deprecated]
847    pub const LongForm: Self = Self(AVAudioSessionRouteSharingPolicy::LongFormAudio.0);
848    #[doc(alias = "AVAudioSessionRouteSharingPolicyIndependent")]
849    pub const Independent: Self = Self(2);
850    #[doc(alias = "AVAudioSessionRouteSharingPolicyLongFormVideo")]
851    pub const LongFormVideo: Self = Self(3);
852}
853
854unsafe impl Encode for AVAudioSessionRouteSharingPolicy {
855    const ENCODING: Encoding = NSUInteger::ENCODING;
856}
857
858unsafe impl RefEncode for AVAudioSessionRouteSharingPolicy {
859    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
860}
861
862/// The prompt style is a hint to sessions that use AVAudioSessionModeVoicePrompt to modify the type of
863/// prompt they play in response to other audio activity on the system, such as Siri or phone calls.
864/// Sessions that issue voice prompts are encouraged to pay attention to changes in the prompt style and
865/// modify their prompts in response. Apple encourages the use of non-verbal prompts when the Short
866/// style is requested.
867///
868/// Indicates that another session is actively using microphone input and would be negatively impacted
869/// by having prompts play at that time. For example if Siri is recognizing speech, having navigation or
870/// exercise prompts play, could interfere with its ability to accurately recognize the user’s speech.
871/// Client sessions should refrain from playing any prompts while the prompt style is None.
872///
873/// Indicates one of three states: Siri is active but not recording, voicemail playback is active, or
874/// voice call is active. Short, non-verbal versions of prompts should be used.
875///
876/// Indicates that normal (long, verbal) versions of prompts may be used.
877///
878/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionpromptstyle?language=objc)
879// NS_ENUM
880#[repr(transparent)]
881#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
882pub struct AVAudioSessionPromptStyle(pub NSUInteger);
883impl AVAudioSessionPromptStyle {
884    #[doc(alias = "AVAudioSessionPromptStyleNone")]
885    pub const None: Self = Self(0x6e6f6e65);
886    #[doc(alias = "AVAudioSessionPromptStyleShort")]
887    pub const Short: Self = Self(0x73687274);
888    #[doc(alias = "AVAudioSessionPromptStyleNormal")]
889    pub const Normal: Self = Self(0x6e726d6c);
890}
891
892unsafe impl Encode for AVAudioSessionPromptStyle {
893    const ENCODING: Encoding = NSUInteger::ENCODING;
894}
895
896unsafe impl RefEncode for AVAudioSessionPromptStyle {
897    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
898}
899
900/// Constants indicating stereo input audio orientation, for use with built-in mic input data sources with a stereo polar pattern selected.
901///
902///
903/// Indicates that audio capture orientation is not applicable (on mono capture, for instance).
904///
905/// Indicates that audio capture should be oriented vertically, Lightning connector on the bottom.
906///
907/// Indicates that audio capture should be oriented vertically, Lightning connector on the top.
908///
909/// Indicates that audio capture should be oriented horizontally, Lightning connector on the right.
910///
911/// Indicates that audio capture should be oriented horizontally, Lightning connector on the left.
912///
913/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiostereoorientation?language=objc)
914// NS_ENUM
915#[repr(transparent)]
916#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
917pub struct AVAudioStereoOrientation(pub NSInteger);
918impl AVAudioStereoOrientation {
919    #[doc(alias = "AVAudioStereoOrientationNone")]
920    pub const None: Self = Self(0);
921    #[doc(alias = "AVAudioStereoOrientationPortrait")]
922    pub const Portrait: Self = Self(1);
923    #[doc(alias = "AVAudioStereoOrientationPortraitUpsideDown")]
924    pub const PortraitUpsideDown: Self = Self(2);
925    #[doc(alias = "AVAudioStereoOrientationLandscapeRight")]
926    pub const LandscapeRight: Self = Self(3);
927    #[doc(alias = "AVAudioStereoOrientationLandscapeLeft")]
928    pub const LandscapeLeft: Self = Self(4);
929}
930
931unsafe impl Encode for AVAudioStereoOrientation {
932    const ENCODING: Encoding = NSInteger::ENCODING;
933}
934
935unsafe impl RefEncode for AVAudioStereoOrientation {
936    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
937}
938
939/// These are the values returned by recordPermission.
940///
941/// The user has not yet been asked for permission.
942///
943/// The user has been asked and has denied permission.
944///
945/// The user has been asked and has granted permission.
946///
947/// Introduced: ios(8.0), watchos(4.0)
948///
949/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionrecordpermission?language=objc)
950// NS_ENUM
951#[repr(transparent)]
952#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
953pub struct AVAudioSessionRecordPermission(pub NSUInteger);
954impl AVAudioSessionRecordPermission {
955    #[doc(alias = "AVAudioSessionRecordPermissionUndetermined")]
956    #[deprecated]
957    pub const Undetermined: Self = Self(0x756e6474);
958    #[doc(alias = "AVAudioSessionRecordPermissionDenied")]
959    #[deprecated]
960    pub const Denied: Self = Self(0x64656e79);
961    #[doc(alias = "AVAudioSessionRecordPermissionGranted")]
962    #[deprecated]
963    pub const Granted: Self = Self(0x67726e74);
964}
965
966unsafe impl Encode for AVAudioSessionRecordPermission {
967    const ENCODING: Encoding = NSUInteger::ENCODING;
968}
969
970unsafe impl RefEncode for AVAudioSessionRecordPermission {
971    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
972}
973
974/// [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionrenderingmode?language=objc)
975// NS_ENUM
976#[repr(transparent)]
977#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
978pub struct AVAudioSessionRenderingMode(pub NSInteger);
979impl AVAudioSessionRenderingMode {
980    /// Default Mode when no asset is loaded or playing
981    #[doc(alias = "AVAudioSessionRenderingModeNotApplicable")]
982    pub const NotApplicable: Self = Self(0);
983    /// Default mode for non multi-channel cases
984    #[doc(alias = "AVAudioSessionRenderingModeMonoStereo")]
985    pub const MonoStereo: Self = Self(1);
986    /// Default mode for multi-channel cases that do not fall into the modes below
987    #[doc(alias = "AVAudioSessionRenderingModeSurround")]
988    pub const Surround: Self = Self(2);
989    /// Fallback mode if provided content is Dolby variant but hardware capabilities don't support it
990    #[doc(alias = "AVAudioSessionRenderingModeSpatialAudio")]
991    pub const SpatialAudio: Self = Self(3);
992    /// Dolby Audio mode
993    #[doc(alias = "AVAudioSessionRenderingModeDolbyAudio")]
994    pub const DolbyAudio: Self = Self(4);
995    /// Dolby Atmos mode
996    #[doc(alias = "AVAudioSessionRenderingModeDolbyAtmos")]
997    pub const DolbyAtmos: Self = Self(5);
998}
999
1000unsafe impl Encode for AVAudioSessionRenderingMode {
1001    const ENCODING: Encoding = NSInteger::ENCODING;
1002}
1003
1004unsafe impl RefEncode for AVAudioSessionRenderingMode {
1005    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1006}
1007
1008/// Various modes to inject audio coming from a session to another app’s input stream
1009///
1010/// Applications can state their intent to mix locally generated audio, which should consist primarily of
1011/// synthesized speech, to another app's input stream. This feature is intended to be used by accessibility apps
1012/// implementing augmentative and alternative communication systems that enable users with disabilities to
1013/// communicate with synthesized speech. When input is muted, microphone injection will also be muted.
1014///
1015/// See also [Apple's documentation](https://developer.apple.com/documentation/avfaudio/avaudiosessionmicrophoneinjectionmode?language=objc)
1016// NS_ENUM
1017#[repr(transparent)]
1018#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1019pub struct AVAudioSessionMicrophoneInjectionMode(pub NSInteger);
1020impl AVAudioSessionMicrophoneInjectionMode {
1021    /// Default state, microphone injection is not preferred
1022    #[doc(alias = "AVAudioSessionMicrophoneInjectionModeNone")]
1023    pub const None: Self = Self(0);
1024    /// Inject Spoken Audio, like synthesized speech, with microphone audio
1025    #[doc(alias = "AVAudioSessionMicrophoneInjectionModeSpokenAudio")]
1026    pub const SpokenAudio: Self = Self(1);
1027}
1028
1029unsafe impl Encode for AVAudioSessionMicrophoneInjectionMode {
1030    const ENCODING: Encoding = NSInteger::ENCODING;
1031}
1032
1033unsafe impl RefEncode for AVAudioSessionMicrophoneInjectionMode {
1034    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1035}