Commit 93f4535f authored by Michael Pyne's avatar Michael Pyne

player: Handle Phonon-generated pause actions.

It seems we can get into a Phonon pause state without going through
JuK's own pause-specific code path. With this patch I can watch KMix
receive pause events on MPRIS2 with phonon-vlc.

Based on a patch by James Smith that has been languishing in a review
request. My apologies for the delay! Some whitespace fixes as well.

If there's an open Juk bug for this please let me know and I'll review
it. I'm closing/CC-ing the one bug I see that might be relevant, which
couldn't be reproduced earlier (and shouldn't be reproduceable after
this change).

REVIEW:118754
BUG:290689
parent aad41038
......@@ -287,8 +287,6 @@ void PlayerManager::pause()
action("pause")->setEnabled(false);
m_media[m_curOutputPath]->pause();
emit signalPause();
}
void PlayerManager::stop()
......@@ -532,7 +530,10 @@ void PlayerManager::slotStateChanged(Phonon::State newstate, Phonon::State oldst
emit signalStop();
}
else if(newstate == Phonon::PlayingState) {
else if(newstate == Phonon::PausedState) {
emit signalPause();
}
else { // PlayingState or BufferingState
action("pause")->setEnabled(true);
action("stop")->setEnabled(true);
action("forward")->setEnabled(true);
......@@ -540,13 +541,12 @@ void PlayerManager::slotStateChanged(Phonon::State newstate, Phonon::State oldst
action("forwardAlbum")->setEnabled(true);
action("back")->setEnabled(true);
JuK::JuKInstance()->setWindowTitle(i18nc(
"%1 is the artist and %2 is the title of the currently playing track.",
"%1 - %2 :: JuK",
m_file.tag()->artist(),
"%1 - %2 :: JuK",
m_file.tag()->artist(),
m_file.tag()->title()));
emit signalPlay();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment