diff options
author | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
commit | 117e22047c5752352342d64e3fb7ce00a4eb8113 (patch) | |
tree | e32de2cfba0dda8705ae528fcd1fbe23ba075685 /linden/indra/newview/llpanelaudioprefs.cpp | |
parent | Second Life viewer sources 1.18.0.6 (diff) | |
download | meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.zip meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.gz meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.bz2 meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.xz |
Second Life viewer sources 1.18.1.2
Diffstat (limited to 'linden/indra/newview/llpanelaudioprefs.cpp')
-rw-r--r-- | linden/indra/newview/llpanelaudioprefs.cpp | 142 |
1 files changed, 30 insertions, 112 deletions
diff --git a/linden/indra/newview/llpanelaudioprefs.cpp b/linden/indra/newview/llpanelaudioprefs.cpp index 4a58cea..b28fb83 100644 --- a/linden/indra/newview/llpanelaudioprefs.cpp +++ b/linden/indra/newview/llpanelaudioprefs.cpp | |||
@@ -38,70 +38,58 @@ | |||
38 | #include "llfontgl.h" | 38 | #include "llfontgl.h" |
39 | 39 | ||
40 | // project includes | 40 | // project includes |
41 | #include "llviewerwindow.h" | 41 | #include "audioengine.h" |
42 | #include "llui.h" | ||
43 | #include "llspinctrl.h" | ||
44 | #include "llslider.h" | ||
45 | #include "llradiogroup.h" | ||
46 | #include "llsliderctrl.h" | ||
47 | #include "llcheckboxctrl.h" | ||
48 | #include "lltextbox.h" | ||
49 | #include "llbutton.h" | 42 | #include "llbutton.h" |
43 | #include "llcheckboxctrl.h" | ||
50 | #include "llcombobox.h" | 44 | #include "llcombobox.h" |
51 | #include "audioengine.h" | ||
52 | #include "llmediaengine.h" | ||
53 | #include "llfirstuse.h" | 45 | #include "llfirstuse.h" |
46 | #include "llmediaengine.h" | ||
47 | #include "llnotify.h" | ||
48 | #include "llpanelaudiovolume.h" | ||
54 | #include "llparcel.h" | 49 | #include "llparcel.h" |
50 | #include "llradiogroup.h" | ||
51 | #include "llresmgr.h" | ||
52 | #include "llslider.h" | ||
53 | #include "llsliderctrl.h" | ||
54 | #include "llspinctrl.h" | ||
55 | #include "lltextbox.h" | ||
56 | #include "llui.h" | ||
55 | #include "llviewerparcelmgr.h" | 57 | #include "llviewerparcelmgr.h" |
56 | #include "llnotify.h" | ||
57 | #include "llvieweruictrlfactory.h" | 58 | #include "llvieweruictrlfactory.h" |
58 | #include "llresmgr.h" | 59 | #include "llviewerwindow.h" |
59 | #include "viewer.h" // do_disconnect | 60 | #include "viewer.h" // do_disconnect |
60 | 61 | ||
61 | // | 62 | // |
62 | // Imported globals | ||
63 | // | ||
64 | |||
65 | extern LLAudioEngine *gAudiop; | ||
66 | |||
67 | // | ||
68 | // Globals | ||
69 | // | ||
70 | |||
71 | |||
72 | // | ||
73 | // Static functions | 63 | // Static functions |
74 | // | 64 | // |
75 | 65 | ||
76 | 66 | //static | |
77 | 67 | void* LLPanelAudioPrefs::createVolumePanel(void* data) | |
68 | { | ||
69 | LLPanelAudioVolume* panel = new LLPanelAudioVolume(); | ||
70 | return panel; | ||
71 | } | ||
78 | 72 | ||
79 | LLPanelAudioPrefs::LLPanelAudioPrefs() | 73 | LLPanelAudioPrefs::LLPanelAudioPrefs() |
80 | { | 74 | { |
81 | 75 | mFactoryMap["Volume Panel"] = LLCallbackMap(createVolumePanel, NULL); | |
82 | gUICtrlFactory->buildPanel(this, "panel_preferences_audio.xml"); | 76 | |
83 | 77 | gUICtrlFactory->buildPanel(this, "panel_preferences_audio.xml", &getFactoryMap()); | |
84 | |||
85 | } | 78 | } |
86 | 79 | ||
87 | |||
88 | LLPanelAudioPrefs::~LLPanelAudioPrefs() | 80 | LLPanelAudioPrefs::~LLPanelAudioPrefs() |
89 | { | 81 | { |
90 | // Children all cleaned up by default view destructor. | 82 | // Children all cleaned up by default view destructor. |
91 | } | 83 | } |
92 | 84 | ||
93 | |||
94 | |||
95 | |||
96 | BOOL LLPanelAudioPrefs::postBuild() | 85 | BOOL LLPanelAudioPrefs::postBuild() |
97 | { | 86 | { |
98 | |||
99 | |||
100 | mPreviousMediaVolume = gSavedSettings.getF32("MediaAudioVolume"); | ||
101 | mPreviousVolume = gSavedSettings.getF32("AudioLevelMaster"); | 87 | mPreviousVolume = gSavedSettings.getF32("AudioLevelMaster"); |
88 | mPreviousSFX = gSavedSettings.getF32("AudioLevelSFX"); | ||
102 | mPreviousUI = gSavedSettings.getF32("AudioLevelUI"); | 89 | mPreviousUI = gSavedSettings.getF32("AudioLevelUI"); |
103 | mPreviousFootsteps = gSavedSettings.getF32("AudioLevelFootsteps"); | 90 | mPreviousEnvironment = gSavedSettings.getF32("AudioLevelAmbient"); |
104 | mPreviousWind = gSavedSettings.getF32("AudioLevelWind"); | 91 | mPreviousMusicVolume = gSavedSettings.getF32("AudioLevelMusic"); |
92 | mPreviousMediaVolume = gSavedSettings.getF32("AudioLevelMedia"); | ||
105 | mPreviousDoppler = gSavedSettings.getF32("AudioLevelDoppler"); | 93 | mPreviousDoppler = gSavedSettings.getF32("AudioLevelDoppler"); |
106 | mPreviousDistance = gSavedSettings.getF32("AudioLevelDistance"); | 94 | mPreviousDistance = gSavedSettings.getF32("AudioLevelDistance"); |
107 | mPreviousRolloff = gSavedSettings.getF32("AudioLevelRolloff"); | 95 | mPreviousRolloff = gSavedSettings.getF32("AudioLevelRolloff"); |
@@ -117,87 +105,20 @@ BOOL LLPanelAudioPrefs::postBuild() | |||
117 | mPreviousMuteAudio = gSavedSettings.getBOOL("MuteAudio"); | 105 | mPreviousMuteAudio = gSavedSettings.getBOOL("MuteAudio"); |
118 | mPreviousMuteWhenMinimized = gSavedSettings.getBOOL("MuteWhenMinimized"); | 106 | mPreviousMuteWhenMinimized = gSavedSettings.getBOOL("MuteWhenMinimized"); |
119 | 107 | ||
120 | |||
121 | |||
122 | childSetCommitCallback("disable audio", onMuteAudio, this); | ||
123 | |||
124 | enable(!gSavedSettings.getBOOL("MuteAudio")); | ||
125 | |||
126 | return TRUE; | 108 | return TRUE; |
127 | 109 | ||
128 | } | 110 | } |
129 | 111 | ||
130 | |||
131 | void LLPanelAudioPrefs::enable(BOOL b) | ||
132 | { | ||
133 | childSetEnabled("mute_when_minimized", b); | ||
134 | |||
135 | childSetEnabled("streaming_text", b); | ||
136 | childSetEnabled("streaming_music", b); | ||
137 | childSetEnabled("streaming_video", b); | ||
138 | |||
139 | childSetEnabled("System Volume", b); | ||
140 | childSetEnabled("system_volume_text", b); | ||
141 | |||
142 | childSetEnabled("Wind Volume", b); | ||
143 | childSetEnabled("wind_volume_text", b); | ||
144 | |||
145 | childSetEnabled("Footsteps Volume", b); | ||
146 | childSetEnabled("footsteps_volume_text", b); | ||
147 | |||
148 | childSetEnabled("UI Volume", b); | ||
149 | childSetEnabled("ui_volume", b); | ||
150 | |||
151 | childSetEnabled("Doppler Effect", b); | ||
152 | childSetEnabled("doppler_effect_text", b); | ||
153 | |||
154 | childSetEnabled("Distance Factor", b); | ||
155 | childSetEnabled("distance_factor_text", b); | ||
156 | |||
157 | childSetEnabled("Rolloff Factor", b); | ||
158 | childSetEnabled("rolloff_factor_text", b); | ||
159 | |||
160 | childSetEnabled("L$ Change Threshold", b); | ||
161 | |||
162 | childSetEnabled("Health Change Threshold", b); | ||
163 | |||
164 | childSetEnabled("bitrate", b); | ||
165 | childSetEnabled("default_upload_bitrate_text", b); | ||
166 | } | ||
167 | |||
168 | struct LLPARestartData | ||
169 | { | ||
170 | BOOL mMuteAudio; | ||
171 | }; | ||
172 | |||
173 | |||
174 | |||
175 | void LLPanelAudioPrefs::apply() | ||
176 | { | ||
177 | |||
178 | } | ||
179 | |||
180 | |||
181 | |||
182 | void LLPanelAudioPrefs::onMuteAudio(LLUICtrl* ctrl, void* userdata) | ||
183 | { | ||
184 | LLPanelAudioPrefs* self = (LLPanelAudioPrefs*)userdata; | ||
185 | LLCheckBoxCtrl* check = (LLCheckBoxCtrl*)ctrl; | ||
186 | |||
187 | self->enable(!check->get()); | ||
188 | |||
189 | } | ||
190 | |||
191 | |||
192 | void LLPanelAudioPrefs::cancel() | 112 | void LLPanelAudioPrefs::cancel() |
193 | { | 113 | { |
194 | 114 | ||
195 | gSavedSettings.setS32("AudioDefaultBitrate", mPreviousBitrate); | 115 | gSavedSettings.setS32("AudioDefaultBitrate", mPreviousBitrate); |
196 | gSavedSettings.setF32("MediaAudioVolume", mPreviousMediaVolume); | ||
197 | gSavedSettings.setF32("AudioLevelMaster", mPreviousVolume ); | 116 | gSavedSettings.setF32("AudioLevelMaster", mPreviousVolume ); |
198 | gSavedSettings.setF32("AudioLevelUI", mPreviousUI ); | 117 | gSavedSettings.setF32("AudioLevelUI", mPreviousUI ); |
199 | gSavedSettings.setF32("AudioLevelFootsteps", mPreviousFootsteps ); | 118 | gSavedSettings.setF32("AudioLevelSFX", mPreviousSFX ); |
200 | gSavedSettings.setF32("AudioLevelWind", mPreviousWind ); | 119 | gSavedSettings.setF32("AudioLevelAmbient", mPreviousEnvironment ); |
120 | gSavedSettings.setF32("AudioLevelMusic", mPreviousMusicVolume); | ||
121 | gSavedSettings.setF32("AudioLevelMedia", mPreviousMediaVolume); | ||
201 | gSavedSettings.setF32("AudioLevelDoppler", mPreviousDoppler ); | 122 | gSavedSettings.setF32("AudioLevelDoppler", mPreviousDoppler ); |
202 | gSavedSettings.setF32("AudioLevelDistance", mPreviousDistance ); | 123 | gSavedSettings.setF32("AudioLevelDistance", mPreviousDistance ); |
203 | gSavedSettings.setF32("AudioLevelRolloff", mPreviousRolloff ); | 124 | gSavedSettings.setF32("AudioLevelRolloff", mPreviousRolloff ); |
@@ -211,7 +132,4 @@ void LLPanelAudioPrefs::cancel() | |||
211 | 132 | ||
212 | gSavedSettings.setBOOL("MuteAudio", mPreviousMuteAudio ); | 133 | gSavedSettings.setBOOL("MuteAudio", mPreviousMuteAudio ); |
213 | gSavedSettings.setBOOL("MuteWhenMinimized", mPreviousMuteWhenMinimized ); | 134 | gSavedSettings.setBOOL("MuteWhenMinimized", mPreviousMuteWhenMinimized ); |
214 | |||
215 | |||
216 | |||
217 | } | 135 | } |