Skip to content

Commit a1862fe

Browse files
committed
Don't shuffle when manually using prev/next commands
Description also says "nect/prev preset in playlist", so it's better to disable shuffle when performing manual preset changes. A random preset can always be picked using the r key.
1 parent cce5d35 commit a1862fe

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ProjectMWrapper.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,30 +225,35 @@ void ProjectMWrapper::PresetSwitchedEvent(bool isHardCut, unsigned int index, vo
225225

226226
void ProjectMWrapper::PlaybackControlNotificationHandler(const Poco::AutoPtr<PlaybackControlNotification>& notification)
227227
{
228+
bool shuffleEnabled = projectm_playlist_get_shuffle(_playlist);
229+
228230
switch (notification->ControlAction())
229231
{
230232
case PlaybackControlNotification::Action::NextPreset:
233+
projectm_playlist_set_shuffle(_playlist, false);
231234
projectm_playlist_play_next(_playlist, !notification->SmoothTransition());
235+
projectm_playlist_set_shuffle(_playlist, shuffleEnabled);
232236
break;
233237

234238
case PlaybackControlNotification::Action::PreviousPreset:
239+
projectm_playlist_set_shuffle(_playlist, false);
235240
projectm_playlist_play_previous(_playlist, !notification->SmoothTransition());
241+
projectm_playlist_set_shuffle(_playlist, shuffleEnabled);
236242
break;
237243

238244
case PlaybackControlNotification::Action::LastPreset:
239245
projectm_playlist_play_last(_playlist, !notification->SmoothTransition());
240246
break;
241247

242248
case PlaybackControlNotification::Action::RandomPreset: {
243-
bool shuffleEnabled = projectm_playlist_get_shuffle(_playlist);
244249
projectm_playlist_set_shuffle(_playlist, true);
245250
projectm_playlist_play_next(_playlist, !notification->SmoothTransition());
246251
projectm_playlist_set_shuffle(_playlist, shuffleEnabled);
247252
break;
248253
}
249254

250255
case PlaybackControlNotification::Action::ToggleShuffle:
251-
_userConfig->setBool("projectM.shuffleEnabled", !projectm_playlist_get_shuffle(_playlist));
256+
_userConfig->setBool("projectM.shuffleEnabled", !shuffleEnabled);
252257
break;
253258

254259
case PlaybackControlNotification::Action::TogglePresetLocked: {

0 commit comments

Comments
 (0)