My contact with Audio Unit development is very recent. I have only done one plugin so far. Now I'm trying to generalize the common parts so I can easily make more plugins.
There is a warning on the top of all Cocoa files of the Audio Unit samples saying:
// It is important to rename ALL ui classes when using the XCode Audio Unit with Cocoa View template
// Cocoa has a flat namespace, and if you use the default filenames, it is possible that you will
// get a namespace collision with classes from the cocoa view of a previously loaded audio unit.
I think I have been facing myself with this issue now that I'm trying to generalize the common parts. For instance, I have the following two classes: IAuView, IAuViewFactory. I was trying to make something extend this classes by simply making something like:
Code: Select all
// XPTOAuView.h
#include "IAuView.h"
@interface XPTOView : IAuView
{
}
// XPTOAuViewFactory.h
#include "IAuViewFactory.h"
@interface XPTOView : IAuViewFactory
{
}
If I use IAuViewFactory to create the UI of the new plugin, the one I had already doesn't even open the Window so I think I'm feeling the pain of Cocoa flat namespace.
What is the solution for this problem? I don't want to replicate files with the same content every time I make a plugin. Why doesn't inheritance work on Cocoa? What am I doing wrong?