Make sure we notify remotes when shuffle status changes.

This commit is contained in:
casey langen 2017-02-07 23:22:04 -08:00
parent ec3a1909b2
commit 62c25d50a6
2 changed files with 11 additions and 5 deletions

View File

@ -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);

View File

@ -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();