summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia_streamingaudio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermedia_streamingaudio.cpp')
-rw-r--r--indra/newview/llviewermedia_streamingaudio.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/newview/llviewermedia_streamingaudio.cpp b/indra/newview/llviewermedia_streamingaudio.cpp
index b68ffbe1a2..7758ce3da6 100644
--- a/indra/newview/llviewermedia_streamingaudio.cpp
+++ b/indra/newview/llviewermedia_streamingaudio.cpp
@@ -34,6 +34,7 @@
#include "llmimetypes.h"
#include "lldir.h"
+#include "llnotificationmanager.h"
LLStreamingAudio_MediaPlugins::LLStreamingAudio_MediaPlugins() :
mMediaPlugin(NULL),
@@ -111,6 +112,8 @@ void LLStreamingAudio_MediaPlugins::update()
mMediaPlugin->idle();
}
+extern void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel);
+
int LLStreamingAudio_MediaPlugins::isPlaying()
{
if (!mMediaPlugin)
@@ -118,6 +121,24 @@ int LLStreamingAudio_MediaPlugins::isPlaying()
LLPluginClassMediaOwner::EMediaStatus status =
mMediaPlugin->getStatus();
+ auto nowPlaying = mMediaPlugin->getMediaNowPlaying();
+ if (mNowPlaying != nowPlaying)
+ {
+ mTitle = mMediaPlugin->getMediaTitle();
+ mNowPlaying = nowPlaying;
+ auto text = llformat("Now playing %s.", nowPlaying.c_str());
+ if (gSavedSettings.getBOOL("StreamNotificationChannelEnabled"))
+ {
+ send_chat_from_viewer(text, CHAT_TYPE_NORMAL, gSavedSettings.getS32("StreamNotificationChannel"));
+ }
+ else
+ {
+ LLChat chat{text};
+ chat.mFromName = mTitle;
+ chat.mSourceType = CHAT_SOURCE_SYSTEM;
+ LLNotificationsUI::LLNotificationManager::instance().onChat(chat, LLSD{});
+ }
+ }
switch (status)
{