Add option: notification on playback resume (#196)
* Add option: notification on playback resume This adds an optional setting to show the notification that is displayed when changing the track when resuming playback as well. * Modify resume notification calling This adds a new signal "Resumed" that is emitted when the player status is changed from Paused to Playing. The AlbumArtLoaded function will only be called again when playback is manually resumed, and not when the player is started for the first time or when the track is changed.
This commit is contained in:
@@ -492,6 +492,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, co
|
||||
connect(app_->player(), SIGNAL(Stopped()), ui_->playlist, SLOT(ActiveStopped()));
|
||||
|
||||
connect(app_->player(), SIGNAL(Paused()), osd_, SLOT(Paused()));
|
||||
connect(app_->player(), SIGNAL(Resumed()), osd_, SLOT(Resumed()));
|
||||
connect(app_->player(), SIGNAL(Stopped()), osd_, SLOT(Stopped()));
|
||||
connect(app_->player(), SIGNAL(PlaylistFinished()), osd_, SLOT(PlaylistFinished()));
|
||||
connect(app_->player(), SIGNAL(VolumeChanged(int)), osd_, SLOT(VolumeChanged(int)));
|
||||
|
||||
@@ -450,6 +450,7 @@ void Player::PlayPause() {
|
||||
switch (engine_->state()) {
|
||||
case Engine::Paused:
|
||||
engine_->Unpause();
|
||||
emit Resumed();
|
||||
break;
|
||||
|
||||
case Engine::Playing: {
|
||||
|
||||
@@ -104,6 +104,8 @@ class PlayerInterface : public QObject {
|
||||
signals:
|
||||
void Playing();
|
||||
void Paused();
|
||||
// Emitted only when playback is manually resumed
|
||||
void Resumed();
|
||||
void Stopped();
|
||||
void Error();
|
||||
void PlaylistFinished();
|
||||
|
||||
Reference in New Issue
Block a user