Hydrogenaudio Forums

Hosted Forums => foobar2000 => Development - (fb2k) => Topic started by: LeLeMoe on 2019-10-26 13:57:52

Title: Some questions about playback
Post by: LeLeMoe on 2019-10-26 13:57:52
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.
Title: Re: Some questions about playback
Post by: 3dyd on 2019-11-18 09:46:51
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.
SimplePortal 1.0.0 RC1 © 2008-2019