objc2_phase/generated/
PHASETypes.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/// Update mode for the engine.
9///
10/// The engine update mode determines the rate at which the engine consumes client commands, performs internal updates, and calls any registered handlers.
11/// All API calls to the engine are queued until the engine updates.
12/// The engine update mode determines if the engine or the application triggers the consumption of API commands.
13///
14/// Note: The update mode does not affect the Audio IO Thread or rendering, in general. The Audio IO Thread always runs in the background, independent of the update mode.
15///
16/// The engine will internally consume client commands at a rate opaque to the client.
17/// In general, automatic update mode is meant for simpler applications that just want to play sounds, without having to maintain a strict update loop.
18/// Due to the fact that the engine consumes client commands at its own internal rate, the client is never guaranteed that two independent commands will synchronize.
19///
20/// When an application requires precise synchronization of API calls with the main update, manual mode is the best choice.
21/// In this mode, clients will need to call [PHASEEngine update] periodically to process new commands, perform internal updates, and receive callbacks.
22/// The rate at which the client calls update should at least match the rate at which other time-critical subsystems are updated, such graphics rendering etc.
23/// API calls between calls to [PHASEEngine update] are guaranteed to be synchronized.
24/// For example, the client can move two sources into place, request to start two sound events (one per source), then call [PHASEEngine update].
25/// These calls will be guaranteed to be processed at the same time.
26///
27/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phaseupdatemode?language=objc)
28// NS_ENUM
29#[repr(transparent)]
30#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
31pub struct PHASEUpdateMode(pub NSInteger);
32impl PHASEUpdateMode {
33    #[doc(alias = "PHASEUpdateModeAutomatic")]
34    pub const Automatic: Self = Self(0);
35    #[doc(alias = "PHASEUpdateModeManual")]
36    pub const Manual: Self = Self(1);
37}
38
39unsafe impl Encode for PHASEUpdateMode {
40    const ENCODING: Encoding = NSInteger::ENCODING;
41}
42
43unsafe impl RefEncode for PHASEUpdateMode {
44    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
45}
46
47/// Rendering Mode for a PHASE Engine.
48///
49/// A local engine is connected to an audio device and renders audio in real-time in the application process.
50/// In this mode the engine receives all its inputs from the client such as acoustic configuration.
51/// Updating an engine configured with `PHASERenderingModeLocal` executes any pending API commands locally.
52///
53/// A client engine is connected to an audio device and renders audio in real-time in a secure process.
54/// In this mode the engine receives inputs from the client and renders in a server.
55/// In supported platforms this allows the server to apply privacy sensitive effects such as room virtual acoustics, low latency head-tracking and personalized Spatial Audio.
56/// Updating an engine configured with `PHASERenderingModeClient` syncs any pending API commands to the server for processing.
57///
58/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phaserenderingmode?language=objc)
59// NS_ENUM
60#[repr(transparent)]
61#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
62pub struct PHASERenderingMode(pub NSInteger);
63impl PHASERenderingMode {
64    #[doc(alias = "PHASERenderingModeLocal")]
65    pub const Local: Self = Self(0);
66    #[doc(alias = "PHASERenderingModeClient")]
67    pub const Client: Self = Self(1);
68}
69
70unsafe impl Encode for PHASERenderingMode {
71    const ENCODING: Encoding = NSInteger::ENCODING;
72}
73
74unsafe impl RefEncode for PHASERenderingMode {
75    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
76}
77
78/// Rendering state for sound events.
79///
80/// The sound event is stopped.
81///
82/// The sound event is playing back.
83///
84/// The sound event is paused.
85///
86/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phaserenderingstate?language=objc)
87// NS_ENUM
88#[repr(transparent)]
89#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
90pub struct PHASERenderingState(pub NSInteger);
91impl PHASERenderingState {
92    #[doc(alias = "PHASERenderingStateStopped")]
93    pub const Stopped: Self = Self(0);
94    #[doc(alias = "PHASERenderingStateStarted")]
95    pub const Started: Self = Self(1);
96    #[doc(alias = "PHASERenderingStatePaused")]
97    pub const Paused: Self = Self(2);
98}
99
100unsafe impl Encode for PHASERenderingState {
101    const ENCODING: Encoding = NSInteger::ENCODING;
102}
103
104unsafe impl RefEncode for PHASERenderingState {
105    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
106}
107
108/// Spatialization mode.
109///
110/// Automatically select the spatialization mode based on the current output device.
111///
112/// Always use binaural rendering, whether playing back on headphones or speakers.
113/// Note that when rendering binaural over built-in speakers, special filters are applied to achieve the expected behavior.
114///
115/// Always use the appropriate channel-based panning algorithm for the output layout.
116/// Note that when rendering channel-based over headphones, the sound will play back in stereo.
117///
118/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasespatializationmode?language=objc)
119// NS_ENUM
120#[repr(transparent)]
121#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
122pub struct PHASESpatializationMode(pub NSInteger);
123impl PHASESpatializationMode {
124    #[doc(alias = "PHASESpatializationModeAutomatic")]
125    pub const Automatic: Self = Self(0);
126    #[doc(alias = "PHASESpatializationModeAlwaysUseBinaural")]
127    pub const AlwaysUseBinaural: Self = Self(1);
128    #[doc(alias = "PHASESpatializationModeAlwaysUseChannelBased")]
129    pub const AlwaysUseChannelBased: Self = Self(2);
130}
131
132unsafe impl Encode for PHASESpatializationMode {
133    const ENCODING: Encoding = NSInteger::ENCODING;
134}
135
136unsafe impl RefEncode for PHASESpatializationMode {
137    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
138}
139
140/// Reverb preset
141///
142/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasereverbpreset?language=objc)
143// NS_ENUM
144#[repr(transparent)]
145#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
146pub struct PHASEReverbPreset(pub NSInteger);
147impl PHASEReverbPreset {
148    #[doc(alias = "PHASEReverbPresetNone")]
149    pub const None: Self = Self(0x724e6f6e);
150    #[doc(alias = "PHASEReverbPresetSmallRoom")]
151    pub const SmallRoom: Self = Self(0x7253526d);
152    #[doc(alias = "PHASEReverbPresetMediumRoom")]
153    pub const MediumRoom: Self = Self(0x724d526d);
154    #[doc(alias = "PHASEReverbPresetLargeRoom")]
155    pub const LargeRoom: Self = Self(0x724c5231);
156    #[doc(alias = "PHASEReverbPresetLargeRoom2")]
157    pub const LargeRoom2: Self = Self(0x724c5232);
158    #[doc(alias = "PHASEReverbPresetMediumChamber")]
159    pub const MediumChamber: Self = Self(0x724d4368);
160    #[doc(alias = "PHASEReverbPresetLargeChamber")]
161    pub const LargeChamber: Self = Self(0x724c4368);
162    #[doc(alias = "PHASEReverbPresetMediumHall")]
163    pub const MediumHall: Self = Self(0x724d4831);
164    #[doc(alias = "PHASEReverbPresetMediumHall2")]
165    pub const MediumHall2: Self = Self(0x724d4832);
166    #[doc(alias = "PHASEReverbPresetMediumHall3")]
167    pub const MediumHall3: Self = Self(0x724d4833);
168    #[doc(alias = "PHASEReverbPresetLargeHall")]
169    pub const LargeHall: Self = Self(0x724c4831);
170    #[doc(alias = "PHASEReverbPresetLargeHall2")]
171    pub const LargeHall2: Self = Self(0x724c4832);
172    #[doc(alias = "PHASEReverbPresetCathedral")]
173    pub const Cathedral: Self = Self(0x72437468);
174}
175
176unsafe impl Encode for PHASEReverbPreset {
177    const ENCODING: Encoding = NSInteger::ENCODING;
178}
179
180unsafe impl RefEncode for PHASEReverbPreset {
181    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
182}
183
184extern "C" {
185    /// The NSErrorDomain for general PHASE errors
186    ///
187    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phaseerrordomain?language=objc)
188    pub static PHASEErrorDomain: Option<&'static NSErrorDomain>;
189}
190
191/// General PHASE error codes
192///
193/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phaseerror?language=objc)
194// NS_ERROR_ENUM
195#[repr(transparent)]
196#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
197pub struct PHASEError(pub NSInteger);
198impl PHASEError {
199    #[doc(alias = "PHASEErrorInitializeFailed")]
200    pub const InitializeFailed: Self = Self(0x50484561);
201    #[doc(alias = "PHASEErrorInvalidObject")]
202    pub const InvalidObject: Self = Self(0x50484562);
203}
204
205unsafe impl Encode for PHASEError {
206    const ENCODING: Encoding = NSInteger::ENCODING;
207}
208
209unsafe impl RefEncode for PHASEError {
210    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
211}
212
213extern "C" {
214    /// The NSErrorDomain for PHASE sound event errors.
215    ///
216    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasesoundeventerrordomain?language=objc)
217    pub static PHASESoundEventErrorDomain: Option<&'static NSErrorDomain>;
218}
219
220/// Sound event error.
221///
222/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasesoundeventerror?language=objc)
223// NS_ERROR_ENUM
224#[repr(transparent)]
225#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
226pub struct PHASESoundEventError(pub NSInteger);
227impl PHASESoundEventError {
228    #[doc(alias = "PHASESoundEventErrorNotFound")]
229    pub const NotFound: Self = Self(0x50487461);
230    #[doc(alias = "PHASESoundEventErrorBadData")]
231    pub const BadData: Self = Self(0x50487462);
232    #[doc(alias = "PHASESoundEventErrorInvalidInstance")]
233    pub const InvalidInstance: Self = Self(0x50487463);
234    #[doc(alias = "PHASESoundEventErrorAPIMisuse")]
235    pub const APIMisuse: Self = Self(0x50487464);
236    #[doc(alias = "PHASESoundEventErrorSystemNotInitialized")]
237    pub const SystemNotInitialized: Self = Self(0x50487465);
238    #[doc(alias = "PHASESoundEventErrorOutOfMemory")]
239    pub const OutOfMemory: Self = Self(0x50487466);
240}
241
242unsafe impl Encode for PHASESoundEventError {
243    const ENCODING: Encoding = NSInteger::ENCODING;
244}
245
246unsafe impl RefEncode for PHASESoundEventError {
247    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
248}
249
250extern "C" {
251    /// The NSErrorDomain for PHASE Asset errors
252    ///
253    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phaseasseterrordomain?language=objc)
254    pub static PHASEAssetErrorDomain: Option<&'static NSErrorDomain>;
255}
256
257/// Asset error
258///
259/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phaseasseterror?language=objc)
260// NS_ERROR_ENUM
261#[repr(transparent)]
262#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
263pub struct PHASEAssetError(pub NSInteger);
264impl PHASEAssetError {
265    #[doc(alias = "PHASEAssetErrorFailedToLoad")]
266    pub const FailedToLoad: Self = Self(0x50486161);
267    #[doc(alias = "PHASEAssetErrorInvalidEngineInstance")]
268    pub const InvalidEngineInstance: Self = Self(0x50486162);
269    #[doc(alias = "PHASEAssetErrorBadParameters")]
270    pub const BadParameters: Self = Self(0x50486163);
271    #[doc(alias = "PHASEAssetErrorAlreadyExists")]
272    pub const AlreadyExists: Self = Self(0x50486164);
273    #[doc(alias = "PHASEAssetErrorGeneralError")]
274    pub const GeneralError: Self = Self(0x50486165);
275    #[doc(alias = "PHASEAssetErrorMemoryAllocation")]
276    pub const MemoryAllocation: Self = Self(0x50486166);
277}
278
279unsafe impl Encode for PHASEAssetError {
280    const ENCODING: Encoding = NSInteger::ENCODING;
281}
282
283unsafe impl RefEncode for PHASEAssetError {
284    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
285}
286
287/// Sound event prepare handler reason
288///
289/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasesoundeventpreparehandlerreason?language=objc)
290// NS_ENUM
291#[repr(transparent)]
292#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
293pub struct PHASESoundEventPrepareHandlerReason(pub NSInteger);
294impl PHASESoundEventPrepareHandlerReason {
295    #[doc(alias = "PHASESoundEventPrepareHandlerReasonFailure")]
296    pub const Failure: Self = Self(0);
297    #[doc(alias = "PHASESoundEventPrepareHandlerReasonPrepared")]
298    pub const Prepared: Self = Self(1);
299    #[doc(alias = "PHASESoundEventPrepareHandlerReasonTerminated")]
300    pub const Terminated: Self = Self(2);
301}
302
303unsafe impl Encode for PHASESoundEventPrepareHandlerReason {
304    const ENCODING: Encoding = NSInteger::ENCODING;
305}
306
307unsafe impl RefEncode for PHASESoundEventPrepareHandlerReason {
308    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
309}
310
311/// Sound event start handler reason
312///
313/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasesoundeventstarthandlerreason?language=objc)
314// NS_ENUM
315#[repr(transparent)]
316#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
317pub struct PHASESoundEventStartHandlerReason(pub NSInteger);
318impl PHASESoundEventStartHandlerReason {
319    #[doc(alias = "PHASESoundEventStartHandlerReasonFailure")]
320    pub const Failure: Self = Self(0);
321    #[doc(alias = "PHASESoundEventStartHandlerReasonFinishedPlaying")]
322    pub const FinishedPlaying: Self = Self(1);
323    #[doc(alias = "PHASESoundEventStartHandlerReasonTerminated")]
324    pub const Terminated: Self = Self(2);
325}
326
327unsafe impl Encode for PHASESoundEventStartHandlerReason {
328    const ENCODING: Encoding = NSInteger::ENCODING;
329}
330
331unsafe impl RefEncode for PHASESoundEventStartHandlerReason {
332    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
333}
334
335/// Sound event seek handler reason
336///
337/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasesoundeventseekhandlerreason?language=objc)
338// NS_ENUM
339#[repr(transparent)]
340#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
341pub struct PHASESoundEventSeekHandlerReason(pub NSInteger);
342impl PHASESoundEventSeekHandlerReason {
343    #[doc(alias = "PHASESoundEventSeekHandlerReasonFailure")]
344    pub const Failure: Self = Self(0);
345    #[doc(alias = "PHASESoundEventSeekHandlerReasonFailureSeekAlreadyInProgress")]
346    pub const FailureSeekAlreadyInProgress: Self = Self(1);
347    #[doc(alias = "PHASESoundEventSeekHandlerReasonSeekSuccessful")]
348    pub const SeekSuccessful: Self = Self(2);
349}
350
351unsafe impl Encode for PHASESoundEventSeekHandlerReason {
352    const ENCODING: Encoding = NSInteger::ENCODING;
353}
354
355unsafe impl RefEncode for PHASESoundEventSeekHandlerReason {
356    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
357}
358
359/// Sound event prepare state
360///
361/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasesoundeventpreparestate?language=objc)
362// NS_ENUM
363#[repr(transparent)]
364#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
365pub struct PHASESoundEventPrepareState(pub NSInteger);
366impl PHASESoundEventPrepareState {
367    #[doc(alias = "PHASESoundEventPrepareStatePrepareNotStarted")]
368    pub const PrepareNotStarted: Self = Self(0);
369    #[doc(alias = "PHASESoundEventPrepareStatePrepareInProgress")]
370    pub const PrepareInProgress: Self = Self(1);
371    #[doc(alias = "PHASESoundEventPrepareStatePrepared")]
372    pub const Prepared: Self = Self(2);
373}
374
375unsafe impl Encode for PHASESoundEventPrepareState {
376    const ENCODING: Encoding = NSInteger::ENCODING;
377}
378
379unsafe impl RefEncode for PHASESoundEventPrepareState {
380    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
381}
382
383/// Asset types.
384///
385/// Determines how assets are loaded into memory and prepared for playback.
386/// 'Preparing' an asset for playback may include decompression and/or format conversion,
387/// depending on the type of the underlying asset data.
388///
389/// If the asset is on disk, it is loaded into memory and prepared for playback.
390/// If the asset is in memory, it is prepared for playback.
391///
392/// If the asset is on disk, it is streamed from disk into memory and prepared during playback.
393/// If the asset is in memory, it is streamed from memory and prepared during playback.
394///
395/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phaseassettype?language=objc)
396// NS_ENUM
397#[repr(transparent)]
398#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
399pub struct PHASEAssetType(pub NSInteger);
400impl PHASEAssetType {
401    #[doc(alias = "PHASEAssetTypeResident")]
402    pub const Resident: Self = Self(0);
403    #[doc(alias = "PHASEAssetTypeStreamed")]
404    pub const Streamed: Self = Self(1);
405}
406
407unsafe impl Encode for PHASEAssetType {
408    const ENCODING: Encoding = NSInteger::ENCODING;
409}
410
411unsafe impl RefEncode for PHASEAssetType {
412    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
413}
414
415/// Curve types.
416///
417/// A curve of the form y = x.
418///
419/// A curve of the form y = x^2.
420///
421/// A curve of the form y = 1 / x^2.
422///
423/// A curve of the form y = x^3.
424///
425/// A curve of the form y = 1 / x^3.
426///
427/// A sine curve.
428///
429/// An inverse sine curve.
430///
431/// A sigmoid curve.
432/// Also known as an s-curve, slow at the ends and quick in the middle.
433///
434/// An inverse sigmoid curve.
435/// Also known as an inverse s-curve, quick at the ends and slow in the middle.
436///
437/// Holds the start value for the duration of the curve.
438///
439/// Jumps to the end value and holds it for the duration of the curve.
440///
441/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasecurvetype?language=objc)
442// NS_ENUM
443#[repr(transparent)]
444#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
445pub struct PHASECurveType(pub NSInteger);
446impl PHASECurveType {
447    #[doc(alias = "PHASECurveTypeLinear")]
448    pub const Linear: Self = Self(0x63724c6e);
449    #[doc(alias = "PHASECurveTypeSquared")]
450    pub const Squared: Self = Self(0x63725371);
451    #[doc(alias = "PHASECurveTypeInverseSquared")]
452    pub const InverseSquared: Self = Self(0x63724951);
453    #[doc(alias = "PHASECurveTypeCubed")]
454    pub const Cubed: Self = Self(0x63724375);
455    #[doc(alias = "PHASECurveTypeInverseCubed")]
456    pub const InverseCubed: Self = Self(0x63724943);
457    #[doc(alias = "PHASECurveTypeSine")]
458    pub const Sine: Self = Self(0x6372536e);
459    #[doc(alias = "PHASECurveTypeInverseSine")]
460    pub const InverseSine: Self = Self(0x63724953);
461    #[doc(alias = "PHASECurveTypeSigmoid")]
462    pub const Sigmoid: Self = Self(0x63725367);
463    #[doc(alias = "PHASECurveTypeInverseSigmoid")]
464    pub const InverseSigmoid: Self = Self(0x63724947);
465    #[doc(alias = "PHASECurveTypeHoldStartValue")]
466    pub const HoldStartValue: Self = Self(0x63724853);
467    #[doc(alias = "PHASECurveTypeJumpToEndValue")]
468    pub const JumpToEndValue: Self = Self(0x63724a45);
469}
470
471unsafe impl Encode for PHASECurveType {
472    const ENCODING: Encoding = NSInteger::ENCODING;
473}
474
475unsafe impl RefEncode for PHASECurveType {
476    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
477}
478
479/// Cull option.
480///
481/// Determines what the engine should do when a sound asset becomes cullable.
482///
483/// If cullable, the sound asset will stop. Note that this can occur before or during playback.
484///
485/// If cullable, the sound asset will be put to sleep. Upon waking, start playback at the beginning.
486///
487/// If cullable, the sound asset will be put to sleep. Upon waking, start playback at random offset.
488///
489/// If cullable, the sound asset will be put to sleep. Upon waking, start playback at realtime offset.
490///
491/// If cullable, continue playback, even if the sound is inaudible.
492///
493/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phaseculloption?language=objc)
494// NS_ENUM
495#[repr(transparent)]
496#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
497pub struct PHASECullOption(pub NSInteger);
498impl PHASECullOption {
499    #[doc(alias = "PHASECullOptionTerminate")]
500    pub const Terminate: Self = Self(0);
501    #[doc(alias = "PHASECullOptionSleepWakeAtZero")]
502    pub const SleepWakeAtZero: Self = Self(1);
503    #[doc(alias = "PHASECullOptionSleepWakeAtRandomOffset")]
504    pub const SleepWakeAtRandomOffset: Self = Self(2);
505    #[doc(alias = "PHASECullOptionSleepWakeAtRealtimeOffset")]
506    pub const SleepWakeAtRealtimeOffset: Self = Self(3);
507    #[doc(alias = "PHASECullOptionDoNotCull")]
508    pub const DoNotCull: Self = Self(4);
509}
510
511unsafe impl Encode for PHASECullOption {
512    const ENCODING: Encoding = NSInteger::ENCODING;
513}
514
515unsafe impl RefEncode for PHASECullOption {
516    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
517}
518
519/// Playback mode.
520///
521/// Play the sound asset once, then stop.
522///
523/// Loop the sound asset indefinitely.
524///
525/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phaseplaybackmode?language=objc)
526// NS_ENUM
527#[repr(transparent)]
528#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
529pub struct PHASEPlaybackMode(pub NSInteger);
530impl PHASEPlaybackMode {
531    #[doc(alias = "PHASEPlaybackModeOneShot")]
532    pub const OneShot: Self = Self(0);
533    #[doc(alias = "PHASEPlaybackModeLooping")]
534    pub const Looping: Self = Self(1);
535}
536
537unsafe impl Encode for PHASEPlaybackMode {
538    const ENCODING: Encoding = NSInteger::ENCODING;
539}
540
541unsafe impl RefEncode for PHASEPlaybackMode {
542    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
543}
544
545/// Normalization mode
546///
547/// Determines how sound assets are normalized for calibrated loudness on the output device.
548///
549/// Note: In general, clients are advised to normalize sound assets (and streams).
550/// This will make it easier to mix the content once assigned to a generator with a specified calbration mode and level.
551///
552/// No normalization is applied. In this case, it's advised that the client perform custom normalization.
553///
554/// Dynamic Normalization is applied.
555///
556/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasenormalizationmode?language=objc)
557// NS_ENUM
558#[repr(transparent)]
559#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
560pub struct PHASENormalizationMode(pub NSInteger);
561impl PHASENormalizationMode {
562    #[doc(alias = "PHASENormalizationModeNone")]
563    pub const None: Self = Self(0);
564    #[doc(alias = "PHASENormalizationModeDynamic")]
565    pub const Dynamic: Self = Self(1);
566}
567
568unsafe impl Encode for PHASENormalizationMode {
569    const ENCODING: Encoding = NSInteger::ENCODING;
570}
571
572unsafe impl RefEncode for PHASENormalizationMode {
573    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
574}
575
576/// Calibration mode.
577///
578/// Note: In general, clients are advised use a calibrated input mode. Setting the value to PHASECalibrationModeNone is not advised.
579///
580/// Linear gain with no reference (uncailbrated).
581///
582/// SPL relative to a device-tuned SPL (when available).
583///
584/// Absolute SPL. The system will hit the value 'if it can' (depending on the capabilities of the current output device).
585///
586/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phasecalibrationmode?language=objc)
587// NS_ENUM
588#[repr(transparent)]
589#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
590pub struct PHASECalibrationMode(pub NSInteger);
591impl PHASECalibrationMode {
592    #[doc(alias = "PHASECalibrationModeNone")]
593    pub const None: Self = Self(0);
594    #[doc(alias = "PHASECalibrationModeRelativeSpl")]
595    pub const RelativeSpl: Self = Self(1);
596    #[doc(alias = "PHASECalibrationModeAbsoluteSpl")]
597    pub const AbsoluteSpl: Self = Self(2);
598}
599
600unsafe impl Encode for PHASECalibrationMode {
601    const ENCODING: Encoding = NSInteger::ENCODING;
602}
603
604unsafe impl RefEncode for PHASECalibrationMode {
605    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
606}
607
608/// Automatic Head-Tracking flags.
609///
610/// On capable devices, listener orientation will be automatically rotated based on user's head-orientation.
611///
612/// On capable devices, listener position will be automatically set based on user's position.
613///
614/// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phaseautomaticheadtrackingflags?language=objc)
615// NS_OPTIONS
616#[repr(transparent)]
617#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
618pub struct PHASEAutomaticHeadTrackingFlags(pub NSUInteger);
619bitflags::bitflags! {
620    impl PHASEAutomaticHeadTrackingFlags: NSUInteger {
621        #[doc(alias = "PHASEAutomaticHeadTrackingFlagOrientation")]
622        const Orientation = 1<<0;
623        #[doc(alias = "PHASEAutomaticHeadTrackingFlagPosition")]
624        const Position = 1<<1;
625    }
626}
627
628unsafe impl Encode for PHASEAutomaticHeadTrackingFlags {
629    const ENCODING: Encoding = NSUInteger::ENCODING;
630}
631
632unsafe impl RefEncode for PHASEAutomaticHeadTrackingFlags {
633    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
634}