Satisfy Issue 411: Song list in local chat - not a floater

AnnounceStreamMetadata debug setting.
"Announce music stream's metadata in local chat when tuned in" checkbox added to vanity main preferences.
Made the words Title and Artist translatable, as well as the "Now playing" string.
This commit is contained in:
Lirusaito
2012-12-29 07:45:05 -05:00
parent 50eb45991d
commit 23469c00de
6 changed files with 40 additions and 3 deletions

View File

@@ -843,6 +843,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>AnnounceStreamMetadata</key>
<map>
<key>Comment</key>
<string>Announce the metadata of the track playing, in chat, during streams.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>InventorySortOrder</key>
<map>
<key>Comment</key>

View File

@@ -36,6 +36,8 @@
#include "ascentprefsvan.h"
//project includes
#include "llaudioengine.h" //For gAudiop
#include "llstreamingaudio.h" //For LLStreamingAudioInterface
#include "llcolorswatch.h"
#include "llvoavatarself.h"
#include "llagent.h"
@@ -54,6 +56,8 @@ LLPrefsAscentVan::LLPrefsAscentVan()
{
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_vanity.xml");
childSetVisible("announce_streaming_metadata", gAudiop && gAudiop->getStreamingAudioImpl() && gAudiop->getStreamingAudioImpl()->supportsMetaData());
childSetCommitCallback("tag_spoofing_combobox", onCommitClientTag, this);
childSetCommitCallback("show_my_tag_check", onCommitCheckBox, this);
@@ -180,6 +184,7 @@ void LLPrefsAscentVan::refreshValues()
mDisableChatAnimation = gSavedSettings.getBOOL("SGDisableChatAnimation");
mAddNotReplace = gSavedSettings.getBOOL("LiruAddNotReplace");
mTurnAround = gSavedSettings.getBOOL("TurnAroundWhenWalkingBackwards");
mAnnounceStreamMetadata = gSavedSettings.getBOOL("AnnounceStreamMetadata");
//Tags\Colors ----------------------------------------------------------------------------
mAscentUseTag = gSavedSettings.getBOOL("AscentUseTag");
@@ -256,6 +261,7 @@ void LLPrefsAscentVan::cancel()
gSavedSettings.setBOOL("SGDisableChatAnimation", mDisableChatAnimation);
gSavedSettings.setBOOL("LiruAddNotReplace", mAddNotReplace);
gSavedSettings.setBOOL("TurnAroundWhenWalkingBackwards", mTurnAround);
gSavedSettings.setBOOL("AnnounceStreamMetadata", mAnnounceStreamMetadata);
//Tags\Colors ----------------------------------------------------------------------------
gSavedSettings.setBOOL("AscentUseTag", mAscentUseTag);

View File

@@ -60,6 +60,7 @@ protected:
bool mDisableChatAnimation;
bool mAddNotReplace;
bool mTurnAround;
bool mAnnounceStreamMetadata;
//Tags\Colors
BOOL mAscentUseTag;
std::string mReportClientUUID;

View File

@@ -35,6 +35,8 @@
#include "llmediaremotectrl.h"
#include "llaudioengine.h"
#include "llchat.h"
#include "llfloaterchat.h"
#include "lliconctrl.h"
#include "llmimetypes.h"
#include "lloverlaybar.h"
@@ -53,6 +55,7 @@
//
static LLRegisterWidget<LLMediaRemoteCtrl> r("media_remote");
static std::string sLastTooltip;
LLMediaRemoteCtrl::LLMediaRemoteCtrl()
{
@@ -263,10 +266,22 @@ void LLMediaRemoteCtrl::enableMediaButtons()
if(artist.isDefined() && title.isDefined())
info_text = artist.asString() + " -- " + title.asString();
else if(title.isDefined())
info_text = std::string("Title: ") + title.asString();
info_text = getString("Title") + ": " + title.asString();
else if(artist.isDefined())
info_text = std::string("Artist: ") + artist.asString();
music_pause_btn->setToolTip(info_text);
info_text = getString("Artist") + ": " + artist.asString();
if(music_pause_btn->getToolTip() != info_text) //Has info_text changed since last call?
{
music_pause_btn->setToolTip(info_text);
static LLCachedControl<bool> announce_stream_metadata("AnnounceStreamMetadata");
if(announce_stream_metadata && info_text != sLastTooltip && info_text != "Loading...") //Are we announcing? Don't annoounce what we've last announced. Don't announce Loading.
{
sLastTooltip = info_text;
LLChat chat;
chat.mText = getString("Now_playing") + " " + info_text;
chat.mSourceType = CHAT_SOURCE_SYSTEM;
LLFloaterChat::addChat(chat);
}
}
}
else
music_pause_btn->setToolTip(mCachedPauseTip);

View File

@@ -15,6 +15,9 @@
<string name="pause_label">
Pause
</string>
<string name="Title">Title</string>
<string name="Artist">Artist</string>
<string name="Now_playing">Now playing</string>
<string name="default_tooltip_label">
No Media Specified
</string>

View File

@@ -9,6 +9,7 @@
<check_box bottom_delta="-20" control_name="SGDisableChatAnimation" follows="top" height="16" initial_value="false" label="Disable chat, whisper and shout animations" tool_tip="Remove chat animations from your own avatar. Effect visible to everyone" name="disable_chat_animation"/>
<check_box bottom_delta="-20" control_name="LiruAddNotReplace" follows="top" height="16" label="Add attachments and wearables instead of replacing them" tool_tip="When double clicking or pressing enter in inventory with wearables or objects selected they will be added to your outfit, instead of replacing the wearable or object currently at their target destination." name="add_not_replace"/>
<check_box bottom_delta="-20" control_name="TurnAroundWhenWalkingBackwards" follows="top" height="16" label="Turn around when walking backwards" tool_tip="Certain AOs may turn you around even with this disabled." name="turn_around"/>
<check_box bottom_delta="-20" control_name="AnnounceStreamMetadata" follows="top" height="16" label="Announce music stream's metadata in local chat when tuned in" tool_tip="When a new song comes on, a message will be displayed in local chat with available information about the track." name="announce_stream_metadata"/>
</panel>
<panel border="true" left="1" bottom="-190" height="180" width="500" label="Tags/Colors" name="TagsColors">
<!-- Client tag options -->