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/llpanelaudiovolume.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 '')
-rw-r--r-- | linden/indra/newview/llpanelaudiovolume.cpp | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/linden/indra/newview/llpanelaudiovolume.cpp b/linden/indra/newview/llpanelaudiovolume.cpp new file mode 100644 index 0000000..902614e --- /dev/null +++ b/linden/indra/newview/llpanelaudiovolume.cpp | |||
@@ -0,0 +1,109 @@ | |||
1 | /** | ||
2 | * @file llpanelaudiovolume.cpp | ||
3 | * @brief A remote control for media (video and music) | ||
4 | * | ||
5 | * Copyright (c) 2005-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * Second Life Viewer Source Code | ||
8 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
9 | * to you under the terms of the GNU General Public License, version 2.0 | ||
10 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
11 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
12 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
13 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
14 | * | ||
15 | * There are special exceptions to the terms and conditions of the GPL as | ||
16 | * it is applied to this Source Code. View the full text of the exception | ||
17 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
18 | * online at http://secondlife.com/developers/opensource/flossexception | ||
19 | * | ||
20 | * By copying, modifying or distributing this software, you acknowledge | ||
21 | * that you have read and understood your obligations described above, | ||
22 | * and agree to abide by those obligations. | ||
23 | * | ||
24 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
25 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
26 | * COMPLETENESS OR PERFORMANCE. | ||
27 | */ | ||
28 | |||
29 | #include "llviewerprecompiledheaders.h" | ||
30 | |||
31 | #include "llpanelaudiovolume.h" | ||
32 | |||
33 | #include "lloverlaybar.h" | ||
34 | #include "llviewercontrol.h" | ||
35 | #include "llvieweruictrlfactory.h" | ||
36 | |||
37 | //////////////////////////////////////////////////////////////////////////////// | ||
38 | // Floater version of audio panel | ||
39 | // | ||
40 | |||
41 | //static | ||
42 | void* LLFloaterAudioVolume::createVolumePanel(void* data) | ||
43 | { | ||
44 | LLPanelAudioVolume* panel = new LLPanelAudioVolume(); | ||
45 | return panel; | ||
46 | } | ||
47 | |||
48 | LLFloaterAudioVolume::LLFloaterAudioVolume(const LLSD& seed) | ||
49 | { | ||
50 | mFactoryMap["Volume Panel"] = LLCallbackMap(createVolumePanel, NULL); | ||
51 | gUICtrlFactory->buildFloater(this, "floater_audio_volume.xml", &getFactoryMap()); | ||
52 | |||
53 | S32 pos_x = mRect.mLeft; | ||
54 | S32 pos_y = mRect.mBottom; | ||
55 | LLView* volume_panel_view = gOverlayBar->getChildByName("master_volume"); | ||
56 | if (volume_panel_view) | ||
57 | { | ||
58 | pos_x = volume_panel_view->getRect().mLeft; | ||
59 | pos_y = volume_panel_view->getRect().mTop; | ||
60 | } | ||
61 | |||
62 | setOrigin(pos_x, pos_y); | ||
63 | gFloaterView->adjustToFitScreen(this, FALSE); | ||
64 | } | ||
65 | |||
66 | //////////////////////////////////////////////////////////////////////////////// | ||
67 | // | ||
68 | // | ||
69 | LLPanelAudioVolume::LLPanelAudioVolume() | ||
70 | { | ||
71 | } | ||
72 | |||
73 | BOOL LLPanelAudioVolume::postBuild() | ||
74 | { | ||
75 | childSetAction("media_play",LLOverlayBar::mediaPlay,this); | ||
76 | childSetAction("media_stop",LLOverlayBar::mediaStop,this); | ||
77 | childSetAction("media_pause",LLOverlayBar::mediaPause,this); | ||
78 | |||
79 | childSetAction("music_play",LLOverlayBar::musicPlay,this); | ||
80 | childSetAction("music_stop",LLOverlayBar::musicStop,this); | ||
81 | childSetAction("music_pause",LLOverlayBar::musicPause,this); | ||
82 | |||
83 | return TRUE; | ||
84 | } | ||
85 | |||
86 | LLPanelAudioVolume::~LLPanelAudioVolume () | ||
87 | { | ||
88 | } | ||
89 | |||
90 | //////////////////////////////////////////////////////////////////////////////// | ||
91 | // | ||
92 | // | ||
93 | void LLPanelAudioVolume::draw() | ||
94 | { | ||
95 | LLOverlayBar::enableMusicButtons(this); | ||
96 | LLOverlayBar::enableMediaButtons(this); | ||
97 | BOOL mute = gSavedSettings.getBOOL("MuteAudio"); | ||
98 | bool enable = mute ? false : true; | ||
99 | childSetEnabled("System Volume", enable); | ||
100 | childSetEnabled("Music Volume", enable); | ||
101 | childSetEnabled("Media Volume", enable); | ||
102 | childSetEnabled("Voice Volume", enable); | ||
103 | childSetEnabled("SFX Volume", enable); | ||
104 | childSetEnabled("UI Volume", enable); | ||
105 | childSetEnabled("Wind Volume", enable); | ||
106 | childSetEnabled("Footsteps Volume", enable); | ||
107 | LLPanel::draw(); | ||
108 | } | ||
109 | |||