Skip to main content
Topic: SDK - playlist (Read 4221 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

SDK - playlist

is there a way, how to get callback to playlist events? I mean to catch adding/removing items to/from the currently displayed playlist?

SDK - playlist

Reply #1
I think playlist_loader_callback is what you need, see playlist_loader.h.

SDK - playlist

Reply #2
Quote
I think playlist_loader_callback is what you need, see playlist_loader.h.

playlist_loader_callback does NOT inherit from service_base, so I can't use it like this:
static service_factory_single_t< playlist_loader_callback, playlist_loader_callback_ui > foo_playlist_loader_callback ;

is there a different way?

SDK - playlist

Reply #3
Whoops, I guess CG was right.

SDK - playlist

Reply #4
will you implement it in the new version?

SDK - playlist

Reply #5
Why exactly do you need it?

SDK - playlist

Reply #6
It has a lot of purposes.  Want to build a completely different interface?  You'll need it.  Want to change shuffle behavior?  You might need it.

SDK - playlist

Reply #7
Oops, forgot about that.

SDK - playlist

Reply #8
thaht's right - I make foo_remote plug-in and I want to display playlist in own window

SDK - playlist

Reply #9
Why do people want to make playlist windows?  The main foobar window is a playlist.  I can understand wanting a small window for controlling playback and showing the currently playing song, i use foo_wsgui and foo_uftS, but don't really see why people want to make their own playlist windows.

SDK - playlist

Reply #10
Well, Peter obviously does.  He plans to fully separate the GUI from the core in some future version.

SDK - playlist

Reply #11
Quote
Well, Peter obviously does.  He plans to fully separate the GUI from the core in some future version.

I agree, if Peter used the SDK more directly to do his playlist window we'd all be better off since he'd be forced to implement all the things we'd probably ever need.

For example, I'd like to extend the play_callback interface to include callbacks for toggling repeat, shuffle, and other things that are a little hard to keep in sync with the foobar main window.

Callbacks for playlist operations would prob. be nice too

and so on...

SDK - playlist

Reply #12
So gentlemen,
what is the resume - will anybody implement this feature?

SDK - playlist

Reply #13
I'm pretty sure that something like this is going to be in the 0.7 SDK.

SDK - playlist

Reply #14
class NOVTABLE metadb_callback : public service_base//use service_factory_single_t to instantiate, you will get called with database notifications
{
public:
   virtual void on_info_edited(metadb_handle * handle) {}
   virtual void on_info_reloaded(metadb_handle * handle) {}
   virtual void on_file_removed(metadb_handle * handle) {}
   virtual void on_file_moved(metadb_handle * src,metadb_handle * dst) {}
   virtual void on_file_new(metadb_handle * handle) {}//reserved for future use
   virtual void on_file_removed_user(metadb_handle * handle) {}//user requested file to be removed from db, file didn't get physically removed
//warning: all callback methods are called inside database_lock section ! watch out for deadlock conditions if you use SendMessage() or critical sections
   static GUID get_class_guid()
   {
      // {D5286BB4-FDED-47ef-A623-4C3FF056DEC1}
      static const GUID guid =
      { 0xd5286bb4, 0xfded, 0x47ef, { 0xa6, 0x23, 0x4c, 0x3f, 0xf0, 0x56, 0xde, 0xc1 } };
      return guid;
   }
};


Is that what you are looking for?

You should be able to traverse the playlist and build your own list.  This call back *should* allow you to keep your playlist in sync with the foobar playlist.

SDK - playlist

Reply #15
erm, the playlist is not the database

SDK - playlist

Reply #16
Quote
erm, the playlist is not the database

I thought he wanted the playlist?


Quote
is there a way, how to get callback to playlist events? I mean to catch adding/removing items to/from the currently displayed playlist?


Maybe I missed something later in the thread.

SDK - playlist

Reply #17
Yes, he wanted playlist.  And you posted the database callback.

SDK - playlist

Reply #18
Quote
Yes, he wanted playlist.  And you posted the database callback.

Ah, OK, my bad.

I used to above to detect when the old inet_reader updated the song title with the new metadata (which updates the the foobar playlist).  I didn't see the database/playlist distinction.

Thanks.

 
SimplePortal 1.0.0 RC1 © 2008-2019