Skip to main content


Please be aware that much of the software linked to or mentioned on this forum is niche and therefore infrequently downloaded. Lots of anti-virus scanners and so-called malware detectors like to flag infrequently downloaded software as bad until it is either downloaded enough times, or its developer actually bothers with getting each individual release allow listed by every single AV vendor. You can do many people a great favor when encountering such a "problem" example by submitting them to your AV vendor for examination. For almost everything on this forum, it is a false positive.
Topic: Best way to get playlist index from metadb_handle_ptr (Read 2038 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Best way to get playlist index from metadb_handle_ptr


I need to get the current index of a song identified by a metadb_handle_ptr in the active playlist (coming from on_playback_new_track callback). Is there any other way than to enumerate through the whole playlist and check each metadb_handle_ptr returned by playlist_manager::activeplaylist_get_item_handle() ? This would be rather slow with very large playlists...

Thank you.

Best way to get playlist index from metadb_handle_ptr

Reply #1
You can get the playlist and index of the currently playing item through the playlist_manager class (provided that the currently playing item is on a playlist).

Best way to get playlist index from metadb_handle_ptr

Reply #2
I've tried playlist_manager::get_playing_item_location() before, but when I call this method in the play_callback::on_playback_new_track callback I get return value "false" when a song has been skipped, it seems that the callback will be called with stopped state so there is no way to get "playing" item in this callback function. So what I need is a method to get the index of a playlist item from a metadb_handle_ptr handle.

SimplePortal 1.0.0 RC1 © 2008-2021