Re: Getting name of AudioUnit host
Re: Getting name of AudioUnit host
- Subject: Re: Getting name of AudioUnit host
- From: William Stewart <email@hidden>
- Date: Mon, 26 Mar 2007 15:41:54 -0700
This is not reliable.
The first check you should make is the value of the
kAudioUnitProperty_AUHostIdentifier (the value is defined as 46 for
this propertyID) property.
Not all hosts set this, but the ones that do will provide the
following information:
/*!
@struct AUHostIdentifier
@abstract Used to describe the name and version of the audio unit's
host
*/
typedef struct AUHostIdentifier {
CFStringRef hostName;
NumVersion hostVersion;
} AUHostIdentifier;
Here are the comments that accompany this property in the Leopard
header:
Determine which application (and which version) an audio unit is
being hosted by.
This is made more complex through the intervention of audio units
such as Kore, that are hosting
other audio units (in this case of course, the real host of the audio
unit is the hosting unit,
not the host application, so the previous mechanism of getting the
main bundle ID is no longer
correct).
There are also inconsistencies in the way that bundle identifiers are
applied (with apps changing
these from version to version), and we'd prefer to see a more
consistent identifier used with
this property. This is in spirit similar to the string returned by
CFBundle API, except that we
require this host string be consistent and reliable through different
revisions of the host.
The audio unit is responsible for retaining the hostName string if it
needs to use it past the
duration of the actual call. The host should set this property as
early as possible within the
lifetime of the unit in a session.
If the property is not set on you, then you can use the CF version as
described below
Bill
On 25/03/2007, at 11:42 PM, Aulis Telle wrote:
Here the CoreFoundation equivalent:
CFStringRef identifier;
CFBundleRef mainBundle = CFBundleGetMainBundle();
if (mainBundle)
{
identifier = CFBundleGetIdentifier(mainBundle);
mHostIsPlogue = (CFStringCompare(identifier,CFSTR
("com.plogue.bidule") , 0) == kCFCompareEqualTo);
}
Aulis
Am 26.03.2007 um 01:01 schrieb Antoine Missout:
NSBundle *mainBundle = [NSBundle mainBundle];
if (mainBundle)
mHostIsPlogue = [[mainBundle bundleIdentifier]
isEqual:@"com.plogue.bidule"];
I'm sure there is an equivalent in CoreFoundation.
On 24-Mar-07, at 12:33 PM, Michael Ljunggren wrote:
Hi,
My AU plug-in is working well in most AU hosts, but not all. The
GUI has a few problems
on some hosts. I am able to "workaround" the personalities of
such funny hosts but only
if I know which host it is. I.e I can't have The One Code that
works for all hosts.
I have come to the situation where I think knowing the AU host is
the only way for me
to go forward.
Is there a way to figure out which AU host I am currently running
under; Logic, Garageband, DP etc...?
Any API such as AUBase::getHostNameAndVersion() ;-) This is
available in the VST standard so I guess
it is available here too?
/Michael Ljunggren
Alien Connections
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40rwth-aachen.de
This email sent to email@hidden
--
Aulis Telle
email@hidden
_______________________________________________
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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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