Skip to content
Snippets Groups Projects
Commit faf79976 authored by Mnikolenko ProductEngine's avatar Mnikolenko ProductEngine
Browse files

SL-10094 FIXED Mute sound should ONLY mute the viewer's sounds, not the whole...

SL-10094 FIXED Mute sound should ONLY mute the viewer's sounds, not the whole computer's (Mac) sound.
parent baeca410
No related branches found
No related tags found
No related merge requests found
...@@ -337,68 +337,6 @@ std::string LLAppViewerMacOSX::generateSerialNumber() ...@@ -337,68 +337,6 @@ std::string LLAppViewerMacOSX::generateSerialNumber()
return serial_md5; return serial_md5;
} }
static AudioDeviceID get_default_audio_output_device(void)
{
AudioDeviceID device = 0;
UInt32 size = sizeof(device);
AudioObjectPropertyAddress device_address = { kAudioHardwarePropertyDefaultOutputDevice,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster };
OSStatus err = AudioObjectGetPropertyData(kAudioObjectSystemObject, &device_address, 0, NULL, &size, &device);
if(err != noErr)
{
LL_DEBUGS("SystemMute") << "Couldn't get default audio output device (0x" << std::hex << err << ")" << LL_ENDL;
}
return device;
}
//virtual
void LLAppViewerMacOSX::setMasterSystemAudioMute(bool new_mute)
{
AudioDeviceID device = get_default_audio_output_device();
if(device != 0)
{
UInt32 mute = new_mute;
AudioObjectPropertyAddress device_address = { kAudioDevicePropertyMute,
kAudioDevicePropertyScopeOutput,
kAudioObjectPropertyElementMaster };
OSStatus err = AudioObjectSetPropertyData(device, &device_address, 0, NULL, sizeof(mute), &mute);
if(err != noErr)
{
LL_INFOS("SystemMute") << "Couldn't set audio mute property (0x" << std::hex << err << ")" << LL_ENDL;
}
}
}
//virtual
bool LLAppViewerMacOSX::getMasterSystemAudioMute()
{
// Assume the system isn't muted
UInt32 mute = 0;
AudioDeviceID device = get_default_audio_output_device();
if(device != 0)
{
UInt32 size = sizeof(mute);
AudioObjectPropertyAddress device_address = { kAudioDevicePropertyMute,
kAudioDevicePropertyScopeOutput,
kAudioObjectPropertyElementMaster };
OSStatus err = AudioObjectGetPropertyData(device, &device_address, 0, NULL, &size, &mute);
if(err != noErr)
{
LL_DEBUGS("SystemMute") << "Couldn't get audio mute property (0x" << std::hex << err << ")" << LL_ENDL;
}
}
return (mute != 0);
}
void handleUrl(const char* url_utf8) void handleUrl(const char* url_utf8)
{ {
if (url_utf8 && gViewerAppPtr) if (url_utf8 && gViewerAppPtr)
......
...@@ -42,10 +42,6 @@ class LLAppViewerMacOSX : public LLAppViewer ...@@ -42,10 +42,6 @@ class LLAppViewerMacOSX : public LLAppViewer
// //
virtual bool init(); // Override to do application initialization virtual bool init(); // Override to do application initialization
// mute/unmute the system's master audio
virtual void setMasterSystemAudioMute(bool mute);
virtual bool getMasterSystemAudioMute();
protected: protected:
virtual bool restoreErrorTrap(); virtual bool restoreErrorTrap();
virtual void initCrashReporting(bool reportFreeze); virtual void initCrashReporting(bool reportFreeze);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment