Help - Search - Members - Calendar
Full Version: foo_random
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
foosion
The component adds support for playlist entries that map to a random entry of a subset of the Media Library on playback.

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.
Silverbolt
Thanks, foosion.
foosion
Updated to version 1.1.

The component now outputs which file it picked for playback.

There is an issue with full file buffering affecting this component. If you get a "Not found" type error without any console messages originating from foo_random, try turning full file buffering off. This should be fixed in the next beta.
Killmaster
Hey this is pretty cool, thanks smile.gif
mixderax
1) When playing random song if pause is presed, the position slider goes to begining but when resuming jumps back.
2) When resume playback on start is enabled, when started a new song is chosen and it starts playing from place where the one that played before exiting. Yust wondering what will happend when the song chosen on startup is shorter than the progress on song playing before exiting.
foosion
QUOTE(mixderax @ Aug 31 2005, 05:26 PM)
1) When playing random song if pause is presed, the position slider goes to begining but when resuming jumps back.
*
That is an issue in the user interface. Nothing that can be solved in foo_random.

QUOTE(mixderax @ Aug 31 2005, 05:26 PM)
2) When resume playback on start is enabled, when started a new song is chosen and it starts playing from place where the one that played before exiting. Yust wondering what will happend when the song chosen on startup is shorter than the progress on song playing before exiting.
*
It will attemp to seek to the remembered point, hit the end of the file and skip to the next song (as determind by the playback order).
mixderax
Thank's
hunted
I know this is pretty trivial, but is there a chance of being able to set a title for the query, that is displayed when the track is not playing. If I were to make a really long query, it will get truncated. I like the 'Random:' part, but if we could give it our own title, that might making the playlists easier to read.
I guess if you plan on releasing the source like you have with your other components, I will add this myself, but maybe other people would find this useful.
NEMO7538
When a track is playing it would be nice also that Right Click --> Properties provides with the properties of the currently playing track (not the query).

.... if this is feasible.
foosion
hunted:
I'll think about it.

NEMO7538:
Unfortunately not.
foosion
foo_random updated for 0.9 RC 2006-03-11.
nightgaunt
QUOTE(foosion @ Mar 13 2006, 06:43 AM) *

foo_random updated for 0.9 RC 2006-03-11.


This is an awesome plug-in, and I'm totally psyched to be able to use a custom ratings-weighted shuffle. It looks like foo_random doesn't play especially well with playlist statistics or with audioscrobber. I imagine this is a pretty hard problem. Any insight into why this is the case, or suggested workarounds? It's not mission critical for me: this is a great bit of code and, as is, I really appreciate it.

stephen
foosion
The problem is that foo_random adds an additional layer of indirection that obscures what track is playing to all components that are not aware of what foo_random does - which means virtually every component in existence. This obfuscation is an (unavoidable) side-effect and not a deliberate attempt to prevent these other components from working.
Fiend Angelical
Sorry for reviving an old topic.

Is there a way to make foo_random truly random?

That is, a query that make foo_random pick rnadomly from my whole database? I'm currently struggling to find a plugin that offers truly random playback qualities.

(foo_dbshuffle? wink.gif )
foosion
You just need to devise a query that selects all songs, like "%path% IS *" or "NOT all IS golden".
Fiend Angelical
Aha, thank you. I will try it as soon as I finish processing the ReplayGains of my music collection.

LATER:

QUOTE(foosion @ Aug 28 2005, 21:55) *

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.

I'm non-computer programming literate. What is a 'syntactically valid' query? Is there anywhere I could look to help me learn these queries? I'm struggling to find a query that defines a random playlist by genre, or another tag field.

QUOTE(foosion @ Aug 28 2005, 21:55) *

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.

Could I ask why?
Squeller
QUOTE(Fiend Angelical @ Jun 7 2006, 05:02) *
I'm non-computer programming literate. What is a 'syntactically valid' query? Is there anywhere I could look to help me learn these queries?

http://www.hydrogenaudio.org/forums/index....ndpost&p=400521
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.