Re: My mute program kills volume, but menubar doesn't show it
Re: My mute program kills volume, but menubar doesn't show it
- Subject: Re: My mute program kills volume, but menubar doesn't show it
- From: Gabriel Berriz <email@hidden>
- Date: Wed, 27 May 2009 07:45:59 -0400
Jeff, thank you very much! Your suggestion worked beautifully. And
the code is considerably simpler to boot:
void setSystemMute(UInt32 mute) {
OSStatus status;
AudioDeviceID device;
status = GetDefaultAudioDevice(&device);
require_noerr(status, ReturnStatus);
UInt32 size = sizeof(mute);
status = AudioDeviceSetProperty(device, NULL, 0, false,
kAudioDevicePropertyMute, size, &mute);
require_noerr(status, ReturnStatus);
ReturnStatus:
return;
}
On Tue, May 26, 2009 at 4:10 PM, Jeff Moore <email@hidden> wrote:
> Most likely, this means that you have one of our more recent bits of
> hardware. The newer hardware has a master mute control in addition to the
> per-channel mute controls. It appears from empirical testing that the menu
> bar widget and the Sound Prefs panel both use the global mute control to
> inform the UI state.
>
> Since your code is not manipulating the master mute control (aka channel 0),
> just the individual channel mutes, the UI is not updating. The fix for this
> is quite simple, just add a call to set the kAudioDevicePropertyMute on
> channel 0.
I'm curious, how general is this strategy? Would this work on other
machines running OS X?
Also, I'd be curious to know the most efficient reading I could have
done to figure out that muting channel 0 was the way to go. What you
wrote about channel 0 looks like very basic, fundamental stuff, and
yet I didn't come across it when I was looking for ways to solve the
problem... I managed to miss it somehow. I find that the Apple docs
on audio is a huge amount of stuff and it's difficult to know where to
begin.
Again, thanks a ton for your help!
G.
_______________________________________________
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