Help - Search - Members - Calendar
Full Version: Cannot start playback
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
iscaryoth
Hello.
I'm writing my custom UI plugin, which is in early development stages. I've managed to display current playlist's items using titleformatting. However because UI is supposed to ease the interface I cannot only display the list. ;-) So I've added few (un)pretty buttons and added callbacks to start playing the music. But then I came across a problem - I cannot start any song. My first attempt was to call selected item from current playlist, which I tought could be done with:
CODE
static_api_ptr_t<playlist_manager> plm;
unsigned playlist = plm->get_active_playlist();
plm->playlist_execute_default_action(playlist, item);

item is also an unsigned sent from my playlist widget. The code ran, but didn't yield any results. I've checked the numbers and didn't found anything suspicious about them (playlist = 0; item = 0-19). The same thing happens when I try to standard_commands::main_play_or_pause(); or anything like it. All I get is that something threw an exception:
CODE
First-chance exception at 0x7c812a7b in foobar2000.exe: Microsoft C++ exception: foobar2000_io::exception_aborted at memory location 0x116df614..

or
CODE
First-chance exception at 0x7c812a7b in foobar2000.exe: Microsoft C++ exception: exception_tag_not_found at memory location 0x116ded2c..


Anyone got any idea what is going on?

Cheers.
musicmusic
It could be you aren't calling them from the main thread, although that usually throws a exception_wrong_thread exception (though not guaranteed).

If it's not that then there's something else funny going on. You can check for that by seeing what happens if you try to start playback via the command-line (foobar2000 /play etc.).
iscaryoth
QUOTE(musicmusic @ Mar 6 2008, 00:57) *

It could be you aren't calling them from the main thread, although that usually throws a exception_wrong_thread exception (though not guaranteed).

If it's not that then there's something else funny going on. You can check for that by seeing what happens if you try to start playback via the command-line (foobar2000 /play etc.).


tried, and got similiar output from the debugger (tried /play twice):
CODE
First-chance exception at 0x7c812a7b in foobar2000.exe: Microsoft C++ exception: foobar2000_io::exception_aborted at memory location 0x0956f614..
First-chance exception at 0x7c812a7b in foobar2000.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x7c812a7b in foobar2000.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
The thread 'Win32 Thread' (0x12ac) has exited with code 0 (0x0).
First-chance exception at 0x7c812a7b in foobar2000.exe: Microsoft C++ exception: foobar2000_io::exception_io_not_found at memory location 0x0012fb68..
First-chance exception at 0x7c812a7b in foobar2000.exe: Microsoft C++ exception: foobar2000_io::exception_io_already_exists at memory location 0x0012faf0..
The thread 'Win32 Thread' (0xea4) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xf10) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x12a8) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1298) has exited with code 1 (0x1).


What is strange is that when I switch to default UI everything's back to normal. ;/

5min later:

Ok, I've managed to solve the problem. My UI class was derivating from public play_callback so I could track what's going on. What I did wrong, was that I didn't register callback with play_callback_manager. :-)
Cheers!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.