I have a function:
void func(){
// initialization ignored ...
static_api_ptr_t<play_control>()->start(play_control::track_command_next);
static_api_ptr_t<playlist_manager> ()->playlist_remove_items(list_idx, bit_array_one(item_idx));
}
When the function is called, foobar2k always removes the song before playing the next one.
This would lead to the "wrong" next song to be played.
I also tried a callback on starting, which, however, makes foobar2k crash...
// in a class named RemoveCallBack:
void on_playback_starting(play_control::t_track_command p_command,bool p_paused) {
static_api_ptr_t<playlist_manager> list;
list->playlist_remove_items(list_idx, bit_array_one(item_idx));
static_api_ptr_t<play_callback_manager>()->unregister_callback(this);
}
// the previous func
void func(){
// initialization ignored ...
static_api_ptr_t<play_callback_manager>()->register_callback(
new service_impl_t<RemoveCallBack>,
play_callback::flag_on_playback_starting,
false
);
static_api_ptr_t<play_control>()->start(play_control::track_command_next);
}
How can I force foobar2k to play the next song before removing a specific song from the playlist?
Thanks.