-
-
Notifications
You must be signed in to change notification settings - Fork 255
Add a shuffle button to shuffle tracks that are in the queue #3283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
517c638
3c67b03
8ae387f
3d0129b
1adbf5f
02fc101
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -8,6 +8,7 @@ import { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
faMusic, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
faPauseCircle, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
faPlayCircle, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
faShuffle, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
faSlash, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
faVolumeUp, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
faMaximize, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -454,6 +455,13 @@ function BrainzPlayerUI(props: React.PropsWithChildren<BrainzPlayerUIProps>) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onClick={toggleRepeatMode} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{!isMobile && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<FontAwesomeIcon | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
icon={faShuffle} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
title="Shuffle queue" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onClick={() => dispatch({ type: "SHUFFLE_QUEUE" })} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
<div className="player-buttons secondary"> | |
<FeedbackButtons | |
currentListenFeedback={currentListenFeedback} | |
isPlayingATrack={isPlayingATrack} | |
submitLikeFeedback={submitLikeFeedback} | |
submitDislikeFeedback={submitDislikeFeedback} | |
/> | |
<PlaybackControlButton | |
className="toggle-queue-button" | |
action={toggleQueue} | |
title="Queue" | |
icon={faBarsStaggered} | |
size="xl" | |
/> | |
<PlaybackControlButton | |
className={queueRepeatMode.title} | |
action={toggleRepeatMode} | |
title={queueRepeatMode.title} | |
icon={queueRepeatMode.icon} | |
color={queueRepeatMode.color} | |
size="xl" | |
/> | |
<PlaybackControlButton | |
action={toggleShowVolume} | |
title="Volume" | |
icon={faVolumeUp} | |
size="xl" | |
/> | |
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I appreciate your solution, I think this is not what users will expect from a music player. Normally, in all cases I remember using a shuffle option, instead of instantly shuffling the queue, activating "shuffle mode" will instead change the selection process for the next track, making it random, without visually affecting the queue.
So I think this action should be called
SHUFFLE_MODE
and should store a boolean state for the sameshuffleMode
.Then the random picking would need to happen in the playNextTrack method in BrainzPlayer component:
listenbrainz-server/frontend/js/src/common/brainzplayer/BrainzPlayer.tsx
Line 545 in f9c9198
This method should access the value of shuffle mode in the brainzPlayerContext (
brainzPlayerContextRef.current.shuffleMode
in this case) and decide what to do depending on that boolean state.