Skip to content

Commit

Permalink
[AudioUnit] Cleanup ifdefs in AUEnums.
Browse files Browse the repository at this point in the history
The ifdefs here were confusing, so I cleaned them up a bit.

Note that No* attributes in enum members won't prevent the enum members from
being generated, they'll just get an unavailable attribute, so adding No*
attributes to an enum member is not a breaking change (which allows for some
of this cleanup).

Contributes towards xamarin#14802.
  • Loading branch information
rolfbjarne committed Jan 17, 2023
1 parent 7d02fa6 commit 3fc82db
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions src/AudioUnit/AUEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ public enum AudioUnitClumpID // UInt32 in AudioUnitParameterInfo
System = 0,
}

#if !XAMCORE_3_0 || MONOMAC || __MACCATALYST__
[MacCatalyst (13, 1)]
[NoTV, NoWatch]
#if NET
[NoiOS]
#endif
public enum AudioObjectPropertySelector : uint {
PropertyDevices = 1684370979, // 'dev#'
Devices = 1684370979, // 'dev#'
Expand All @@ -189,20 +193,16 @@ public enum AudioObjectPropertySelector : uint {
TranslateUIDToBox = 1969841250, // 'uidb'
ClockDeviceList = 1668049699, //'clk#'
TranslateUidToClockDevice = 1969841251, // 'uidc',
#if XAMCORE_3_0
[NoiOS][NoTV]
#endif
#if !XAMCORE_5_0
[MacCatalyst (13, 1)] // This is required for .NET, because otherwise the generator thinks it's not available because it's not available on iOS.
[Deprecated (PlatformName.iOS, 15, 0, message: "Use the 'ProcessIsMain' element instead.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Use the 'ProcessIsMain' element instead.")]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use the 'ProcessIsMain' element instead.")]
[Deprecated (PlatformName.MacOSX, 12, 0, message: "Use the 'ProcessIsMain' element instead.")]
[Obsolete ("Use the 'ProcessIsMain' element instead.")]
ProcessIsMaster = 1835103092, // 'mast'
#if !XAMCORE_3_0
[iOS (15, 0)]
#else
#endif // !XAMCORE_5_0
[NoiOS]
#endif
[MacCatalyst (15, 0), Mac (12, 0), NoTV, NoWatch]
ProcessIsMain = 1835100526, // 'main'
IsInitingOrExiting = 1768845172, // 'inot'
Expand All @@ -217,30 +217,35 @@ public enum AudioObjectPropertySelector : uint {
ActualSampleRate = 1634955892,// 'asrt',
ClockDevice = 1634755428, // 'apcd',
IOThreadOSWorkgroup = 1869838183, // 'oswg'
#if !XAMCORE_3_0
[iOS (15, 0)]
#else
[NoiOS]
#endif
[MacCatalyst (15, 0), Mac (12, 0), NoTV, NoWatch]
ProcessMute = 1634758765, // 'appm'
}

[MacCatalyst (13, 1)]
[NoTV, NoWatch]
#if NET
[NoiOS]
#endif
public enum AudioObjectPropertyScope : uint {
Global = 1735159650, // 'glob'
Input = 1768845428, // 'inpt'
Output = 1869968496, // 'outp'
PlayThrough = 1886679669, // 'ptru'
}

[MacCatalyst (13, 1)]
[NoTV, NoWatch]
#if NET
[NoiOS]
#endif
public enum AudioObjectPropertyElement : uint {
#if !NET
[Obsolete ("Use the 'Main' element instead.")]
Master = 0, // 0
#endif
Main = 0, // 0
}
#endif // !XAMCORE_3_0 || MONOMAC

#if XAMCORE_3_0
[Internal]
Expand Down

0 comments on commit 3fc82db

Please sign in to comment.