HydrogenAudio

Hosted Forums => foobar2000 => Development - (fb2k) => Topic started by: JohanDeBock on 2009-11-27 01:58:21

Title: basic playlist_loader
Post by: JohanDeBock on 2009-11-27 01:58:21
class playlist_loader_spl_xspf : public playlist_loader {
   virtual void open(const char* p_path, const service_ptr_t<file>& p_file, playlist_loader_callback& p_callback) {
      pfc::list_t<metadb_handle_ptr> tracks;
      ...
   }
}

How should I return the playlist in the open() function knowing that the metadb_handle_ptr's of the playlist traks are in the variable tracks?
Title: basic playlist_loader
Post by: Yirkha on 2009-11-27 09:17:29
By calling various methods of [font= "Courier New"]p_callback[/font] during processing.
Title: basic playlist_loader
Post by: JohanDeBock on 2009-11-27 14:51:20
Hmm I think it is impossible to do what I want with the normal playlist_loader .

I want to load an xspf playlist, but it will only include track_title track_artist couples, so no paths to a filename. A pure soft playlist.
So I need access to the library. But I think that is not possble?

static_api_ptr_t<library_manager> lm;
lm->get_all_items(library);

This doesn't seem to work.

So is there a way around it, or will i have to make a special menu entry to load these type of playlists?

And if yes, is there a fucntion provided to display a file load dialog filtered by an extension?
Title: basic playlist_loader
Post by: Yirkha on 2009-11-27 20:06:43
static_api_ptr_t<library_manager> lm;
lm->get_all_items(library);

This doesn't seem to work.
How specifically?

And if yes, is there a fucntion provided to display a file load dialog filtered by an extension?
[font= "Courier New"]uGetOpenFileName()[/font].
Title: basic playlist_loader
Post by: foosion on 2009-11-27 20:11:29
From the SDK documentation for class library_manager (http://foosion.foobar2000.org/doxygen/latest/classlibrary__manager.html):
Quote
All methods are valid from main thread only, unless noted otherwise.
Title: basic playlist_loader
Post by: JohanDeBock on 2009-11-27 21:02:58
Thanks for the info, I've made separate menu entries for what I'm trying to do.