Skip to main content

Topic: basic playlist_loader (Read 3287 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • JohanDeBock
  • [*][*][*][*]
  • Developer
basic playlist_loader
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?
foo_softplaylists: http://tiny.cc/kh9m9

  • Yirkha
  • [*][*][*][*][*]
  • Moderator
basic playlist_loader
Reply #1
By calling various methods of [font= "Courier New"]p_callback[/font] during processing.
Full-quoting makes you scroll past the same junk over and over.

  • JohanDeBock
  • [*][*][*][*]
  • Developer
basic playlist_loader
Reply #2
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?
foo_softplaylists: http://tiny.cc/kh9m9

  • Yirkha
  • [*][*][*][*][*]
  • Moderator
basic playlist_loader
Reply #3
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].
Full-quoting makes you scroll past the same junk over and over.

  • foosion
  • [*][*][*][*][*]
  • Moderator
basic playlist_loader
Reply #4
From the SDK documentation for class library_manager:
Quote
All methods are valid from main thread only, unless noted otherwise.
http://foosion.foobar2000.org/ - my components for foobar2000

  • JohanDeBock
  • [*][*][*][*]
  • Developer
basic playlist_loader
Reply #5
Thanks for the info, I've made separate menu entries for what I'm trying to do.
foo_softplaylists: http://tiny.cc/kh9m9