Audio Unit rsrc file and plugin name


#1

Something very strange happened to me while making a copy of an Xcode project I've been working on. 

Basically, I created a new Xcode project called newPlugin with the Introjucer and then copied over all of my code from oldPlugin into the new project. Since I had made a few changes to juce_AudioProcessor and juce_AU_Wrapper.mm in order to add some AU parameter functionality, I decided to copy over the JuceLibraryCode folder as well. Since I unwittingly copied over the AppConfig.h file, when I compiled the project it showed up as oldPlugin in Logic. Bummer, but no big deal - an easy mistake to fix...

But changing the AppConfig.h file didn't solve the problem, and neither did deleting the entire newPlugin project and plugin creating an entire new newPlugin project with the Introjucer and copying over the files by carefully pasting the code into the files in Xcode... the built plugin, named newPlugin.component was still showing up in Logic as oldPlugin

I opened up the component to peak around, and found a funny file called newPlugin.rsrc. When I opened it, I found that this file contained a number of references to oldPlugin, and seemed to be what Logic was reading to load the information about the plugin. Thinking I may have screwed up and copied over some sort of reference to oldPlugin again, I repeated the entire process, naming my new project newPlugin and tried again. Same result - a newplugin.component containing a newPlugin.rsrc file that exclusively mentions oldPlugin

Frustrated, I tried to edit the rsrc file (no luck) and finally decided to scrap the entire newPlugin name and try again naming my project entirelyNewPlugin. Following the exact same steps, I built the plugin and voila! entirelyNewPlugin.component containing an entirelyNewPlugin.rsrc file filled with mentions of entirelyNewPlugin and showing up as entirelyNewPlugin in Logic.

It seems that somehow, when I accidentally built my newPlugin project, the build of that name somehow got permanently linked to a rsrc file for oldplugin. I've been having a hard time understanding what exactly is happening at build time involving rsrc files to cause behavior like this, and am also having a really hard time finding a consistent resource to learn a little bit more about what's happening "under the hood" during AU building... Any ideas?

UPDATE: While writing this post and poking around, it seems as if the problem has spontaneously reversed itself. I've been building the same exact code under a few different names in the exact same way, and just tried building it as newPlugin one more time, and it worked! Very strange. 


Plugin Located in Folder with Company Name Via Installer
#2

I've also often seen strange "stuckness" problems with AUs. My best guess is that it's to do with the OSX component manager stuff which keeps track of all the bundles on your machine and decides which one should be used when an app tries to open a particular AU (which is done by its UID, not by its filename).

Since there's no way to force the OS to refresh its list of components or to make it use or forget a particular bundle, it's very unclear what logic it uses, and I think it can often not realise when a bundle has been rebuilt/moved/replaced/etc.


#3

I think the best approach is to try to delete the various audio-unit related caches (mainly the one at ~/Library/Caches/AudioUnitCache) and re-scan the AU list a few times... It seems like it eventually "clicked" and updated... 


#4

If you change the PluginCode in AppConfig.h the plugin will be treated as a brand new plugin when you are copying it from another one in AU.

#define JucePlugin_PluginCode             'xxxx'

Cheers