aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelaudiovolume.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:27 -0500
committerJacek Antonelli2008-08-15 23:45:27 -0500
commita8a62201ba762e98dff92cf49033e577fc34d8d4 (patch)
tree11f8513c5cdc222f2fac0c93eb724c089803c200 /linden/indra/newview/llpanelaudiovolume.cpp
parentSecond Life viewer sources 1.18.6.4-RC (diff)
downloadmeta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.zip
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.gz
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.bz2
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.xz
Second Life viewer sources 1.19.0.0
Diffstat (limited to 'linden/indra/newview/llpanelaudiovolume.cpp')
-rw-r--r--linden/indra/newview/llpanelaudiovolume.cpp85
1 files changed, 51 insertions, 34 deletions
diff --git a/linden/indra/newview/llpanelaudiovolume.cpp b/linden/indra/newview/llpanelaudiovolume.cpp
index 6900bad..522f73f 100644
--- a/linden/indra/newview/llpanelaudiovolume.cpp
+++ b/linden/indra/newview/llpanelaudiovolume.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -38,35 +38,6 @@
38#include "llvieweruictrlfactory.h" 38#include "llvieweruictrlfactory.h"
39 39
40//////////////////////////////////////////////////////////////////////////////// 40////////////////////////////////////////////////////////////////////////////////
41// Floater version of audio panel
42//
43
44//static
45void* LLFloaterAudioVolume::createVolumePanel(void* data)
46{
47 LLPanelAudioVolume* panel = new LLPanelAudioVolume();
48 return panel;
49}
50
51LLFloaterAudioVolume::LLFloaterAudioVolume(const LLSD& seed)
52{
53 mFactoryMap["Volume Panel"] = LLCallbackMap(createVolumePanel, NULL);
54 gUICtrlFactory->buildFloater(this, "floater_audio_volume.xml", &getFactoryMap());
55
56 S32 pos_x = mRect.mLeft;
57 S32 pos_y = mRect.mBottom;
58 LLView* volume_panel_view = gOverlayBar->getChildByName("master_volume");
59 if (volume_panel_view)
60 {
61 pos_x = volume_panel_view->getRect().mLeft;
62 pos_y = volume_panel_view->getRect().mTop;
63 }
64
65 setOrigin(pos_x, pos_y);
66 gFloaterView->adjustToFitScreen(this, FALSE);
67}
68
69////////////////////////////////////////////////////////////////////////////////
70// 41//
71// 42//
72LLPanelAudioVolume::LLPanelAudioVolume() 43LLPanelAudioVolume::LLPanelAudioVolume()
@@ -75,6 +46,13 @@ LLPanelAudioVolume::LLPanelAudioVolume()
75 46
76BOOL LLPanelAudioVolume::postBuild() 47BOOL LLPanelAudioVolume::postBuild()
77{ 48{
49 childSetCommitCallback("System Volume", onCommitVolumeChange);
50 childSetCommitCallback("Music Volume", onCommitVolumeChange);
51 childSetCommitCallback("Media Volume", onCommitVolumeChange);
52 childSetCommitCallback("Voice Volume", onCommitVolumeChange);
53 childSetCommitCallback("SFX Volume", onCommitVolumeChange);
54 childSetCommitCallback("UI Volume", onCommitVolumeChange);
55 childSetCommitCallback("Wind Volume", onCommitVolumeChange);
78 return TRUE; 56 return TRUE;
79} 57}
80 58
@@ -87,18 +65,57 @@ LLPanelAudioVolume::~LLPanelAudioVolume ()
87// 65//
88void LLPanelAudioVolume::draw() 66void LLPanelAudioVolume::draw()
89{ 67{
90// LLOverlayBar::enableMusicButtons(this);
91// LLOverlayBar::enableMediaButtons(this);
92 BOOL mute = gSavedSettings.getBOOL("MuteAudio"); 68 BOOL mute = gSavedSettings.getBOOL("MuteAudio");
93 bool enable = mute ? false : true; 69 bool enable = mute ? false : true;
94 childSetEnabled("System Volume", enable);
95 childSetEnabled("Music Volume", enable); 70 childSetEnabled("Music Volume", enable);
96 childSetEnabled("Media Volume", enable); 71 childSetEnabled("Media Volume", enable);
97 childSetEnabled("Voice Volume", enable); 72 childSetEnabled("Voice Volume", enable);
98 childSetEnabled("SFX Volume", enable); 73 childSetEnabled("SFX Volume", enable);
99 childSetEnabled("UI Volume", enable); 74 childSetEnabled("UI Volume", enable);
100 childSetEnabled("Wind Volume", enable); 75 childSetEnabled("Wind Volume", enable);
76
77 childSetEnabled("mute_music", enable);
78 childSetEnabled("mute_media", enable);
79 childSetEnabled("mute_voice", enable);
80 childSetEnabled("mute_sfx", enable);
81 childSetEnabled("mute_wind", enable);
82 childSetEnabled("mute_ui", enable);
83
101 LLPanel::draw(); 84 LLPanel::draw();
102} 85}
103 86
87//static
88void LLPanelAudioVolume::onCommitVolumeChange(LLUICtrl* ctrl, void* user_data)
89{
90 // unmute various audio sources when user changes volume
91 LLString control_name = ctrl->getControlName();
92 if (control_name == "AudioLevelMaster")
93 {
94 gSavedSettings.setBOOL("MuteAudio", FALSE);
95 }
96 else if (control_name == "AudioLevelSFX")
97 {
98 gSavedSettings.setBOOL("MuteSounds", FALSE);
99 }
100 else if (control_name == "AudioLevelUI")
101 {
102 gSavedSettings.setBOOL("MuteUI", FALSE);
103 }
104 else if (control_name == "AudioLevelAmbient")
105 {
106 gSavedSettings.setBOOL("MuteAmbient", FALSE);
107 }
108 else if (control_name == "AudioLevelMusic")
109 {
110 gSavedSettings.setBOOL("MuteMusic", FALSE);
111 }
112 else if (control_name == "AudioLevelMedia")
113 {
114 gSavedSettings.setBOOL("MuteMedia", FALSE);
115 }
116 else if (control_name == "AudioLevelVoice")
117 {
118 gSavedSettings.setBOOL("MuteVoice", FALSE);
119 }
120}
104 121