Help - Search - Members - Calendar
Full Version: plugin, changing contents of playlist
Hydrogenaudio Forums > Hosted Forums > foobar2000 > General - (fb2k)
zilch_
I've begin fiddning with writing a plugin now and got lost when trying to add/delete files in the playlist.
The most logical functioncall i can find is
play_control::command( play_control::PLAYLIST_ADDFILES, <something> );
but this only shows a add files dialog. how to do it?

i tried to find out what the different functions actually do but as the parameter always is cast to int and the code for unmangling the parameters is hidden in the core (i think) i cant find out.

thanks :))
Curi0us_George
Check out playlist_oper. It's probably what you're looking for.
zilch_
thanks a million :))
Aero
QUOTE(Curi0us_George @ Apr 27 2003 - 10:41 AM)
Check out playlist_oper.  It's probably what you're looking for.

This is what I use in foo_uftS (code stolen from DanZ):

CODE
class addFilesCallback : public playlist_loader_callback
{
virtual void on_entry(const playlist_entry *src)
{
 metadb_handle_list list;    
 list.add_item(metadb::get()->handle_create(src));
 playlist_oper::get()->add_items(list);
 list.delete_all();
}
};

static addFilesCallback afCallback;

...

playlist_loader::process_path(string_utf8_from_os(filename), &afCallback);



Works with both single files and directories.
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-2009 Invision Power Services, Inc.