VlcMediaPlayer Class Reference

Media Player. More...

#include <vlc-qt/MediaPlayer.h>

Public Slots

void play ()
 Starts playing current media if possible.
 
void pause ()
 Pauses the playback of current media if possible.
 
void togglePause ()
 Toggles pause of the playback of current media if possible.
 
void resume ()
 Resumes the playback of current media if possible.
 
void stop ()
 Stops playing current media.
 

Signals

void backward ()
 Signal sent on backward.
 
void buffering (float)
 Signal sent on buffering. More...
 
void end ()
 Signal sent when end reached.
 
void error ()
 Signal sent on error.
 
void forward ()
 Signal sent on forward.
 
void lengthChanged (int)
 Signal sent on length change. More...
 
void mediaChanged (libvlc_media_t *)
 Signal sent on media change. More...
 
void nothingSpecial ()
 Signal sent nothing speciall happened.
 
void opening ()
 Signal sent when opening.
 
void pausableChanged (bool)
 Signal sent on pausable change. More...
 
void paused ()
 Signal sent when paused.
 
void playing ()
 Signal sent when playing.
 
void positionChanged (float)
 Signal sent on position change. More...
 
void seekableChanged (bool)
 Signal sent on seekable change. More...
 
void snapshotTaken (const QString &)
 Signal sent on snapshot taken. More...
 
void stopped ()
 Signal sent when stopped.
 
void timeChanged (int)
 Signal sent on time change. More...
 
void titleChanged (int)
 Signal sent on title change. More...
 
void vout (int)
 Signal sent when video output is available. More...
 
void stateChanged ()
 Signal sent when state of the player changed.
 

Public Member Functions

 VlcMediaPlayer (VlcInstance *instance)
 VlcMediaPlayer constructor. More...
 
 ~VlcMediaPlayer ()
 
libvlc_media_player_t * core ()
 Returns libvlc media player object. More...
 
VlcAudioaudio ()
 Returns audio manager object. More...
 
VlcVideovideo ()
 Returns video manager object. More...
 
int length () const
 Get the current movie length (in ms). More...
 
VlcMediacurrentMedia ()
 Get current media object. More...
 
libvlc_media_t * currentMediaCore ()
 Get current media core object. More...
 
void open (VlcMedia *media)
 Open media file or stream. Any media should be playable and opened. More...
 
void openOnly (VlcMedia *media)
 Just opens the media file or stream, do not starts playing the media. More...
 
void setTime (int time)
 Set the movie time (in ms). More...
 
int time () const
 Get the current movie time (in ms). More...
 
void setVideoWidget (VlcVideoDelegate *widget)
 Set video widget. More...
 
bool hasVout () const
 Get video output status. More...
 
Vlc::State state () const
 Get current player state. More...
 
VlcVideoDelegatevideoWidget ()
 Get current video widget. More...
 
float position ()
 Get current video position. More...
 
void setPosition (float pos)
 Set the movie position. More...
 

Detailed Description

A basic MediaPlayer manager for VLC-Qt library. It provides main playback controls.

Constructor & Destructor Documentation

VlcMediaPlayer::VlcMediaPlayer ( VlcInstance instance)
explicit

This is mandatory to use libvlc playback functions.

Parameters
instanceinstance object (VlcInstance *)
VlcMediaPlayer::~VlcMediaPlayer ( )

VlcMediaPlayer destructor

Member Function Documentation

VlcAudio * VlcMediaPlayer::audio ( )
Returns
audio manager (VlcAudio *)
void VlcMediaPlayer::buffering ( float  )
signal
Parameters
floatbuffer
libvlc_media_player_t * VlcMediaPlayer::core ( )
Returns
libvlc media player (libvlc_media_player_t *)
VlcMedia * VlcMediaPlayer::currentMedia ( )
Returns
media object (VlcMedia *)
libvlc_media_t * VlcMediaPlayer::currentMediaCore ( )
Returns
media core object (libvlc_media_t *)
bool VlcMediaPlayer::hasVout ( ) const
Returns
video output status (const bool)
int VlcMediaPlayer::length ( ) const
Returns
the movie length (in ms), or -1 if there is no media (const int)
void VlcMediaPlayer::lengthChanged ( int  )
signal
Parameters
intlength
void VlcMediaPlayer::mediaChanged ( libvlc_media_t *  )
signal
Parameters
libvlc_media_t* media
void VlcMediaPlayer::open ( VlcMedia media)
Parameters
mediaobject (VlcMedia *)
void VlcMediaPlayer::openOnly ( VlcMedia media)
Parameters
mediaobject (VlcMedia *)
void VlcMediaPlayer::pausableChanged ( bool  )
signal
Parameters
boolpausable
float VlcMediaPlayer::position ( )
Returns
current video position (float)
void VlcMediaPlayer::positionChanged ( float  )
signal
Parameters
floatposition
void VlcMediaPlayer::seekableChanged ( bool  )
signal
Parameters
boolseekable
void VlcMediaPlayer::setPosition ( float  pos)

This has no effect if no media is being played. Not all formats and protocols support this.

Parameters
posthe movie position (float)
void VlcMediaPlayer::setTime ( int  time)

This has no effect if no media is being played. Not all formats and protocols support this.

Parameters
timethe movie time (in ms) (int)
void VlcMediaPlayer::setVideoWidget ( VlcVideoDelegate widget)

Set video widget to be able to play video inside Qt interface.

Parameters
widgetvideo widget (VlcVideoDelegate *)
void VlcMediaPlayer::snapshotTaken ( const QString &  )
signal
Parameters
QStringfilename
Vlc::State VlcMediaPlayer::state ( ) const
Returns
current player state (const Vlc::State)
int VlcMediaPlayer::time ( ) const
Returns
the movie time (in ms), or -1 if there is no media (const int)
void VlcMediaPlayer::timeChanged ( int  )
signal
Parameters
inttime
void VlcMediaPlayer::titleChanged ( int  )
signal
Parameters
inttitle
VlcVideo * VlcMediaPlayer::video ( )
Returns
video manager (VlcVideo *)
VlcVideoDelegate * VlcMediaPlayer::videoWidget ( )
Returns
current video widget (VlcVideoWidget *)
void VlcMediaPlayer::vout ( int  )
signal
Parameters
intvout count

The documentation for this class was generated from the following files: