Skip to content

Commit

Permalink
Follow reviews recommendations.
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel-macaque committed Aug 7, 2017
1 parent 746bdb4 commit bda6a10
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
2 changes: 2 additions & 0 deletions src/AudioToolbox/AudioFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public enum AudioFileType { // UInt32 AudioFileTypeID
AIFF = 0x41494646, // AIFF
AIFC = 0x41494643, // AIFC
WAVE = 0x57415645, // WAVE
[NoWatch, iOS (11,0), Mac(10,13), TV (11,0)]
RF64 = 0x52463634, // RF64
SoundDesigner2 = 0x53643266, // Sd2f
Next = 0x4e655854, // NeXT
Expand All @@ -61,6 +62,7 @@ public enum AudioFileType { // UInt32 AudioFileTypeID
ThreeGP = 0x33677070, // 3gpp
ThreeGP2 = 0x33677032, // 3gp2
AMR = 0x616d7266, // amrf
[NoWatch, iOS (11,0), Mac(10,13), TV (11,0)]
FLAC = 0x666c6163, // flac
}

Expand Down
23 changes: 10 additions & 13 deletions src/AudioUnit/AudioComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,13 @@ public ResourceUsageInfo ResourceUsage {
}
}

public NSString[] Tags {
public string[] Tags {
get {
return GetArray<NSString> (tagsK);
var array = GetNativeValue<NSArray> (tagsK);
return NSArray.StringArrayFromHandle (array.ClassHandle);
}
set {
SetArrayValue <NSString> (tagsK, value);
SetArrayValue (tagsK, value);
}
}
}
Expand Down Expand Up @@ -380,18 +381,18 @@ public XamCore.AppKit.NSImage GetIcon ()
}
#endif
[NoWatch, NoTV, Mac (10,13), iOS (11,0)]
[DllImport (Constants.AudioUnitLibrary, EntryPoint = "AudioUnitExtensionSetComponentList")]
static extern int /* OSStatus */ SetComponentList (IntPtr /* CFString */ extensionIdentifier, /* CFArrayRef */ IntPtr audioComponentInfo);
[DllImport (Constants.AudioUnitLibrary)]
static extern int /* OSStatus */ AudioUnitExtensionSetComponentList (IntPtr /* CFString */ extensionIdentifier, /* CFArrayRef */ IntPtr audioComponentInfo);

[NoWatch, NoTV, Mac (10,13), iOS (11,0)]
[DllImport (Constants.AudioUnitLibrary, EntryPoint = "AudioUnitExtensionCopyComponentList")]
static extern /* CFArrayRef */ IntPtr CopyComponentList (IntPtr /* CFString */ extensionIdentifier);
[DllImport (Constants.AudioUnitLibrary)]
static extern /* CFArrayRef */ IntPtr AudioUnitExtensionCopyComponentList (IntPtr /* CFString */ extensionIdentifier);

[NoWatch, NoTV, Mac (10,13), iOS (11,0)]
public AudioComponentInfo[] ComponentList {
get {
using (var cfString = new CFString (Name)) {
var cHandle = CopyComponentList (cfString.Handle);
var cHandle = AudioUnitExtensionCopyComponentList (cfString.Handle);
if (cHandle == IntPtr.Zero)
return null;
using (var nsArray = Runtime.GetNSObject<NSArray> (cHandle, owns: true)) {
Expand All @@ -414,12 +415,8 @@ public AudioComponentInfo[] ComponentList {
dics [i] = value [i].Dictionary;
}
using (var array = NSArray.FromNSObjects (dics)) {
var result = (AudioConverterError) SetComponentList (cfString.Handle, array.Handle);
var result = (AudioConverterError) AudioUnitExtensionSetComponentList (cfString.Handle, array.Handle);
switch (result) {
case AudioConverterError.HardwareInUse:
throw new InvalidOperationException ("ComponentList could not be set: 'Hardware is in use.'");
case AudioConverterError.NoHardwarePermission:
throw new InvalidOperationException ("ComponentList could not be set: 'No Hardware permission.'");
case AudioConverterError.None:
return;
default:
Expand Down
3 changes: 1 addition & 2 deletions src/audiounit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,7 @@ interface AUParameter : NSSecureCoding
[Export ("setValue:originator:atHostTime:eventType:")]
void SetValue (float value, IntPtr originator, ulong hostTime, AUParameterAutomationEventType eventType);

[iOS (10,0), Mac (10,12, onlyOn64 : true), Watch (4, 0), TV (11, 0)]
[TV (10,0)]
[iOS (10,0), Mac (10,12, onlyOn64 : true), Watch (4, 0), TV (10, 0)]
[Wrap ("SetValue (value, originator.ObserverToken, hostTime, eventType)")]
void SetValue (float value, AUParameterObserverToken originator, ulong hostTime, AUParameterAutomationEventType eventType);
}
Expand Down

0 comments on commit bda6a10

Please sign in to comment.