The component adds a decoder for URIs of the form
CODE
random:|query|
where query is a valid playlist generator query. The component provides a main menu command to add ("Playlist/Add randomized entry...") and a playlist context menu command to edit ("Edit randomized entries...") entries of this form. The context menu command replaces the existing entry with the new one. It is recommended that you use these commands to manipulate randomized entries instead of the "Add location..." command, as they also check that the query is syntactically valid.The use of random: paths is limited to playback, i.e. you cannot use them with the Replaygain scanner or the converter. This is by design.
When a randomized entry is played, it will fiter the contents of the Media Library using the specified query and randomly chose one of them. During playback, the static metadata of the chosen track is made available to the player as dynamic information of the random: entry. This works similar to audio streams on the Internet. The dynamic metadata is augmented with "played_path" and "played_subsong" tech info fields that hold the location of the chosen track. The dynamic data of the chosen track is not available.
Note that dynamic metadata is available in (some) titleformatting scripts, including the playlist, main window caption and statusbar. It is however not available to the DSP pipeline, so Replaygain is applied by foo_random using the core settings.
There are a number of error conditions that can lead to the component not being able to play a "real" track. If the Media Library is empty or no tracks are left after filtering its contents, the component will raise a "Not found" type error. An error occurs as well, if the query is not syntactically correct. More information is printed on the console under these conditions.
If you try to use the Replaygain scanner or the converter on a randomized entry, the component will raise an "Access denied" type error. The same happen, if you try to change the tags of a randomized entry.
