[Rhythmbox-devel] Changes to random behaviour



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 patch is attached to 163196 as:
http://bugzilla.gnome.org/attachment.cgi?id=101867

  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 suspect the maths of the weightings might need some
more thought.
    * 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.

Dave
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    | Running GNU/Linux on Alpha,68K| Happy  \ 
\ gro.gilbert @ treblig.org | MIPS,x86,ARM,SPARC,PPC & HPPA | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]