ClassInfo save and restore in Reverb AU
ClassInfo save and restore in Reverb AU
- Subject: ClassInfo save and restore in Reverb AU
- From: Craig Bakalian <email@hidden>
- Date: Mon, 29 Dec 2003 07:00:18 -0500
Hi,
The below code is working to save and restore the state of apple's
reverb unit
-(void)saveReverbUnitInfoToFile
{
NSString *path = [[NSBundle mainBundle] bundlePath];
NSString *pathWithFile = [path stringByAppendingPathComponent:
@"/ReverbData"];
if(reverbUnit)
{
CFPropertyListRef list;
UInt32 size = sizeof(CFPropertyListRef);
AudioUnitGetProperty(reverbUnit,
kAudioUnitProperty_ClassInfo,kAudioUnitScope_Global, 0, &list, &size);
[NSArchiver archiveRootObject: (NSDictionary *)list toFile:
pathWithFile];
}
}
-(void)restoreReverbUnitFromFile
{
NSString *path = [[NSBundle mainBundle] bundlePath];
NSString *pathWithFile = [path stringByAppendingPathComponent:
@"/ReverbData"];
if( [[NSFileManager defaultManager] fileExistsAtPath: pathWithFile])
{
if(reverbUnit)
{
NSDictionary *dict = [NSUnarchiver unarchiveObjectWithFile:
pathWithFile];
CFPropertyListRef list = (CFPropertyListRef)dict;
UInt32 size = sizeof(CFPropertyListRef);
AudioUnitSetProperty(reverbUnit,
kAudioUnitProperty_ClassInfo,kAudioUnitScope_Global, 0, &list, size);
}
}
}
However, the popup menu for the presets is not updated when my
CarbonView is displayed
err = AudioUnitCarbonViewCreate(editView, editUnit, carbonWindow,
rootControl, &location, &size, &viewPanel);
In the docs I see ways to set? the presets, yet will this update the
popup menu in the AUCarbonView?
Craig Bakalian
www.eThinkingCap.com
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.