I am building a small application in C++ using libvlc.dll (libvlc_control.dll actually since I am using the 0.9.0 version from the trunk). Things are working pretty well and I have most of what I need completed. But I need to detect the end of whatever is playing. I have tried using the event manager and a callback without success. Here is how I do things when I start the play (I have removed all error checking code to make it concise):
Code: Select all
libvlc_playlist_add_extended(aLibvlcInstance, pFile, NULL, lNbVLCArgs, lVLCArgs, aLibvlcException);
libvlc_playlist_play(aLibvlcInstance, 0, 0, NULL, aLibvlcException);
lMediaInstance = libvlc_playlist_get_media_instance(aLibvlcInstance, aLibvlcException);
lEventManager = libvlc_media_instance_event_manager(lMediaInstance, aLibvlcException);
libvlc_event_attach(lEventManager, libvlc_MediaInstanceReachedEnd,
mMediaInstanceReachedEnd, this, aLibvlcException);
Code: Select all
static void mMediaInstanceReachedEnd( const libvlc_event_t * p_event, void * p_user_data );
I would rather detect when the playlist finishes completly, not each file of the playlist, but there does not seem to be any API for that?
Jacques Boileau