• Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Creating a simple shuffle play button

    Scheduled Pinned Locked Moved Development
    5 Posts 3 Posters 4.8k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • U
      user1234
      last edited by

      I've been wanting this feature for a long time, so I'm developing it myself. I have never worked with qt before so require a little help.

      I would like to have a button that starts playing the playlist after shuffling (instead of having to manually click on a random track from the playlist, it's just inconvenient). This button would be positioned between the "Clear Playlist" and "Undo" buttons.

      I probably would have to create a new action in mainwindow.ui and add it to ui_->playlist->SetActions. And then create a corresponding function PlaylistShufflePlay() for it where shuffle (I couldn't find a function for this) is called before calling PlaylistPlay().

      Can somebody point me in the right direction on how this should be implemented?

      U 1 Reply Last reply
      Reply Quote 2
      • U
        user1234 @user1234
        last edited by

        Hi @jonas can you help me?

        jonasJ 1 Reply Last reply
        Reply Quote 1
        • jonasJ
          jonas @user1234
          last edited by

          @user1234
          I don't understand what you want to do here. Why can't you just press play?
          But you would need to do this in Mainwindow, Player and Playlist classes.

          U 1 Reply Last reply
          Reply Quote 0
          • U
            user1234 @jonas
            last edited by user1234

            @jonas

            I don't understand what you want to do here.

            I'll try to explain again:

            • So, let's say I'm playing a track from playlist A
            • Now, I would like to start playing a random track from playlist B

            To do this, I would have to

            • Click on playlist B
            • Select a random track manually from playlist B (or ctrl+h and then select a track)
            • Double click on the track to start playing it

            Why can't you just press play?

            • The play button controls the currently playing track (from playlist A, in my example)
            • So, pressing play just plays/pauses the current playing track

            Solution

            • A button that shuffles the current selected playlist (not the one that is currently playing) and then plays a track from it.

            Behavior when using this modified feature

            • I am playing a track from playlist A
            • I press play/pause button: the current track plays/pauses
            • I click on playlist B
            • There is a "Shuffle Play" button between the "Clear Playlist" and "Undo" buttons. I click on "Shuffle Play"
            • The playlist B is shuffled and a random track from the playlist B starts playing

            Hope this makes it clear. I'm pretty sure many people would like to have such a feature, it is pretty convenient this way.

            M 1 Reply Last reply
            Reply Quote 1
            • M
              mukmuk @user1234
              last edited by

              @user1234 id love a function like this, it feels ridiculous that this amazing full feature music player cant easily do something as simple as properly shuffle playlists.

              for that matter, neither the general shuffle function nor the shuffle playlist function do anything for me in that regard. i am simply unable to make the player choose a random playback order for any given playlist. it will always follow the album order, even if i manually pick a random track to start with...

              1 Reply Last reply
              Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              Powered by NodeBB | Contributors