Less hardcoded element manipluation for media ticker(allows more freedom for skins, etc). Added gridlines to visualizer. Added oscillator color to color tables (This process sucks, btw).

This commit is contained in:
Shyotl
2012-01-04 03:55:53 -06:00
parent af7affa9dd
commit d3ba4a2b80
25 changed files with 82 additions and 27 deletions

View File

@@ -23,8 +23,11 @@ SHFloaterMediaTicker::SHFloaterMediaTicker() : LLFloater()/*, LLSingleton<SHFloa
mTitleText(NULL),
mVisualizer(NULL)
{
setIsChrome(TRUE);
LLUICtrlFactory::getInstance()->buildFloater(this, "sh_floater_media_ticker.xml");
setIsChrome(TRUE);
if(gAudiop->getStreamingAudioImpl()->supportsWaveData())
LLUICtrlFactory::getInstance()->buildFloater(this, "sh_floater_media_ticker_visualizer.xml");
else
LLUICtrlFactory::getInstance()->buildFloater(this, "sh_floater_media_ticker.xml");
}
/*virtual*/ BOOL SHFloaterMediaTicker::postBuild()
@@ -35,26 +38,11 @@ SHFloaterMediaTicker::SHFloaterMediaTicker() : LLFloater()/*, LLSingleton<SHFloa
mVisualizer = getChild<LLUICtrl>("visualizer_box",true,false);
mszLoading = getString("loading");
mszPaused = getString("paused");
mOscillatorColor = gColors.getColor("SHMediaTickerOscillatorColor");
if(mArtistText) mArtistText->setText(mszPaused);
if(mTitleText) mTitleText->setText(mszPaused);
if(!gAudiop->getStreamingAudioImpl()->supportsWaveData()) //Can't visualize. Extend textboxes.
{
if(mArtistText)
{
LLRect text_rect = mArtistText->getRect();
text_rect.mRight = llmax(mTickerBackground->getRect().mRight-2,text_rect.mRight);
mArtistText->setRect(text_rect);
}
if(mTitleText)
{
LLRect text_rect = mTitleText->getRect();
text_rect.mRight = llmax(mTickerBackground->getRect().mRight-2,text_rect.mRight);
mArtistText->setRect(text_rect);
}
}
return LLFloater::postBuild();
}
@@ -125,7 +113,7 @@ void SHFloaterMediaTicker::drawOscilloscope() //called via draw.
F32 width_scale = root_rect.getWidth() / (F32)NUM_WAVE_DATA_VALUES;
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.color4f(0.f,0.f,0.f,.75f);
gGL.color4fv(mOscillatorColor.mV);
gGL.pushMatrix();
gGL.translatef((F32)root_rect.mLeft, (F32)root_rect.mBottom + height*.5f, 0.f);
gGL.begin( LLRender::LINE_STRIP );

View File

@@ -41,6 +41,8 @@ private:
S32 mTitleScrollChars;
S32 mCurScrollChar;
LLColor4 mOscillatorColor;
//UI elements
LLIconCtrl* mTickerBackground;
LLTextBox* mArtistText;

View File

@@ -183,6 +183,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/> <!-- "loading..." in the inv -->
<InventoryBackgroundColor value="62, 62, 62, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<ComboBoxBg value="255, 255, 255, 255"/>
<AvatarListTextDistNormalRange value="0, 0, 0, 255"/>
<AvatarListTextDistShoutRange value="0, 0, 0, 128"/>

View File

@@ -184,6 +184,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/> <!-- "loading..." in the inv -->
<InventoryBackgroundColor value="62, 62, 62, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<ComboBoxBg value="255, 255, 255, 255"/>
<AvatarListTextDistNormalRange value="0, 0, 0, 255"/>
<AvatarListTextDistShoutRange value="0, 0, 0, 128"/>

View File

@@ -181,6 +181,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/>
<InventoryBackgroundColor value="62, 62, 62, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<ComboBoxBg value="255, 255, 255, 255"/>
<AvatarListTextDistNormalRange value="0, 0, 0, 255"/>
<AvatarListTextDistShoutRange value="0, 0, 0, 128"/>

View File

@@ -181,6 +181,7 @@
<ConsoleBackground value="10, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 5, 0, 255"/>
<InventoryBackgroundColor value="0, 0, 0, 180"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<ComboBoxBg value="255, 255, 255, 255"/>
<AvatarListTextDistNormalRange value="0, 0, 0, 255"/>
<AvatarListTextDistShoutRange value="0, 0, 0, 128"/>

View File

@@ -184,6 +184,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/> <!-- "loading..." in the inv -->
<InventoryBackgroundColor value="62, 62, 62, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<ComboBoxBg value="255, 255, 255, 255"/>
<AvatarListTextDistNormalRange value="0, 0, 0, 255"/>
<AvatarListTextDistShoutRange value="0, 0, 0, 128"/>

View File

@@ -195,6 +195,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/> <!-- "loading..." in the inv -->
<InventoryBackgroundColor value="62, 62, 62, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<!-- Alert box colors -->
<AlertBoxColor value="62, 62, 62, 255" /> <!-- Warnings floaters, like when returning objects -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@@ -1,20 +1,23 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater can_close="true" can_drag_on_left="false" can_minimize="false" can_resize="false"
height="32" min_height="32" min_width="256" name="mediaticker" rect_control="SHMediaTickerRect" control_name="SHShowMediaTicker"
height="33" min_height="33" min_width="256" name="mediaticker" rect_control="SHMediaTickerRect" control_name="SHShowMediaTicker"
title="" width="256">
<icon bottom="-30" color="1, 1, 1, 1" follows="top|right" height="28"
<icon bottom="-32" color="1, 1, 1, 1" follows="top|right" height="31"
image_name="ticker_background_small.tga" left="2" mouse_opaque="false" name="ticker_background"
width="234" />
<icon bottom="-17" color="0, 0, 0, .2" follows="top|right" height="1"
image_name="white.tga" left="2" mouse_opaque="false" name="ticker_background"
width="234" />
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-18" drop_shadow_visible="true" follows="top|right"
bottom="-17" drop_shadow_visible="true" follows="top|right"
font="SansSerifBold" h_pad="0" halign="left" height="16" left="4"
mouse_opaque="true" name="artist_label" v_pad="0" width="50">
Artist:
</text>
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-18" drop_shadow_visible="true" follows="top|right"
bottom="-17" drop_shadow_visible="true" follows="top|right"
font="SansSerifBold" h_pad="0" halign="left" height="16" left="50"
mouse_opaque="true" name="artist_text" v_pad="0" width="125">
mouse_opaque="true" name="artist_text" v_pad="0" width="185">
</text>
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-32" drop_shadow_visible="true" follows="top|right"
@@ -25,11 +28,9 @@
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-32" drop_shadow_visible="true" follows="top|right"
font="SansSerifBold" h_pad="0" halign="left" height="16" left="50"
mouse_opaque="true" name="title_text" v_pad="0" width="125">
mouse_opaque="true" name="title_text" v_pad="0" width="185">
</text>
<locate bottom="-28" height="24" left="177" name="visualizer_box" width="58"/>
<string name="paused">
(not playing)
</string>

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater can_close="true" can_drag_on_left="false" can_minimize="false" can_resize="false"
height="33" min_height="33" min_width="256" name="mediaticker" rect_control="SHMediaTickerRect" control_name="SHShowMediaTicker"
title="" width="256">
<icon bottom="-32" color="1, 1, 1, 1" follows="top|right" height="31"
image_name="ticker_background_small.tga" left="2" mouse_opaque="false" name="ticker_background"
width="234" />
<icon bottom="-17" color="0, 0, 0, .2" follows="top|right" height="1"
image_name="white.tga" left="2" mouse_opaque="false" name="ticker_background"
width="175" />
<locate bottom="-32" height="31" left="176" name="visualizer_box" width="60"/>
<icon bottom="-33" color="0, 0, 0, .2" follows="top|right" height="33"
image_name="ticker_visualizer_grid.tga" left="176" mouse_opaque="false" name="visualizer_grid"
width="60" />
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-17" drop_shadow_visible="true" follows="top|right"
font="SansSerifBold" h_pad="0" halign="left" height="16" left="4"
mouse_opaque="true" name="artist_label" v_pad="0" width="50">
Artist:
</text>
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-17" drop_shadow_visible="true" follows="top|right"
font="SansSerifBold" h_pad="0" halign="left" height="16" left="50"
mouse_opaque="true" name="artist_text" v_pad="0" width="125">
</text>
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-32" drop_shadow_visible="true" follows="top|right"
font="SansSerifBold" h_pad="0" halign="left" height="16" left="4"
mouse_opaque="true" name="title_label" v_pad="0" width="50">
Title:
</text>
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="-32" drop_shadow_visible="true" follows="top|right"
font="SansSerifBold" h_pad="0" halign="left" height="16" left="50"
mouse_opaque="true" name="title_text" v_pad="0" width="125">
</text>
<string name="paused">
(not playing)
</string>
<string name="loading">
(loading...)
</string>
</floater>

View File

@@ -182,6 +182,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/> <!-- "loading..." in the inv -->
<InventoryBackgroundColor value="0, 0, 0, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<ComboBoxBg value="255, 255, 255, 255"/>
<AvatarListTextDistNormalRange value="0, 0, 0, 255"/>
<AvatarListTextDistShoutRange value="0, 0, 0, 128"/>

View File

@@ -184,6 +184,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="255, 255, 255, 128"/> <!-- "loading..." in the inv -->
<InventoryBackgroundColor value="11, 11, 11, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<DefaultListText value="255, 255, 255, 255"/> <!-- We are replacing all the hardcoded black text with this color so we can make skins with white text on dark background -->
<ComboBoxBg value="11, 11, 11, 255"/>
<AvatarListTextDistNormalRange value="255, 255, 255, 255"/>

View File

@@ -181,6 +181,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 5, 0, 255"/>
<InventoryBackgroundColor value="0, 0, 0, 180"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<ComboBoxBg value="255, 255, 255, 255"/>
<AvatarListTextDistNormalRange value="0, 0, 0, 255"/>
<AvatarListTextDistShoutRange value="0, 0, 0, 128"/>

View File

@@ -183,6 +183,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/> <!-- "loading..." in the inv -->
<InventoryBackgroundColor value="62, 62, 62, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<!-- Alert box colors -->
<AlertBoxColor value="62, 62, 62, 255" /> <!-- Warnings floaters, like when returning objects -->

View File

@@ -183,6 +183,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/> <!-- "loading..." in the inv -->
<InventoryBackgroundColor value="62, 62, 62, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<!-- Alert box colors -->
<AlertBoxColor value="62, 62, 62, 255" /> <!-- Warnings floaters, like when returning objects -->

View File

@@ -171,6 +171,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/> <!-- "loading..." in the inv -->
<InventoryBackgroundColor value="62, 62, 62, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<!-- Alert box colors -->
<AlertBoxColor value="62, 62, 62, 255" /> <!-- Warnings floaters, like when returning objects -->

View File

@@ -171,6 +171,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/> <!-- "loading..." in the inv -->
<InventoryBackgroundColor value="62, 62, 62, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<!-- Alert box colors -->
<AlertBoxColor value="62, 62, 62, 255" /> <!-- Warnings floaters, like when returning objects -->

View File

@@ -181,6 +181,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/>
<InventoryBackgroundColor value="62, 62, 62, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<ComboBoxBg value="255, 255, 255, 255"/>
<AvatarListTextDistNormalRange value="0, 0, 0, 255"/>
<AvatarListTextDistShoutRange value="0, 0, 0, 128"/>

View File

@@ -181,6 +181,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/>
<InventoryBackgroundColor value="62, 62, 62, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<ComboBoxBg value="255, 255, 255, 255"/>
<AvatarListTextDistNormalRange value="0, 0, 0, 255"/>
<AvatarListTextDistShoutRange value="0, 0, 0, 128"/>

View File

@@ -181,6 +181,7 @@
<ConsoleBackground value="10, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 5, 0, 255"/>
<InventoryBackgroundColor value="0, 0, 0, 180"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<ComboBoxBg value="255, 255, 255, 255"/>
<AvatarListTextDistNormalRange value="0, 0, 0, 255"/>
<AvatarListTextDistShoutRange value="0, 0, 0, 128"/>

View File

@@ -187,6 +187,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/>
<InventoryBackgroundColor value="62, 62, 62, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<DefaultListText value="0, 0, 0, 255"/> <!-- We are replacing all the hardcoded black text with this color so we can make skins with white text on dark background -->
<ComboBoxBg value="255, 255, 255, 255"/>
<AvatarListTextDistNormalRange value="0, 0, 0, 255"/>

View File

@@ -193,6 +193,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/>
<InventoryBackgroundColor value="255, 255, 255, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<ComboBoxBg value="255, 255, 255, 255"/>
<!-- Alert box colors -->

View File

@@ -182,6 +182,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="0, 0, 0, 255"/>
<InventoryBackgroundColor value="255, 255, 255, 255"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<ComboBoxBg value="255, 255, 255, 255"/>
<AvatarListTextDistNormalRange value="0, 0, 0, 255"/>
<AvatarListTextDistShoutRange value="0, 0, 0, 128"/>

View File

@@ -186,6 +186,7 @@
<ConsoleBackground value="0, 0, 0, 255" />
<FolderViewLoadingMessageTextColor value="240, 165, 90, 255"/> <!-- "loading..." in the inv -->
<InventoryBackgroundColor value="62, 62, 62, 80"/>
<SHMediaTickerOscillatorColor value ="0, 0, 0, 191"/>
<!-- Alert box colors -->
<AlertBoxColor value="62, 62, 62, 255" /> <!-- Warnings floaters, like when returning objects -->