• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Modifying basic AU to create view without NIB?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Modifying basic AU to create view without NIB?


  • Subject: Modifying basic AU to create view without NIB?
  • From: Howard Moon <email@hidden>
  • Date: Fri, 21 Jan 2011 12:21:33 -0800

Hi all,

I'm just getting familiar with Cocoa and Objective-C, and my first desire is to replace the NIB-loaded view class with a view I create in code.  I've been trying to find a simple example of this, but am having a lot of trouble doing so.

One task it seems I need to tackle is in the main AUEffectBase-derived class... I need to modify the code in GetProperty for the kAudioUnitProperty_CocoaUI.  The existing code is like this:

case kAudioUnitProperty_CocoaUI:
{
// Look for a resource in the main bundle by name and type.
CFBundleRef bundle = CFBundleGetBundleWithIdentifier( CFSTR("com.audiounit.TestAU") );


if (bundle == NULL) return fnfErr;

                

CFURLRef bundleURL = CFBundleCopyResourceURL( bundle, 
                  CFSTR("TestAU_CocoaViewFactory"), 
                  CFSTR("bundle"), 
                    NULL);

                

if (bundleURL == NULL) return fnfErr;

AudioUnitCocoaViewInfo cocoaInfo;
cocoaInfo.mCocoaAUViewBundleLocation = bundleURL;
cocoaInfo.mCocoaAUViewClass[0] = CFStringCreateWithCString(NULL, "TestAU_CocoaViewFactory", kCFStringEncodingUTF8);


*((AudioUnitCocoaViewInfo *)outData) = cocoaInfo;


return noErr;
}

Since removing the .xib file from the project, the CFBundleCopyResourceURL returns nil.  So what would I do here in order to use a custom view without a nib?  How do I fill iin the AudioUnitCocoaViewInfo structure?

(Obviously, I need to modify the factory, and I've also added a initWithFrame: function to the view, but at the moment I'm dealing with this property.)

Is there a simple example somewhere of an AU using a custom view created in code?

Thanks,
Howard

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Modifying basic AU to create view without NIB?
      • From: Kyle Sluder <email@hidden>
    • Re: Modifying basic AU to create view without NIB?
      • From: Brian Willoughby <email@hidden>
  • Prev by Date: Question about compiling the SampleUSBAudioPlugin
  • Next by Date: Re: Modifying basic AU to create view without NIB?
  • Previous by thread: Re: Fw: Question about compiling the SampleUSBAudioPlugin
  • Next by thread: Re: Modifying basic AU to create view without NIB?
  • Index(es):
    • Date
    • Thread