Re: Event for plug / unplug headphones?
Re: Event for plug / unplug headphones?
- Subject: Re: Event for plug / unplug headphones?
- From: Jeff Moore <email@hidden>
- Date: Fri, 15 Sep 2006 16:13:35 -0700
On Sep 15, 2006, at 4:08 PM, David M. Cotter wrote:
That implies that the device in question doesn't support a jack
control, which isn't at all unusual.
even for the built in headphone jack on an aluminum PowerBook G4?
Yup. Even for that one.
and if that's the case, shouldn't the "add property listener"
function return an error, like "i can't do this, sorry"?
Nope. Properties can come and go over the life time of a device.
if I"m trying to get the build in headphone jack, is
"kAudioHardwarePropertyDefaultOutputDevice" the proper value?
Not necessarily. That just returns the device that the user has
selected as the default. It may or may not be a built-in device.
On Sep 15, 2006, at 3:55 PM, David M. Cotter wrote:
i did this:
UInt32 dataSize = sizeof(AudioDeviceID);
i_outDeviceID = kAudioDeviceUnknown;
ERR
(AudioHardwareGetProperty
(kAudioHardwarePropertyDefaultOutputDevice, &dataSize, (void
*)&i_outDeviceID));
ERR(AudioDeviceAddPropertyListener(
i_outDeviceID,
kAudioPropertyWildcardChannel,
false,
kAudioDevicePropertyJackIsConnected,
JackPlugged,
this));
and it returns no error, but my function is not called?
_______________________________________________
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
--
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:
This email sent to email@hidden