Refactoring code that uses libvlc 1.0 to using libvlc 1.1

First, all exceptions are gone now. I'm not really sure they were working at all in previous versions, nothing ever threw exception. Delete all exception related functions:


Then delete all exception arguments, most of the functions remained the same, but without that argument.

libvlc_new ( list.count(), args, CVlcInstance::getException() );
libvlc_media_player_new_from_media ( m_media, CVlcInstance::getException() );
libvlc_media_player_event_manager ( m_player, CVlcInstance::getException() );
libvlc_media_player_play ( m_player, CVlcInstance::getException() );
libvlc_media_player_pause ( m_player, CVlcInstance::getException() );
libvlc_media_player_stop ( m_player, CVlcInstance::getException() );
libvlc_media_player_get_length ( m_player, CVlcInstance::getException() );
libvlc_media_player_get_media ( m_player, CVlcInstance::getException() );
libvlc_media_player_get_position ( m_player, CVlcInstance::getException() );
libvlc_media_player_get_media ( m_player, CVlcInstance::getException() );
libvlc_media_player_set_position ( m_player, pos, CVlcInstance::getException() );

The functions that were there for backward compatibility are gone:

libvlc_media_player_set_drawable ( m_player, this->winId(), CVlcInstance::getException() );
libvlc_media_player_set_xwindow ( m_player, this->winId() );

And some functions changed signature:

m_media = libvlc_media_new ( m_inst, tochar(m_content), CVlcInstance::getException() );
m_media = libvlc_media_new_path ( m_inst, tochar(m_content) );
libvlc_audio_toggle_mute ( (libvlc_instance_t*)m_inst, CVlcInstance::getException() );
libvlc_audio_toggle_mute ( (libvlc_media_player_t*)m_player );

Those were the changes needed for my application. After I made them the program worked fine and all vlc functions ran without errors.

Previous: How to implement loop feature in libVLC play video with Qt in c++
Next: My Unity user experience on Ubuntu 11.04