Commit 0851b345 authored by Rémi Duraffort's avatar Rémi Duraffort

libvlcpp: fix compilation.

parent 76beeb83
...@@ -22,16 +22,12 @@ ...@@ -22,16 +22,12 @@
*****************************************************************************/ *****************************************************************************/
#include "audio.hpp" #include "audio.hpp"
#include "exception.hpp"
using namespace libvlc; using namespace libvlc;
Audio::Audio( libvlc_instance_t *libvlcInstance, libvlc_media_player_t *player ) Audio::Audio( libvlc_media_player_t *player )
{ {
m_libvlcInstance = libvlcInstance;
libvlc_retain( m_libvlcInstance );
m_player = player; m_player = player;
libvlc_media_player_retain( m_player ); libvlc_media_player_retain( m_player );
} }
...@@ -39,50 +35,45 @@ Audio::Audio( libvlc_instance_t *libvlcInstance, libvlc_media_player_t *player ) ...@@ -39,50 +35,45 @@ Audio::Audio( libvlc_instance_t *libvlcInstance, libvlc_media_player_t *player )
Audio::~Audio() Audio::~Audio()
{ {
libvlc_media_player_release( m_player ); libvlc_media_player_release( m_player );
libvlc_release( m_libvlcInstance );
} }
void Audio::toggleMute() void Audio::toggleMute()
{ {
libvlc_audio_toggle_mute( m_libvlcInstance ); libvlc_audio_toggle_mute( m_player );
} }
int Audio::mute() int Audio::mute()
{ {
return libvlc_audio_get_mute( m_libvlcInstance ); return libvlc_audio_get_mute( m_player );
} }
void Audio::setMute( int mute ) void Audio::setMute( int mute )
{ {
libvlc_audio_set_mute( m_libvlcInstance, mute ); libvlc_audio_set_mute( m_player, mute );
} }
int Audio::volume() int Audio::volume()
{ {
return libvlc_audio_get_volume( m_libvlcInstance ); return libvlc_audio_get_volume( m_player );
} }
void Audio::setVolume( int volume ) void Audio::setVolume( int volume )
{ {
Exception ex; libvlc_audio_set_volume( m_player, volume );
libvlc_audio_set_volume( m_libvlcInstance, volume, &ex.ex );
} }
int Audio::track() int Audio::track()
{ {
Exception ex; return libvlc_audio_get_track( m_player );
return libvlc_audio_get_track( m_player, &ex.ex );
} }
int Audio::trackCount() int Audio::trackCount()
{ {
Exception ex; return libvlc_audio_get_track_count( m_player );
return libvlc_audio_get_track_count( m_player, &ex.ex );
} }
void Audio::setTrack( int track ) void Audio::setTrack( int track )
{ {
Exception ex; libvlc_audio_set_track( m_player, track );
libvlc_audio_set_track( m_player, track, &ex.ex );
} }
...@@ -38,10 +38,9 @@ class Audio ...@@ -38,10 +38,9 @@ class Audio
public: public:
/** /**
* Constructor * Constructor
* @param libvlcInstance: the libvlc instance
* @param player: the player handling the audio * @param player: the player handling the audio
*/ */
Audio( libvlc_instance_t *libvlcInstance, libvlc_media_player_t *player ); Audio( libvlc_media_player_t *player );
/** Destructor */ /** Destructor */
~Audio(); ~Audio();
...@@ -111,9 +110,6 @@ public: ...@@ -111,9 +110,6 @@ public:
private: private:
/** The media player instance of libvlc */ /** The media player instance of libvlc */
libvlc_media_player_t *m_player; libvlc_media_player_t *m_player;
/** The instance of libvlc */
libvlc_instance_t *m_libvlcInstance;
}; };
}; };
......
...@@ -28,14 +28,12 @@ using namespace libvlc; ...@@ -28,14 +28,12 @@ using namespace libvlc;
MediaPlayer::MediaPlayer( libVLC &libvlcInstance ) MediaPlayer::MediaPlayer( libVLC &libvlcInstance )
{ {
Exception ex; m_player = libvlc_media_player_new( libvlcInstance.m_instance );
m_player = libvlc_media_player_new( libvlcInstance.m_instance, &ex.ex );
} }
MediaPlayer::MediaPlayer( Media &media ) MediaPlayer::MediaPlayer( Media &media )
{ {
Exception ex; m_player = libvlc_media_player_new_from_media( media.m_media );
m_player = libvlc_media_player_new_from_media( media.m_media, &ex.ex );
} }
MediaPlayer::~MediaPlayer() MediaPlayer::~MediaPlayer()
...@@ -55,14 +53,12 @@ int MediaPlayer::isPlaying() ...@@ -55,14 +53,12 @@ int MediaPlayer::isPlaying()
void MediaPlayer::play() void MediaPlayer::play()
{ {
Exception ex; libvlc_media_player_play( m_player );
libvlc_media_player_play( m_player, &ex.ex );
} }
void MediaPlayer::pause() void MediaPlayer::pause()
{ {
Exception ex; libvlc_media_player_pause( m_player );
libvlc_media_player_pause( m_player, &ex.ex );
} }
void MediaPlayer::stop() void MediaPlayer::stop()
...@@ -112,104 +108,87 @@ void *MediaPlayer::hwnd() ...@@ -112,104 +108,87 @@ void *MediaPlayer::hwnd()
int64_t MediaPlayer::lenght() int64_t MediaPlayer::lenght()
{ {
Exception ex; return libvlc_media_player_get_length( m_player );
return libvlc_media_player_get_length( m_player, &ex.ex );
} }
int64_t MediaPlayer::time() int64_t MediaPlayer::time()
{ {
Exception ex; return libvlc_media_player_get_time( m_player );
return libvlc_media_player_get_time( m_player, &ex.ex );
} }
void MediaPlayer::setTime( int64_t new_time ) void MediaPlayer::setTime( int64_t new_time )
{ {
Exception ex; libvlc_media_player_set_time( m_player, new_time );
libvlc_media_player_set_time( m_player, new_time, &ex.ex );
} }
float MediaPlayer::position() float MediaPlayer::position()
{ {
Exception ex; return libvlc_media_player_get_position( m_player );
return libvlc_media_player_get_position( m_player, &ex.ex );
} }
void MediaPlayer::setPosition( float position ) void MediaPlayer::setPosition( float position )
{ {
Exception ex; libvlc_media_player_set_position( m_player, position );
libvlc_media_player_set_position( m_player, position, &ex.ex );
} }
int MediaPlayer::chapter() int MediaPlayer::chapter()
{ {
Exception ex; return libvlc_media_player_get_chapter( m_player );
return libvlc_media_player_get_chapter( m_player, &ex.ex );
} }
int MediaPlayer::chapterCount() int MediaPlayer::chapterCount()
{ {
Exception ex; return libvlc_media_player_get_chapter_count( m_player );
return libvlc_media_player_get_chapter_count( m_player, &ex.ex );
} }
int MediaPlayer::chapterCount( int title ) int MediaPlayer::chapterCount( int title )
{ {
Exception ex; return libvlc_media_player_get_chapter_count_for_title( m_player, title );
return libvlc_media_player_get_chapter_count_for_title( m_player, title, &ex.ex );
} }
void MediaPlayer::setChapter( int title ) void MediaPlayer::setChapter( int title )
{ {
Exception ex; libvlc_media_player_set_chapter( m_player, title );
libvlc_media_player_set_chapter( m_player, title, &ex.ex );
} }
int MediaPlayer::willPlay() int MediaPlayer::willPlay()
{ {
Exception ex; return libvlc_media_player_will_play( m_player );
return libvlc_media_player_will_play( m_player, &ex.ex );
} }
int MediaPlayer::title() int MediaPlayer::title()
{ {
Exception ex; return libvlc_media_player_get_title( m_player );
return libvlc_media_player_get_title( m_player, &ex.ex );
} }
int MediaPlayer::titleCount() int MediaPlayer::titleCount()
{ {
Exception ex; return libvlc_media_player_get_title_count( m_player );
return libvlc_media_player_get_title_count( m_player, &ex.ex );
} }
void MediaPlayer::setTitle( int title ) void MediaPlayer::setTitle( int title )
{ {
Exception ex; libvlc_media_player_set_title( m_player, title );
libvlc_media_player_set_title( m_player, title, &ex.ex );
} }
void MediaPlayer::previousChapter() void MediaPlayer::previousChapter()
{ {
Exception ex; libvlc_media_player_previous_chapter( m_player );
libvlc_media_player_previous_chapter( m_player, &ex.ex );
} }
void MediaPlayer::nextChapter() void MediaPlayer::nextChapter()
{ {
Exception ex; libvlc_media_player_next_chapter( m_player );
libvlc_media_player_next_chapter( m_player, &ex.ex );
} }
float MediaPlayer::rate() float MediaPlayer::rate()
{ {
Exception ex; return libvlc_media_player_get_rate( m_player );
return libvlc_media_player_get_rate( m_player, &ex.ex );
} }
void MediaPlayer::setRate( float rate ) void MediaPlayer::setRate( float rate )
{ {
Exception ex; libvlc_media_player_set_rate( m_player, rate );
libvlc_media_player_set_rate( m_player, rate, &ex.ex );
} }
libvlc_state_t MediaPlayer::state() libvlc_state_t MediaPlayer::state()
...@@ -219,31 +198,26 @@ libvlc_state_t MediaPlayer::state() ...@@ -219,31 +198,26 @@ libvlc_state_t MediaPlayer::state()
float MediaPlayer::fps() float MediaPlayer::fps()
{ {
Exception ex; return libvlc_media_player_get_fps( m_player );
return libvlc_media_player_get_fps( m_player, &ex.ex );
} }
int MediaPlayer::hasVout() int MediaPlayer::hasVout()
{ {
Exception ex; return libvlc_media_player_has_vout( m_player );
return libvlc_media_player_has_vout( m_player, &ex.ex );
} }
int MediaPlayer::isSeekable() int MediaPlayer::isSeekable()
{ {
Exception ex; return libvlc_media_player_is_seekable( m_player );
return libvlc_media_player_is_seekable( m_player, &ex.ex );
} }
int MediaPlayer::canPause() int MediaPlayer::canPause()
{ {
Exception ex; return libvlc_media_player_can_pause( m_player );
return libvlc_media_player_can_pause( m_player, &ex.ex );
} }
void MediaPlayer::nextFrame() void MediaPlayer::nextFrame()
{ {
Exception ex; libvlc_media_player_next_frame( m_player );
libvlc_media_player_next_frame( m_player, &ex.ex );
} }
void MediaPlayer::toggleFullscreen() void MediaPlayer::toggleFullscreen()
......
...@@ -76,8 +76,7 @@ void Video::setSpu( int spu ) ...@@ -76,8 +76,7 @@ void Video::setSpu( int spu )
void Video::setSubtitleFile( const char *subtitle_file ) void Video::setSubtitleFile( const char *subtitle_file )
{ {
Exception ex; libvlc_video_set_subtitle_file( m_player, subtitle_file );
libvlc_video_set_subtitle_file( m_player, subtitle_file, &ex.ex );
} }
char *Video::cropGeometry() char *Video::cropGeometry()
...@@ -100,8 +99,7 @@ int Video::track() ...@@ -100,8 +99,7 @@ int Video::track()
int Video::trackCount() int Video::trackCount()
{ {
Exception ex; return libvlc_video_get_track_count( m_player );
return libvlc_video_get_track_count( m_player, &ex.ex );
} }
void Video::setTrack( int track ) void Video::setTrack( int track )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment