A few changes after code review from Liru
This commit is contained in:
@@ -51,6 +51,11 @@ void reportToChat(const std::string& message)
|
||||
LLFloaterChat::addChat(chat, FALSE, FALSE);
|
||||
}
|
||||
|
||||
LLMediaFilter::LLMediaFilter()
|
||||
{
|
||||
loadMediaFilterFromDisk();
|
||||
}
|
||||
|
||||
void LLMediaFilter::filterMediaUrl(LLParcel* parcel)
|
||||
{
|
||||
if (!parcel) return;
|
||||
@@ -194,11 +199,6 @@ void LLMediaFilter::addToMediaList(const std::string& in_url, EMediaList list, b
|
||||
saveMediaFilterToDisk();
|
||||
}
|
||||
|
||||
void LLMediaFilter::init()
|
||||
{
|
||||
loadMediaFilterFromDisk();
|
||||
}
|
||||
|
||||
void LLMediaFilter::removeFromMediaList(string_vec_t domains, EMediaList list)
|
||||
{
|
||||
switch (list)
|
||||
@@ -364,7 +364,7 @@ bool handle_audio_filter_callback(const LLSD& notification, const LLSD& response
|
||||
}
|
||||
else if (command == PARCEL_MEDIA_COMMAND_TIME)
|
||||
{
|
||||
//LLViewerParcelMedia::seek(LLViewerParcelMedia::sMediaCommandTime);
|
||||
LLViewerParcelMedia::seek(LLViewerParcelMedia::sMediaCommandTime);
|
||||
}
|
||||
LLMediaFilter::getInstance()->setQueuedMediaCommand(0);
|
||||
}
|
||||
@@ -431,7 +431,7 @@ bool handle_media_filter_callback(const LLSD& notification, const LLSD& response
|
||||
}
|
||||
else if (command == PARCEL_MEDIA_COMMAND_TIME)
|
||||
{
|
||||
//LLViewerParcelMedia::seek(LLViewerParcelMedia::sMediaCommandTime);
|
||||
LLViewerParcelMedia::seek(LLViewerParcelMedia::sMediaCommandTime);
|
||||
}
|
||||
LLMediaFilter::getInstance()->setQueuedMediaCommand(0);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
return mMediaListUpdate.connect(cb);
|
||||
};
|
||||
|
||||
LLMediaFilter();
|
||||
void filterMediaUrl(LLParcel* parcel);
|
||||
void filterAudioUrl(const std::string& url);
|
||||
//void filterSharedMediaUrl
|
||||
@@ -66,7 +67,6 @@ public:
|
||||
void setCurrentAudioURL(const std::string url ) { mCurrentAudioURL = url; };
|
||||
void clearCurrentAudioURL() { mCurrentAudioURL.clear(); };
|
||||
bool filter(const std::string& url, EMediaList list);
|
||||
void init();
|
||||
|
||||
private:
|
||||
void loadMediaFilterFromDisk();
|
||||
|
||||
@@ -479,7 +479,6 @@ void LLOverlayBar::toggleMediaPlay(void*)
|
||||
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
|
||||
if (parcel)
|
||||
{
|
||||
//LLViewerParcelMedia::sIsUserAction = true;
|
||||
LLViewerParcelMedia::play(parcel);
|
||||
}
|
||||
}
|
||||
@@ -505,7 +504,6 @@ void LLOverlayBar::toggleMusicPlay(void*)
|
||||
// stream is stopped, it doesn't return the right thing - commenting out for now.
|
||||
// if ( gAudiop->isInternetStreamPlaying() == 0 )
|
||||
{
|
||||
//LLViewerParcelMedia::sIsUserAction = true;
|
||||
LLViewerParcelMedia::playStreamingMusic(parcel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1724,7 +1724,7 @@ bool idle_startup()
|
||||
if (STATE_MULTIMEDIA_INIT == LLStartUp::getStartupState())
|
||||
{
|
||||
LLStartUp::multimediaInit();
|
||||
LLMediaFilter::getInstance()->init();
|
||||
LLMediaFilter::instance();
|
||||
LLStartUp::setStartupState( STATE_FONT_INIT );
|
||||
display_startup();
|
||||
return FALSE;
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
<text bottom="-190" name="streaming_prefs_text">Streaming Preferences:</text>
|
||||
<text bottom="-295" height="12" name="audio_prefs_text">Audio Preferences:</text>
|
||||
<panel border="true" bottom="-172" filename="panel_audio.xml" height="165" label="Volume" left="142" name="Volume Panel" width="260"/>
|
||||
<check_box bottom="-195" control_name="MediaEnableFilter" follows="top" height="16" initial_value="true" label="Ask for permission (enables filtering)" left="142" name="media_filter_enable"/>
|
||||
<radio_group bottom="-195" control_name="MediaEnableFilter" follows="top" height="16" label="Media Filtering" tab_stop="true" draw_border="false">
|
||||
<radio_group bottom="-195" control_name="MediaEnableFilter" follows="top" height="16" label="Media Filtering" tab_stop="true" draw_border="false">
|
||||
<radio_item enabled="true" follows="left|top" height="16" left="0" length="1" mouse_opaque="true" name="Off" label="Off" value="0" width="30" type="string" />
|
||||
<radio_item enabled="true" follows="left|top" height="16" left_pad="4" length="1" mouse_opaque="true" name="Blacklist" label="Blacklist Only" value="1" width="30" type="string" />
|
||||
<radio_item enabled="true" follows="left|top" height="16" left_pad="4" length="1" mouse_opaque="true" name="Prompt" label="Prompt" value="2" width="30" type="string" />
|
||||
|
||||
@@ -4426,6 +4426,7 @@ Try enclosing path to the editor with double quotes.
|
||||
<!-- teleport_strings.xml's strings we need -->
|
||||
<string name="completed_from">Teleport completed from</string>
|
||||
|
||||
<!-- Media filter -->
|
||||
<string name="audio">audio</string>
|
||||
<string name="media">media</string>
|
||||
<string name="MediaFilterBlacklist">blacklist</string>
|
||||
|
||||
Reference in New Issue
Block a user