After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 163196 - (ui-random-algorithm) Expose the different random algorithms in the UI
(ui-random-algorithm)
Expose the different random algorithms in the UI
Status: RESOLVED OBSOLETE
Product: rhythmbox
Classification: Other
Component: User Interface
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
: 451726 539202 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-01-07 03:35 UTC by James
Modified: 2018-05-24 10:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to add play order submenu (6.18 KB, application/x-gzip)
2006-02-03 13:56 UTC, James "Doc" Livingston
  Details
updated patch (15.06 KB, patch)
2006-03-18 05:04 UTC, James "Doc" Livingston
none Details | Review
updated patch (16.32 KB, patch)
2006-03-20 05:24 UTC, James "Doc" Livingston
none Details | Review
better patch (17.26 KB, patch)
2006-04-15 12:25 UTC, James "Doc" Livingston
needs-work Details | Review
random algorithms in preferences (45.57 KB, patch)
2007-12-30 21:17 UTC, Dave Gilbert
none Details | Review
Screenshot of new preference pane (27.89 KB, image/png)
2008-01-06 17:11 UTC, Dave Gilbert
  Details
Improved random patch (against svn 20081006 as in ubuntu - a little after 0.11.6) (54.28 KB, patch)
2008-11-13 01:00 UTC, Dave Gilbert
none Details | Review

Description James 2005-01-07 03:35:40 UTC
It would be nice if rhythmbox had multiple random algorithms that it could pick
from when the user wants random playback.  This would help avoid of the effects
of using just one algorithm (hearing the same tracks over again, etc.)

anyway, just an idea. :-)
Comment 1 Christophe Fergeau 2005-01-08 22:59:56 UTC
There's already support for various random algorithms, I dunno how to select
those however ;)
Comment 2 James "Doc" Livingston 2005-08-08 14:23:13 UTC
I think we definitely need a better way to select play-orders than the shuffle
and repeat checkboxes. There are a number of reasons for this, including:

1) There is no way to make alternate play-orders visible to the user.
2) I doubt anyone (who hasn't looked at the code) knows the different between
shuffle/repeat and shuffle/not-repeat.
3) I'm not sure how useful not-shuffle/not-reapeat is, because I think the "play
through the playlist once and then stop" usage would be fairly uncommon for
users of Rhythmbox.


I'm not sure of the best way of exposing this to the user; because it needs to
gain the ability to choose from multiple play-orders, which still being quick
and easy to change. I (personally) change between shuffle and linear regularly,
so don't want something that will take  considerably more time to change.

The obvious choice which will let the user choose from several play-orders is a
menu, but that is *much* slower than checkboxes because they can't scan the list
looking for the one they want until they have click on it.
Comment 3 James "Doc" Livingston 2006-02-03 13:56:09 UTC
Created attachment 58647 [details]
patch to add play order submenu

This was posted to the ML a while back by Paul Boyd (bughunter@gmail.com).

It replaces the Shuffle and Repeat menu items by a play order submenu. If this got updated for current cvs, and the toolbar items replaced, it would help to solve this. It also adds a "repeat one song" order.
Comment 4 Calvin Walton 2006-02-15 04:30:23 UTC
What I would suggest is replacing the shuffle and repeat buttons with a drop-down list. This would give a hint that the play order can be changed with the control (this would be easier to notice than something hidden in the main menus, although that should exist too, for a17y issues), and would give an overview of choices when clicked.
Comment 5 James "Doc" Livingston 2006-03-18 05:04:49 UTC
Created attachment 61473 [details] [review]
updated patch

Updated to cvs, and now uses GtkUIManager.

Having a GtkMenuToolButton in the toolbar would be nice, but I couldn't figure out how to add it without doing dodgy stuff. I'm not sure if you can a) put a GtkMenuToolButton in the xml ui definition file, and b) have a single menu which you attach to two places (the menu bar, and the toolbar item).

If we can't do (b), we can just add another gtk_ui_manager_add_ui call.
Comment 6 James "Doc" Livingston 2006-03-19 12:51:01 UTC
Adding the toolbar menu doesn't appear to be simple. GtkUIManager can't create GtkMenuToolButtons unless we create a new GtkAction-derived class for it, and insert the action specially. If we don't use GtkUIManager to build it, it's harded to add the play-order actions.
Comment 7 James "Doc" Livingston 2006-03-20 05:24:39 UTC
Created attachment 61589 [details] [review]
updated patch

