diff options
author | montellese <montellese@xbmc.org> | 2011-11-03 19:25:05 +0100 |
---|---|---|
committer | montellese <montellese@xbmc.org> | 2011-11-03 20:26:32 +0100 |
commit | 7d4f814e7d32d346b2fe80ae927f5f709f449bf9 (patch) | |
tree | 87e1ed883ae205b3981797473d36a5f289eb829a | |
parent | 4ac680860cf8e40a00d9674edd5d5f1d3fa04344 (diff) |
jsonrpc: reset screensaver when starting a video playlist (fixes #12170)
-rw-r--r-- | xbmc/ApplicationMessenger.cpp | 16 | ||||
-rw-r--r-- | xbmc/ApplicationMessenger.h | 1 | ||||
-rw-r--r-- | xbmc/interfaces/json-rpc/PlayerOperations.cpp | 5 |
3 files changed, 21 insertions, 1 deletions
diff --git a/xbmc/ApplicationMessenger.cpp b/xbmc/ApplicationMessenger.cpp index 9cd372331a..b9dfe21b81 100644 --- a/xbmc/ApplicationMessenger.cpp +++ b/xbmc/ApplicationMessenger.cpp @@ -329,6 +329,13 @@ case TMSG_POWERDOWN: delete list; } + else if (pMsg->dwParam1 == PLAYLIST_MUSIC || pMsg->dwParam1 == PLAYLIST_VIDEO) + { + if (g_playlistPlayer.GetCurrentPlaylist() != pMsg->dwParam1) + g_playlistPlayer.SetCurrentPlaylist(pMsg->dwParam1); + + PlayListPlayerPlay(pMsg->dwParam2); + } } break; @@ -838,6 +845,15 @@ void CApplicationMessenger::MediaPlay(const CFileItemList &list, int song) SendMessage(tMsg, true); } +void CApplicationMessenger::MediaPlay(int playlistid, int song /* = -1 */) +{ + ThreadMessage tMsg = {TMSG_MEDIA_PLAY}; + tMsg.lpVoid = NULL; + tMsg.dwParam1 = playlistid; + tMsg.dwParam2 = song; + SendMessage(tMsg, true); +} + void CApplicationMessenger::PlayFile(const CFileItem &item, bool bRestart /*= false*/) { ThreadMessage tMsg = {TMSG_MEDIA_PLAY}; diff --git a/xbmc/ApplicationMessenger.h b/xbmc/ApplicationMessenger.h index b0b4687ac6..1e8fbdb5b6 100644 --- a/xbmc/ApplicationMessenger.h +++ b/xbmc/ApplicationMessenger.h @@ -142,6 +142,7 @@ public: void MediaPlay(std::string filename); void MediaPlay(const CFileItem &item); void MediaPlay(const CFileItemList &item, int song = 0); + void MediaPlay(int playlistid, int song = -1); void MediaStop(); void MediaPause(); void MediaRestart(bool bWait); diff --git a/xbmc/interfaces/json-rpc/PlayerOperations.cpp b/xbmc/interfaces/json-rpc/PlayerOperations.cpp index db66808f4d..b05bea023e 100644 --- a/xbmc/interfaces/json-rpc/PlayerOperations.cpp +++ b/xbmc/interfaces/json-rpc/PlayerOperations.cpp @@ -438,12 +438,15 @@ JSON_STATUS CPlayerOperations::Open(const CStdString &method, ITransportLayer *t switch (playlistid) { case PLAYLIST_MUSIC: - case PLAYLIST_VIDEO: if (g_playlistPlayer.GetCurrentPlaylist() != playlistid) g_playlistPlayer.SetCurrentPlaylist(playlistid); g_application.getApplicationMessenger().PlayListPlayerPlay((int)parameterObject["item"]["position"].asInteger()); + OnPlaylistChanged(); + break; + case PLAYLIST_VIDEO: + g_application.getApplicationMessenger().MediaPlay(playlistid, (int)parameterObject["item"]["position"].asInteger()); OnPlaylistChanged(); break; |