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:
@@ -58,6 +58,7 @@ OSD::OSD(SystemTrayIcon *tray_icon, Application *app, QObject *parent)
|
||||
show_art_(true),
|
||||
show_on_play_mode_change_(true),
|
||||
show_on_pause_(true),
|
||||
show_on_resume_(false),
|
||||
use_custom_text_(false),
|
||||
custom_text1_(QString()),
|
||||
custom_text2_(QString()),
|
||||
@@ -90,6 +91,7 @@ void OSD::ReloadSettings() {
|
||||
show_art_ = s.value("ShowArt", true).toBool();
|
||||
show_on_play_mode_change_ = s.value("ShowOnPlayModeChange", true).toBool();
|
||||
show_on_pause_ = s.value("ShowOnPausePlayback", true).toBool();
|
||||
show_on_resume_ = s.value("ShowOnResumePlayback", false).toBool();
|
||||
use_custom_text_ = s.value(("CustomTextEnabled"), false).toBool();
|
||||
custom_text1_ = s.value("CustomText1").toString();
|
||||
custom_text2_ = s.value("CustomText2").toString();
|
||||
@@ -183,6 +185,12 @@ void OSD::Paused() {
|
||||
}
|
||||
}
|
||||
|
||||
void OSD::Resumed() {
|
||||
if (show_on_resume_) {
|
||||
AlbumArtLoaded(last_song_, last_image_uri_, last_image_);
|
||||
}
|
||||
}
|
||||
|
||||
void OSD::Stopped() {
|
||||
if (tray_icon_) tray_icon_->ClearNowPlaying();
|
||||
if (ignore_next_stopped_) {
|
||||
|
||||
@@ -80,6 +80,7 @@ class OSD : public QObject {
|
||||
void ReloadSettings();
|
||||
|
||||
void Paused();
|
||||
void Resumed();
|
||||
void Stopped();
|
||||
void StopAfterToggle(bool stop);
|
||||
void PlaylistFinished();
|
||||
@@ -115,6 +116,7 @@ class OSD : public QObject {
|
||||
bool show_art_;
|
||||
bool show_on_play_mode_change_;
|
||||
bool show_on_pause_;
|
||||
bool show_on_resume_;
|
||||
bool use_custom_text_;
|
||||
QString custom_text1_;
|
||||
QString custom_text2_;
|
||||
|
||||
Reference in New Issue
Block a user