Updated for cvs, minor fix.
Comment 8 Alex Lancaster 2006-03-20 09:40:32 UTC
I would like to keep a toolbar item, or some other way to inform the user as to the current algorithm being used, e.g. linear or some form of random selection, because it's easy to forget.  There should be some way of finding out what the status is at a glance, without going through the menus, so I'd vote for some kind of feedback, ideally a toolbar button.  Making it work for gtk2 2.6 would be nice. ;-)
Comment 9 James 2006-03-21 19:55:52 UTC
Perhaps another idea would be to factor in each song's play count 1 time out of 5.  This would start play the lesser played songs more often.
Comment 10 James "Doc" Livingston 2006-04-15 12:25:03 UTC
Created attachment 63566 [details] [review]
better patch

Adds the play order menu to the toolbar. RBMenuAction should really be in it's own file (not rb-glade-helpers) but I was lazy.

What should we do when the user presses the button next to the menu? Making it pop up the menu would work well, but I'm not sure how to do that. Another option would be to pop up a dialog listing all the play order, with really good descriptions of them, so people don't get confused.
Comment 11 Alex Lancaster 2006-12-18 05:52:47 UTC
Update summary to reflect the major remaining request: exposing the options in the UI, updating Priority to normal.
Comment 12 Yuan Yijun 2007-01-18 16:19:11 UTC
I like the foobar2k style of choices.
(see its UI snapshot:: http://foobar2000.org/screenshots/main-simple.png )

There is a drop down list called "order". The list items are::

# Playback/Order/Default
# Playback/Order/Random
# Playback/Order/Repeat (list)
# Playback/Order/Repeat One
# Playback/Order/Shuffle (list)
# Playback/Order/Shuffle album
# Playback/Order/Shuffle album 2 (directory)
# Playback/Order/Shuffle tag set 

(I find this list from its user guide, http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Commandline_Guide )

As of those choices, I like the "shuffle directory" most. I believe that no one would care about too detailed settings, such as random algorithms; but one will need these choices listed above.
Comment 13 Dave Gilbert 2007-12-30 21:16:32 UTC
Here's a different approach to this (I'll attach the diff in a sec).
It combines a lot of the random modes together and uses preferences to select the behavior:

------
Hi,
  I've spent some of the day looking under the covers of
Rhythmbox for the first time and would like to share a patch
I've put together today that changes the way the random play orders
work.  I'd been wanting some of the features for a while
and I had seen the patches in 
http://bugzilla.gnome.org/show_bug.cgi?id=163196
My approach is a little different.

  The main thing it does is to combine the various weighted
random orders into the single by-age-and-rating version
that already exists, but it adds preferences that allow the
user to specify how much they would like the age and rating
to influence the weight.  

  It also adds another weight into the calculation as a way
to penalise tracks that have been played 'very recently';
the user can specify in the preference a time period (e.g. 2 days)
and a penalty.  That way you get the weighted random but
with a much lower chance of getting the one you heard this morning.

  These preferences are sliders that go in a new tab in the 
preference dialogue.  I've also added on that pane a radio button
pair that specifies whether the 'shuffle' button sets shuffle
or random.  I feel this is better than the current situation
where the mode is hidden.

  It all works however there are a few rough edges:
    * The radio button to change the behaviour of shuffle is
only loosely tacked in - I think it would be best to kill off
the shuffle+repeat semantics and it would tidy my change up a
lot if I did - with the preference selection I don't believe
it is needed any longer.
    * I'm not sure I understand the best ways to use 'eel';
and I may have a few knotted eels in places.
    * I haven't updated the docs yet.

  I think the main advantage of doing things this way is that
for the casual inexperienced user there is no added complexity;
(as opposed to adding a mode selector on the main UI) and it exposes
the random mode without the odd combination of pressing the two
unrelated buttons.

  From a code point of view I believe the result is actually
smaller since it combines the equal, weighted by age, weighted
by rating and weighted by age and rating into one.

  It's my first rhythmbox (and gnome) patch so I would appreciate
constructive comments and I'll happily admit to doing some of this
by voodoo-coding and welcome suggestions.


Comment 14 Dave Gilbert 2007-12-30 21:17:33 UTC
Created attachment 101867 [details] [review]
random algorithms in preferences

See my description in previous comment
Comment 15 Dave Gilbert 2008-01-06 17:11:35 UTC
Created attachment 102277 [details]
Screenshot of new preference pane
Comment 16 Alex Lancaster 2008-03-25 01:23:52 UTC
I like the idea.  However, you probably need to have a few words in the preference pane explaining how shuffle is different from "random".   i.e shuffle is without replacement and random is with replacement, although hopefully explained in less mathematical terms for regular users.

Maybe:

