Permalink
Browse files

pvr: send OnStop and OnPlay announcements when switching channels

  • Loading branch information...
1 parent a79d074 commit 7bb55c31853128476d08005f177f1fdb3ea4c9bd @RobertMe RobertMe committed Aug 8, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 xbmc/pvr/PVRManager.cpp
View
@@ -40,6 +40,7 @@
#include "utils/StringUtils.h"
#include "threads/Atomics.h"
#include "windows/GUIWindowPVRCommon.h"
+#include "interfaces/AnnouncementManager.h"
#include "PVRManager.h"
#include "PVRDatabase.h"
@@ -56,6 +57,7 @@ using namespace std;
using namespace MUSIC_INFO;
using namespace PVR;
using namespace EPG;
+using namespace ANNOUNCEMENT;
CPVRManager::CPVRManager(void) :
CThread("PVR manager"),
@@ -991,6 +993,12 @@ bool CPVRManager::PerformChannelSwitch(const CPVRChannel &channel, bool bPreview
if (!bPreview)
SaveCurrentChannelSettings();
+ if (!bPreview && m_currentFile)
+ {
+ CVariant data(CVariant::VariantTypeObject);
+ CAnnouncementManager::Announce(Player, "xbmc", "OnStop", CFileItemPtr(new CFileItem(m_currentFile)), data);
+ }
+
SAFE_DELETE(m_currentFile);
lock.Leave();
@@ -1025,6 +1033,14 @@ bool CPVRManager::PerformChannelSwitch(const CPVRChannel &channel, bool bPreview
g_localizeStrings.Get(19035));
}
+ if (!bPreview && bSwitched)
+ {
+ CVariant param;
+ param["player"]["speed"] = 1;
+ param["player"]["playerid"] = g_playlistPlayer.GetCurrentPlaylist();
+ CAnnouncementManager::Announce(Player, "xbmc", "OnPlay", CFileItemPtr(new CFileItem(channel)), param);
+ }
+
return bSwitched;
}

0 comments on commit 7bb55c3

Please sign in to comment.