Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Some questions about playback (Read 1373 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Some questions about playback

I have some questions about playback nad playlist manager API.

1. Has any method to set play track by metadb? I only find a method that set it to focus item and then call play.
2. How playlist_manager::playlist_execute_default_action work? I mean what will be called when playlist_manager::playlist_execute_default_action are executed?

foobar2000's document is really difficult to find, and the foo_sample is also not include this.
Thanks for help.

Re: Some questions about playback

Reply #1
1. You can use playback queue for this. E.g. media library viewer seems to work such way (its context menu item "Play"). Example:
Code: [Select]
metadb_handle_ptr myhadle = GetItSomeWay();

static_api_ptr_t<playlist_manager> pm;
pm->queue_flush();
pm->queue_add_item(myhandle);

static_api_ptr_t<playback_control>()->start();

2. As the comment in source code states, it starts playing the item unless playlist is "locked", which means playlist_manager::playlist_lock_install was called on it. In this case playlist_lock::execute_default_action of the lock instance is called and it is up to the lock what to do.