shuffle: "don't repeat tracks"
random:  "tracks may be played more than once"
Comment 17 Alex Lancaster 2008-03-25 01:39:56 UTC
(In reply to comment #13)

>   It also adds another weight into the calculation as a way
> to penalise tracks that have been played 'very recently';
> the user can specify in the preference a time period (e.g. 2 days)
> and a penalty.  That way you get the weighted random but
> with a much lower chance of getting the one you heard this morning.
> 
>   These preferences are sliders that go in a new tab in the 
> preference dialogue.  I've also added on that pane a radio button
> pair that specifies whether the 'shuffle' button sets shuffle
> or random.  I feel this is better than the current situation
> where the mode is hidden.
> 
>   It all works however there are a few rough edges:
>     * The radio button to change the behaviour of shuffle is
> only loosely tacked in - I think it would be best to kill off
> the shuffle+repeat semantics and it would tidy my change up a
> lot if I did - with the preference selection I don't believe
> it is needed any longer.

Could you set the preferences to simulate the current behaviour of "shuffle" if it didn't appear as an explicit option?   i.e. if you set "Very recent period" to 0 would that effectively be shuffle?  If there was a series of obvious settings that would duplicate shuffle semantics exactly as it is now, then I'd support the removal of the explicit "shuffle" option.
Comment 18 Dave Gilbert 2008-03-30 15:06:59 UTC
Hi Alex,
  I don't think that it is possible to simulate 'shuffle' exactly based on the settings of the random weighting; the two algorithms are rather different; I'm also up for adding a description of the options if we can find an easy to understand description.

  Shuffle really is a shuffle of the pack of items; it takes the whole pack, shuffles it and then plays through the shuffle in order - it only does this shuffle once.
  Random does the random weightings as it selects each song.

Now you would think if you wanted to make sure you didn't get repeats you would want 'shuffle'; however I was finding on shuffle I was getting what appeared to be repeats - and I'm not 100% sure why; I looked at the shuffle code and couldn't find any obvious errors.

What I think happens is that the shuffle code redoes the shuffle every time you restart or I think under certain UI actions (e.g. selecting an album or perhaps changing the sort order?) - and since it doesn't hold any state between shuffles it's entirely possible the new shuffle will have a track you heard very recently near the beginning; (This still seems unlikely - but shuffle did seem to be being a bit repetitive for me and it's the only reason I can see).

The random stuff does the calculation on each song and since it has the 'last played' date is a lot less likely to repeat as long it is suitably weighted.
The only downside I can see is that it is possibly computationally a bit expensive compared to shuffle which does it once.

The weighting needs a better algorithm as well - my sliders currently scale the weights - but I think what is actually needed is something exponential to make it very non-linear.

Dave
Comment 19 Jonathan Matthew 2008-05-01 21:29:01 UTC
*** Bug 451726 has been marked as a duplicate of this bug. ***
Comment 20 Jonathan Matthew 2008-06-20 00:37:52 UTC
*** Bug 539202 has been marked as a duplicate of this bug. ***
Comment 21 Dave Gilbert 2008-11-13 01:00:07 UTC
Created attachment 122538 [details] [review]
Improved random patch (against svn 20081006 as in ubuntu - a little after 0.11.6)
Comment 22 Dave Gilbert 2008-11-13 01:03:00 UTC
I've just attached a new version of my patch - this one works on 0.11.6 (or the slightly after 0.11.6 Ubuntu has - but should patch on other versions) - and in particular fixes an important bug with the age and ratings bias (i.e. they didn't previously work) - it also removes some of the numbers from the dialog moving to more user friendly 'high' and 'low' as was suggested; I'm not sure i like that.

If you have the age bias full on and have any unplayed tracks you will get almost always those; I find about 25% of the way up (setting of 10) works nicely.
Comment 23 Jonathan Matthew 2008-11-14 15:10:31 UTC
I really don't think this is the right way to go.

The play order system is fine for linear/repeat/shuffle, but beyond that it's too opaque and single-purpose.  We should be able to use the same algorithm to create random(ish) selections of music to transfer to devices or burn to CDs or whatever else, and this approach won't do that.

I only have a few vague ideas about how I'd like this sort of thing to work.  I'll try to post more about this to the mailing list or something.
Comment 24 Dave Gilbert 2008-11-23 15:23:52 UTC
OK I look forward to the description of those ideas; I do like the way this patch changes the random behavior for me - but obviously some of that is personal preference; but I really think it improves things - and it makes the code simpler in the end; it might be less useful for random on a small set of songs (say random over an album).

I'd rather not leave this without any improvement at all.

Dave
Comment 25 GNOME Infrastructure Team 2018-05-24 10:40:06 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/rhythmbox/issues/52.