diff --git a/src/core/audio/PlaybackService.cpp b/src/core/audio/PlaybackService.cpp index 29c25a87b..cd6da8973 100755 --- a/src/core/audio/PlaybackService.cpp +++ b/src/core/audio/PlaybackService.cpp @@ -326,14 +326,11 @@ void PlaybackService::ProcessMessage(IMessage &message) { this->VolumeChanged(); } else if (type == MESSAGE_MODE_CHANGED) { - RepeatMode mode = this->repeatMode; - bool shuffled = this->IsShuffled(); - for (auto it = remotes.begin(); it != remotes.end(); it++) { - (*it)->OnModeChanged(repeatMode, shuffled); - } + this->NotifyRemotesModeChanged(); this->ModeChanged(); } else if (type == MESSAGE_SHUFFLED) { + this->NotifyRemotesModeChanged(); this->Shuffled(!!message.UserData1()); } else if (type == MESSAGE_TIME_CHANGED) { @@ -344,6 +341,14 @@ void PlaybackService::ProcessMessage(IMessage &message) { } } +void PlaybackService::NotifyRemotesModeChanged() { + RepeatMode mode = this->repeatMode; + bool shuffled = this->IsShuffled(); + for (auto it = remotes.begin(); it != remotes.end(); it++) { + (*it)->OnModeChanged(repeatMode, shuffled); + } +} + void PlaybackService::OnTrackChanged(size_t pos, TrackPtr track) { this->playingTrack = track; this->TrackChanged(this->index, track); diff --git a/src/core/audio/PlaybackService.h b/src/core/audio/PlaybackService.h index 1b4f2314a..efec8e115 100755 --- a/src/core/audio/PlaybackService.h +++ b/src/core/audio/PlaybackService.h @@ -167,6 +167,7 @@ namespace musik { namespace core { namespace audio { void OnTrackChanged(size_t pos, musik::core::TrackPtr track); void OnVolumeChanged(); void OnTimeChanged(double time); + void NotifyRemotesModeChanged(); void PrepareNextTrack(); void InitRemotes(); void ResetRemotes();