Re: How to use ChannelNames, CategoryNames, NumberNames?
Re: How to use ChannelNames, CategoryNames, NumberNames?
- Subject: Re: How to use ChannelNames, CategoryNames, NumberNames?
- From: Chris Thomas <email@hidden>
- Date: Thu, 6 Jan 2005 15:37:19 -0800
Most excellent. Thank you.
Chris
On Jan 6, 2005, at 2:15 PM, Jeff Moore wrote:
The HAL uses the following patterns to construct the keys to the
dictionary of strings the driver puts in the registry:
#define kIOAudioEngineFullChannelNameKeyInputFormat "InputChannel%u"
#define kIOAudioEngineFullChannelNameKeyOutputFormat "OutputChannel%u"
where the %u is the unsigned integer channel number (channel 0, as
usual, being the master channel). The definitions for the keys appears
to be missing from <IOKit/audio/IOAudioDefines.h>. I have written a
bug up about this.
I think that answers questions 1 & 3. The answer to your second
question is yes. They work pretty much as you describe. The idea is
that an app might use the category name to group a set of channel
strips and then use the number name for each individual strip.
On Jan 6, 2005, at 11:52 AM, Chris Thomas wrote:
OK, cool! Further questions, then:
(1) What's the key? OSDictionaries can only use OSString for key, so
I assume it's an ASCII representation of the absolute channel number
within the engine? So, for example, in a very simple case, you might
have a "number name" dictionary such as:
{{"1" => "1"},
{"2" => "2"},
{"3" => "3"},
{"4" => "4"}}
(2) Should the "number names" correspond directly to the numbers in
the full channel names? For example, say I have these channel names:
{{"1" => "Analog Output 1"},
{"2" => "Analog Output 2"},
{"3" => "S/PDIF Output 1"},
{"4" => "S/PDIF Output 2"}}
Does that mean that the "number names" should be:
{{"1" => "1"},
{"2" => "2"},
{"3" => "1"},
{"4" => "2"}}
(3) IOAudioDefines.h claims these properties should be attached to
the engine, not the streams. If so, how does the HAL disambiguate
input from output channels? Does it assume the input channels are
first?
Thanks,
Chris
On Jan 5, 2005, at 12:28 PM, Jeff Moore wrote:
On Jan 5, 2005, at 10:51 AM, Chris Thomas wrote:
In AudioHardware.h I find these properties:
kAudioDevicePropertyChannelName
kAudioDevicePropertyChannelCategoryName
kAudioDevicePropertyChannelNumberName
And these IORegistry keys in IOAudioDefines.h:
#define kIOAudioEngineFullChannelNamesKey
"IOAudioEngineChannelNames"
#define kIOAudioEngineFullChannelCategoryNamesKey
"IOAudioEngineChannelCategoryNames"
#define kIOAudioEngineFullChannelNumberNamesKey
"IOAudioEngineChannelNumberNames"
What is the intended semantic for these keys? The comments and
HeaderDoc are not ideally descriptive. It sounds like these are
dictionaries of user-readable descriptions for channels, but:
(1) What is Core Audio's definition of a "channel name", "category
name", "number name"?
The channel name is the full name for the channel, i.e. "Analog
Input 3".
The category name is the general category for the channel, i.e.
"Analog Input".
The number name is the name for the number of the channel, i.e. "3".
There are three separate properties for this to allow applications
the freedom to set up their UI as they like. Plus, it gives the
driver maximum flexibility in describing their channels. Note that
these names may have nothing to do with the channel ordering you see
across the device. It is reasonably to expect that a device might
label what would be channel 3 in the HAL API with something that has
no relationship to the number 3 at all.
Digital Performer has a particularly thorough example of using these
properties.
(2) Will Core Audio synthesize names if a driver doesn't have these
keys attached, or does it just return an error in that case?
If the driver doesn't provide names, the HAL doesn't make them up.
These properties will just not exist for such devices.
-- Jeff Moore
Core Audio
Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
audio.com
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:
This email sent to email@hidden