how to tell if you can change a data source under program control
how to tell if you can change a data source under program control
- Subject: how to tell if you can change a data source under program control
- From: Michael Thornburgh <email@hidden>
- Date: Thu, 19 Sep 2002 15:17:43 -0700
so, as of jaguar, AppleOnboardAudio devices, such as the ones in
my powermac, lombard powerbook, and imac, now report the presence
of the various output sources, such as the headphones, internal
speaker, external speakers (the apple pro speakers jack), etc.
and the HAL will generate notifications when that changes, like by
plugging in headphones to the headphones jack, or detaching
the pro speakers from the speaker jack.
that's neat!
however, you can't set the output source to the headphones jack
under program control -- the only way to do that is to plug in
headphones.
from a UI perspective, it's dorky to present a choose-the-source
widget that won't do what it looks like it should (see AudioMonitor.app
from MTCoreAudio, running on a jaguar system with multiple-output-source
AppleOnboardAudio hardware. pretty dorky.).
it feels like you ought to be able to use the "isWritable" flag in
Audio{Stream,Device}GetPropertyInfo() for the
kAudioDevicePropertyDataSource
property to see whether or not trying to set that property would do
anything. however, depending on how you ask, you get one of two
wrong answers:
1) asking with AudioDeviceGetPropertyInfo() for the master channel
(0)
seems to just return "YES", even when it can't be set (like,
the "have to plug in the headphones" case).
2) asking for any channel that's not 0, or with
AudioStreamGetPropertyInfo(),
the return value (theStatus) of the function is 'who?', indicating
that the property wasn't recognized.
both of these seem wrong to me, so i submitted a bug report (#3045565),
but got back "behaves correctly." i tried following up to no avail.
so... how can you tell whether the data source can be usefully set?
-mike
_______________________________________________
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.