Amarok Weekly Newsletter - Issue 5

Rok the night (18.01.2007)

Issue 5:

 

More precise scores

Marc Adler pointed out possible problem with scoring algorithm. All scores are stored internally as integers, and rounded up if necessary, which can sometimes make troubles:

Lets say there is a song which was skipped 100 times. It has the current
score 1. Now it is played completly (should add a rating of 100). So we
end up with:

newscore = ( ( prevscore * playcount ) + percentage ) / ( playcount + 1 )
newscore = ((1 * 100) + 100 / 101) = 1.9801

1.9801 is saved as 1 in the database and we're back at the beginning. If the track already has a higher rating this situation happens even earlier. A track with an rating of 50 will not be able to reach a higher score after as much as 50 plays.

As from now on, all scores are being kept as floating point numbers.
As Mark Kretschmann said:

It's already fixed in SVN :)

By the way, Marc forgot one bracket. It's actually:

newscore = ((1 * 100) + 100) / 101

For more details take a look at  Amarok FAQ.

Fadeout

From now on Amarok makes a difference between "crossfade" and "fadeout". Crossfade occurs between two tracks, while fadeout at the end (of last one). Both options are controllable separately under settings dialog.

Configurable playlist color

Color of newly added playlist items, which has been introduced before, is now configurable. Maybe it should use some system color as default?

Filter editor

Filters are simple text widgets sitting on top of most Amarok windows, used for filtering content beneath them, be it playlist, collection, or statistics. They are very powerful tools, unfortunately not widely used, mostly because their possibilities are not known to many users. As from now on, Amarok includes filter editor, a nice dialog window for easy creation of filters. It shows all available filter categories, all you have to do is to pick one. Take a look:











After playing with options, resulting playlist filter could look like this:

Cool tips: DCOP goodies

DCOP is wonderful technology. It makes complex tasks easy. It's particularly interesting for script writers. Various Amarok-related actions are available as simple calls. Here are some useful ones:

Collection update and rescan:

  • dcop amarok collection scanCollectionChanges makes a collection update (scans for changes), while
  • dcop amarok collection scanCollection does a full rescan. For more information about update and rescan, see AWN#4.


You can also pause long scan with:

  • dcop amarok collection scanPause, and resume it with:
  • dcop amarok collection scanUnpause

Communicating with user is also easy. Use:

  • dcop amarok playlist popupMessage "Hello, I'm a script!" to show an Amaroked pop-up message, or just:
  • dcop amarok playlist shortStatusMessage "Some useful info" to write something to status bar.

 

One of the harder ones to spot is a call for quitting application. To quit Amarok, call:

  • dcop amarok MainApplication-Interface quit

A nice tool for browsing all available dcop calls is called "kdcop".




s