Help - Search - Members - Calendar
Full Version: Listing subsongs in the playlist (like Foo_Dumb)
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
OPLx
Hi everyone,

I'm currently working on a fb2k v0.8.3 compatible plugin of my .d00 player Ganbatte!; I'd like to list the subsongs similar to how it's done in the foo_dumb plugin, but after many hours of searching through the fb2k API, I'm having trouble finding the appropriate calls to accomplish this.

Could anyone be so kind as to point me in the proper direction?

Thank you.

OPLx
foosion
You will have to implement a track_indexer service which analyzes a file and reports to the player the tracks inside it. The subsong index is the key to distuingishing multiple tracks inside a file; for single-track files this is always 0 by convention, but for your own multi-track input you can use anything you like. For a file with n tracks, you can number the tracks from 0 to n-1 (or from 1 to n) or you use some kind of identifier for each track. As long as your track_indexer and your input agree on the use of the sugsong index, everything is fine.

You may need to look at the metadb service for how to create a metadb_handle.
OPLx
Thanks foosion for the pointer; I'll give it a shot. Hopefully I'll have this thing done soon ... I've put it off for far too long! crying.gif
oshah
QUOTE(OPLx @ Nov 17 2005, 12:33 PM)
Thanks foosion for the pointer; I'll give it a shot.  Hopefully I'll have this thing done soon ... I've put it off for far too long!  crying.gif
*



For sample code you can take a look at: SDK/foo_input_std/ogg_indexer.cpp which is the subsong indexer class for the OGG plugin. All you have to do is alter line 18/40:

CODE
unsigned  links = ogg_helper::query_link_count(filename,r);


to call your own function which returns the number of tracks in the song. You can then recover the subsong index in input::open() by checking info->get_subsong_index(). If the ex function was used, you can also save off important info (such as where the subsongs are located) using the metadb_handle.
OPLx
foosion and oshah, thanks again for the information. The plugin is finally complete! If anyone's interested, it can be downloaded from here.
Thanks again! smile.gif
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.