Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #3230 from spudwebb/master

Added JSONRPC.NotifyAll as a built-in function
  • Loading branch information...
commit 147d0105599740c88a1533b9d3ac028d0d9b8804 2 parents eefb50d + 9ab4925
Arne Morten Kvarving authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 xbmc/interfaces/Builtins.cpp
View
16 xbmc/interfaces/Builtins.cpp
@@ -45,10 +45,12 @@
#include "addons/AddonManager.h"
#include "addons/PluginSource.h"
#include "interfaces/generic/ScriptInvocationManager.h"
+#include "interfaces/AnnouncementManager.h"
#include "network/NetworkServices.h"
#include "utils/log.h"
#include "storage/MediaManager.h"
#include "utils/RssManager.h"
+#include "utils/JSONVariantParser.h"
#include "PartyModeManager.h"
#include "profiles/ProfilesManager.h"
#include "settings/DisplaySettings.h"
@@ -138,6 +140,7 @@ const BUILT_IN commands[] = {
#endif
{ "RunPlugin", true, "Run the specified plugin" },
{ "RunAddon", true, "Run the specified plugin/script" },
+ { "NotifyAll", true, "Notify all connected clients" },
{ "Extract", true, "Extracts the specified archive" },
{ "PlayMedia", true, "Play the specified media file (or playlist)" },
{ "SlideShow", true, "Run a slideshow from the specified directory" },
@@ -587,6 +590,19 @@ int CBuiltins::Execute(const CStdString& execString)
CLog::Log(LOGERROR, "XBMC.RunAddon called with no arguments.");
}
}
+ else if (execute.Equals("notifyall"))
+ {
+ if (params.size() > 1)
+ {
+ CVariant data;
+ if (params.size() > 2)
+ data = CJSONVariantParser::Parse((const unsigned char *)params[2].c_str(), params[2].size());
+
+ ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::Other, params[0], params[1], data);
+ }
+ else
+ CLog::Log(LOGERROR, "XBMC.NotifyAll needs two parameters");
+ }
else if (execute.Equals("playmedia"))
{
if (!params.size())
Please sign in to comment.
Something went wrong with that request. Please try again.