From a1862fe8f94d9d65b5d7d86edf1ee59560161e3c Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Mon, 6 Oct 2025 16:43:41 +0200 Subject: [PATCH] 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. --- src/ProjectMWrapper.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ProjectMWrapper.cpp b/src/ProjectMWrapper.cpp index db49dc3..75894f1 100644 --- a/src/ProjectMWrapper.cpp +++ b/src/ProjectMWrapper.cpp @@ -225,14 +225,20 @@ void ProjectMWrapper::PresetSwitchedEvent(bool isHardCut, unsigned int index, vo void ProjectMWrapper::PlaybackControlNotificationHandler(const Poco::AutoPtr& notification) { + bool shuffleEnabled = projectm_playlist_get_shuffle(_playlist); + switch (notification->ControlAction()) { case PlaybackControlNotification::Action::NextPreset: + projectm_playlist_set_shuffle(_playlist, false); projectm_playlist_play_next(_playlist, !notification->SmoothTransition()); + projectm_playlist_set_shuffle(_playlist, shuffleEnabled); break; case PlaybackControlNotification::Action::PreviousPreset: + projectm_playlist_set_shuffle(_playlist, false); projectm_playlist_play_previous(_playlist, !notification->SmoothTransition()); + projectm_playlist_set_shuffle(_playlist, shuffleEnabled); break; case PlaybackControlNotification::Action::LastPreset: @@ -240,7 +246,6 @@ void ProjectMWrapper::PlaybackControlNotificationHandler(const Poco::AutoPtrSmoothTransition()); projectm_playlist_set_shuffle(_playlist, shuffleEnabled); @@ -248,7 +253,7 @@ void ProjectMWrapper::PlaybackControlNotificationHandler(const Poco::AutoPtrsetBool("projectM.shuffleEnabled", !projectm_playlist_get_shuffle(_playlist)); + _userConfig->setBool("projectM.shuffleEnabled", !shuffleEnabled); break; case PlaybackControlNotification::Action::TogglePresetLocked: {