diff options
author | Jacek Antonelli | 2008-08-15 23:45:27 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:27 -0500 |
commit | a8a62201ba762e98dff92cf49033e577fc34d8d4 (patch) | |
tree | 11f8513c5cdc222f2fac0c93eb724c089803c200 /linden/indra/newview/llmediaremotectrl.cpp | |
parent | Second Life viewer sources 1.18.6.4-RC (diff) | |
download | meta-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 '')
-rw-r--r-- | linden/indra/newview/llmediaremotectrl.cpp | 112 |
1 files changed, 79 insertions, 33 deletions
diff --git a/linden/indra/newview/llmediaremotectrl.cpp b/linden/indra/newview/llmediaremotectrl.cpp index b37e5e8..777cbc4 100644 --- a/linden/indra/newview/llmediaremotectrl.cpp +++ b/linden/indra/newview/llmediaremotectrl.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, |
@@ -36,63 +36,109 @@ | |||
36 | #include "lloverlaybar.h" | 36 | #include "lloverlaybar.h" |
37 | #include "llvieweruictrlfactory.h" | 37 | #include "llvieweruictrlfactory.h" |
38 | #include "llpanelaudiovolume.h" | 38 | #include "llpanelaudiovolume.h" |
39 | #include "llviewercontrol.h" | ||
40 | #include "llbutton.h" | ||
39 | 41 | ||
40 | //////////////////////////////////////////////////////////////////////////////// | 42 | //////////////////////////////////////////////////////////////////////////////// |
41 | // | 43 | // |
42 | // | 44 | // |
43 | LLMediaRemoteCtrl::LLMediaRemoteCtrl ( const LLString& name, | 45 | LLMediaRemoteCtrl::LLMediaRemoteCtrl() |
44 | const LLString& label, | ||
45 | const LLRect& rect, | ||
46 | const LLString& xml_file ) : | ||
47 | LLPanel ( name, rect, FALSE ) | ||
48 | { | 46 | { |
49 | setIsChrome(TRUE); | 47 | setIsChrome(TRUE); |
48 | mIsFocusRoot = TRUE; | ||
50 | 49 | ||
51 | gUICtrlFactory->buildPanel(this, xml_file); | 50 | mFactoryMap["Volume Panel"] = LLCallbackMap(createVolumePanel, NULL); |
51 | build(); | ||
52 | } | ||
52 | 53 | ||
53 | mIsFocusRoot = TRUE; | 54 | void LLMediaRemoteCtrl::build() |
55 | { | ||
56 | //HACK: only works because we don't have any implicit children (i.e. titlebars, close button, etc) | ||
57 | deleteAllChildren(); | ||
58 | if (gSavedSettings.getBOOL("ShowVolumeSettingsPopup")) | ||
59 | { | ||
60 | gUICtrlFactory->buildPanel(this, "panel_media_remote_expanded.xml", &getFactoryMap()); | ||
61 | } | ||
62 | else | ||
63 | { | ||
64 | gUICtrlFactory->buildPanel(this, "panel_media_remote.xml", &getFactoryMap()); | ||
65 | } | ||
54 | } | 66 | } |
55 | 67 | ||
56 | BOOL LLMediaRemoteCtrl::postBuild() | 68 | BOOL LLMediaRemoteCtrl::postBuild() |
57 | { | 69 | { |
58 | childSetAction("media_play",LLOverlayBar::mediaPlay,this); | 70 | childSetAction("media_play",LLOverlayBar::mediaPlay,this); |
59 | childSetAction("media_stop",LLOverlayBar::mediaStop,this); | ||
60 | childSetAction("media_pause",LLOverlayBar::mediaPause,this); | ||
61 | |||
62 | childSetAction("music_play",LLOverlayBar::musicPlay,this); | 71 | childSetAction("music_play",LLOverlayBar::musicPlay,this); |
63 | childSetAction("music_stop",LLOverlayBar::musicStop,this); | ||
64 | childSetAction("music_pause",LLOverlayBar::musicPause,this); | ||
65 | 72 | ||
66 | childSetAction("volume",LLOverlayBar::toggleAudioVolumeFloater,this); | 73 | childSetAction("expand", onClickExpandBtn, this); |
67 | |||
68 | return TRUE; | 74 | return TRUE; |
69 | } | 75 | } |
70 | 76 | ||
71 | LLMediaRemoteCtrl::~LLMediaRemoteCtrl () | 77 | void LLMediaRemoteCtrl::draw() |
72 | { | 78 | { |
79 | LLButton* music_play_btn = LLUICtrlFactory::getButtonByName(this, "music_play"); | ||
80 | if (music_play_btn) | ||
81 | { | ||
82 | if (gOverlayBar->musicPlaying()) | ||
83 | { | ||
84 | music_play_btn->setValue(TRUE); | ||
85 | music_play_btn->setImageOverlay("icn_music-pause.tga"); | ||
86 | } | ||
87 | else | ||
88 | { | ||
89 | music_play_btn->setValue(FALSE); | ||
90 | music_play_btn->setImageOverlay("icn_music-play.tga"); | ||
91 | } | ||
92 | } | ||
93 | |||
94 | LLButton* media_play_btn = LLUICtrlFactory::getButtonByName(this, "media_play"); | ||
95 | if (media_play_btn) | ||
96 | { | ||
97 | if (gOverlayBar->mediaPlaying()) | ||
98 | { | ||
99 | media_play_btn->setValue(TRUE); | ||
100 | media_play_btn->setImageOverlay("icn_media-pause.tga"); | ||
101 | } | ||
102 | else | ||
103 | { | ||
104 | media_play_btn->setValue(FALSE); | ||
105 | media_play_btn->setImageOverlay("icn_media-play.tga"); | ||
106 | } | ||
107 | } | ||
108 | |||
109 | LLButton* expand_button = LLUICtrlFactory::getButtonByName(this, "expand"); | ||
110 | if (expand_button) | ||
111 | { | ||
112 | if (expand_button->getToggleState()) | ||
113 | { | ||
114 | expand_button->setImageOverlay("arrow_down.tga"); | ||
115 | } | ||
116 | else | ||
117 | { | ||
118 | expand_button->setImageOverlay("arrow_up.tga"); | ||
119 | } | ||
120 | } | ||
121 | |||
122 | LLPanel::draw(); | ||
73 | } | 123 | } |
74 | 124 | ||
75 | //////////////////////////////////////////////////////////////////////////////// | 125 | LLMediaRemoteCtrl::~LLMediaRemoteCtrl () |
76 | // | ||
77 | // | ||
78 | EWidgetType LLMediaRemoteCtrl::getWidgetType() const | ||
79 | { | 126 | { |
80 | return WIDGET_TYPE_MEDIA_REMOTE; | ||
81 | } | 127 | } |
82 | 128 | ||
83 | LLString LLMediaRemoteCtrl::getWidgetTag() const | 129 | //static |
130 | void LLMediaRemoteCtrl::onClickExpandBtn(void* user_data) | ||
84 | { | 131 | { |
85 | return LL_MEDIA_REMOTE_CTRL_TAG; | 132 | LLMediaRemoteCtrl* remotep = (LLMediaRemoteCtrl*)user_data; |
133 | |||
134 | remotep->build(); | ||
135 | gOverlayBar->layoutButtons(); | ||
136 | |||
86 | } | 137 | } |
87 | 138 | ||
88 | //////////////////////////////////////////////////////////////////////////////// | 139 | //static |
89 | // | 140 | void* LLMediaRemoteCtrl::createVolumePanel(void* data) |
90 | // | ||
91 | void LLMediaRemoteCtrl::draw() | ||
92 | { | 141 | { |
93 | LLOverlayBar::enableMusicButtons(this); | 142 | LLPanelAudioVolume* panel = new LLPanelAudioVolume(); |
94 | LLOverlayBar::enableMediaButtons(this); | 143 | return panel; |
95 | LLPanel::draw(); | ||
96 | // make volume button reflect of volume floater | ||
97 | childSetValue("volume", LLFloaterAudioVolume::instanceVisible(LLSD())); | ||
98 | } | 144 | } |