Skip to content

Commit 2f76c9e

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 9151982 commit 2f76c9e

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
@@ -218,30 +218,35 @@ void ProjectMWrapper::PresetSwitchedEvent(bool isHardCut, unsigned int index, vo
218218

219219
void ProjectMWrapper::PlaybackControlNotificationHandler(const Poco::AutoPtr<PlaybackControlNotification>& notification)
220220
{
221+
bool shuffleEnabled = projectm_playlist_get_shuffle(_playlist);
222+
221223
switch (notification->ControlAction())
222224
{
223225
case PlaybackControlNotification::Action::NextPreset:
226+
projectm_playlist_set_shuffle(_playlist, false);
224227
projectm_playlist_play_next(_playlist, !notification->SmoothTransition());
228+
projectm_playlist_set_shuffle(_playlist, shuffleEnabled);
225229
break;
226230

227231
case PlaybackControlNotification::Action::PreviousPreset:
232+
projectm_playlist_set_shuffle(_playlist, false);
228233
projectm_playlist_play_previous(_playlist, !notification->SmoothTransition());
234+
projectm_playlist_set_shuffle(_playlist, shuffleEnabled);
229235
break;
230236

231237
case PlaybackControlNotification::Action::LastPreset:
232238
projectm_playlist_play_last(_playlist, !notification->SmoothTransition());
233239
break;
234240

235241
case PlaybackControlNotification::Action::RandomPreset: {
236-
bool shuffleEnabled = projectm_playlist_get_shuffle(_playlist);
237242
projectm_playlist_set_shuffle(_playlist, true);
238243
projectm_playlist_play_next(_playlist, !notification->SmoothTransition());
239244
projectm_playlist_set_shuffle(_playlist, shuffleEnabled);
240245
break;
241246
}
242247

243248
case PlaybackControlNotification::Action::ToggleShuffle:
244-
_userConfig->setBool("projectM.shuffleEnabled", !projectm_playlist_get_shuffle(_playlist));
249+
_userConfig->setBool("projectM.shuffleEnabled", !shuffleEnabled);
245250
break;
246251

247252
case PlaybackControlNotification::Action::TogglePresetLocked: {

0 commit comments

Comments
 (0)