mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 20:13:36 +00:00
Make sure we notify remotes when shuffle status changes.
This commit is contained in:
parent
ec3a1909b2
commit
62c25d50a6
@ -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);
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user