Skip to content

Commit

Permalink
[CoreAudioKit] Fix macOS xtro output (#3508)
Browse files Browse the repository at this point in the history
* [CoreAudioKit] Fix macOS xtro output

* Fix Midi typo

* Add trailing comma to enum value
  • Loading branch information
dalexsoto committed Feb 16, 2018
1 parent 7c88610 commit 78650fb
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 14 deletions.
89 changes: 89 additions & 0 deletions src/coreaudiokit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,24 @@
#else
using UIKit;
using AUViewControllerBase = UIKit.UIViewController;
using NSView = Foundation.NSObject;
using NSWindow = Foundation.NSObject;
using NSWindowController = Foundation.NSObject;
using NSViewController = Foundation.NSObject;
#endif

namespace CoreAudioKit {
#if XAMCORE_2_0 || !MONOMAC

[NoiOS]
[Mac (10,11, onlyOn64 : true)]
[Flags]
public enum AUGenericViewDisplayFlags : uint {
TitleDisplay = 1u << 0,
PropertiesDisplay = 1u << 1,
ParametersDisplay = 1u << 2,
}

[iOS (9,0)][Mac (10,11, onlyOn64 : true)]
[BaseType (typeof(AUViewControllerBase))]
interface AUViewController {
Expand Down Expand Up @@ -60,6 +74,81 @@ interface AUAudioUnitViewControllerExtensions {
[Export ("selectViewConfiguration:")]
void SelectViewConfiguration (AUAudioUnitViewConfiguration viewConfiguration);
}

[NoiOS]
[Mac (10,13, onlyOn64: true)]
[Protocol]
interface AUCustomViewPersistentData {

[Abstract]
[NullAllowed, Export ("customViewPersistentData", ArgumentSemantic.Assign)]
NSDictionary<NSString, NSObject> CustomViewPersistentData { get; set; }
}

[NoiOS]
[Mac (10,13, onlyOn64: true)]
[DisableDefaultCtor] // Crashes
[BaseType (typeof (NSView))]
interface AUGenericView : AUCustomViewPersistentData {

[Export ("audioUnit")]
AudioUnit.AudioUnit AudioUnit { get; }

[Export ("showsExpertParameters")]
bool ShowsExpertParameters { get; set; }

[Export ("initWithAudioUnit:")]
IntPtr Constructor (AudioUnit.AudioUnit au);

[Export ("initWithAudioUnit:displayFlags:")]
IntPtr Constructor (AudioUnit.AudioUnit au, AUGenericViewDisplayFlags inFlags);
}

[NoiOS]
[Mac (10,13, onlyOn64: true)]
[BaseType (typeof (NSView))]
[DisableDefaultCtor]
interface AUPannerView {

[Export ("audioUnit")]
AudioUnit.AudioUnit AudioUnit { get; }

[Static]
[Export ("AUPannerViewWithAudioUnit:")]
AUPannerView Create (AudioUnit.AudioUnit au);
}

[NoiOS]
[Mac (10,13, onlyOn64: true)]
[BaseType (typeof (NSWindowController), Name = "CABTLEMIDIWindowController")]
interface CABtleMidiWindowController {

[Export ("initWithWindow:")]
IntPtr Constructor ([NullAllowed] NSWindow window);
}

[NoiOS]
[Mac (10,13, onlyOn64: true)]
[BaseType (typeof (NSViewController))]
interface CAInterDeviceAudioViewController {

[Export ("initWithNibName:bundle:")]
IntPtr Constructor ([NullAllowed] string nibNameOrNull, [NullAllowed] NSBundle nibBundleOrNull);
}

[NoiOS]
[Mac (10,13, onlyOn64: true)]
[DesignatedDefaultCtor]
[BaseType (typeof (NSWindowController))]
interface CANetworkBrowserWindowController {

[Export ("initWithWindow:")]
IntPtr Constructor ([NullAllowed] NSWindow window);

[Static]
[Export ("isAVBSupported")]
bool IsAvbSupported { get; }
}
#endif

#if !MONOMAC
Expand Down
5 changes: 5 additions & 0 deletions tests/introspection/ApiCtorInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@ protected virtual bool Match (ConstructorInfo ctor, Type type)
if (ctor.ToString () == "Void .ctor()")
return true;
break;
case "AUPannerView": // Do not make sense without the AudioUnit
case "AUGenericView": // Do not make sense without the AudioUnit
if (ctor.ToString () == "Void .ctor(CGRect)")
return true;
break;
case "MDLNoiseTexture":
case "MDLSkyCubeTexture":
case "MDLNormalMapTexture":
Expand Down
2 changes: 2 additions & 0 deletions tests/introspection/ApiTypoTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public virtual bool Skip (MemberInfo methodName, string typo) {
"Autospace",
"Autostarts",
"Avci", // file type
"Avb", // acronym: Audio Video Bridging
"Aliasable",
"Arcball",
"Avg",
Expand All @@ -123,6 +124,7 @@ public virtual bool Skip (MemberInfo methodName, string typo) {
"Bggr", // acronym for Blue, Green, Green, Red
"Bsln",
"Bssid",
"Btle", // Bluetooth Low Energy
"Bzip",
"Cabac",
"Caf", // acronym: Core Audio Format
Expand Down
14 changes: 0 additions & 14 deletions tests/xtro-sharpie/macOS-CoreAudioKit.todo
Original file line number Diff line number Diff line change
@@ -1,14 +0,0 @@
!missing-enum! AUGenericViewDisplayFlags not bound
!missing-protocol! AUCustomViewPersistentData not bound
!missing-selector! +AUPannerView::AUPannerViewWithAudioUnit: not bound
!missing-selector! AUGenericView::audioUnit not bound
!missing-selector! AUGenericView::initWithAudioUnit: not bound
!missing-selector! AUGenericView::initWithAudioUnit:displayFlags: not bound
!missing-selector! AUGenericView::setShowsExpertParameters: not bound
!missing-selector! AUGenericView::showsExpertParameters not bound
!missing-selector! AUPannerView::audioUnit not bound
!missing-type! AUGenericView not bound
!missing-type! AUPannerView not bound
!missing-type! CABTLEMIDIWindowController not bound
!missing-type! CAInterDeviceAudioViewController not bound
!missing-type! CANetworkBrowserWindowController not bound

0 comments on commit 78650fb

Please sign in to comment.