Skip to content

Commit

Permalink
jsonrpc: reset screensaver when starting a video playlist (fixes #12170)
Browse files Browse the repository at this point in the history
  • Loading branch information
Montellese committed Nov 3, 2011
1 parent 4ac6808 commit 7d4f814
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
16 changes: 16 additions & 0 deletions xbmc/ApplicationMessenger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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};
Expand Down
1 change: 1 addition & 0 deletions xbmc/ApplicationMessenger.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class CApplicationMessenger
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);
Expand Down
5 changes: 4 additions & 1 deletion xbmc/interfaces/json-rpc/PlayerOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7d4f814

Please sign in to comment.