VlcMediaPlayer Class Reference

Media Player. More...

#include <VLCQtCore/MediaPlayer.h>

Public Slots

void setTime (int time)
 Set the movie time (in ms). More...
 
void setPosition (float pos)
 Set the media position. More...
 
void setPlaybackRate (float rate)
 Set the media playback rate. More...
 
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 buffer)
 Signal sent on buffering. More...
 
void buffering (int buffer)
 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 length)
 Signal sent on length change. More...
 
void mediaChanged (libvlc_media_t *media)
 Signal sent on media change. More...
 
void nothingSpecial ()
 Signal sent nothing speciall happened.
 
void opening ()
 Signal sent when opening.
 
void pausableChanged (bool pausable)
 Signal sent on pausable change. More...
 
void paused ()
 Signal sent when paused.
 
void playing ()
 Signal sent when playing.
 
void positionChanged (float position)
 Signal sent on position change. More...
 
void seekableChanged (bool seekable)
 Signal sent on seekable change. More...
 
void snapshotTaken (const QString &filename)
 Signal sent on snapshot taken. More...
 
void stopped ()
 Signal sent when stopped.
 
void timeChanged (int time)
 Signal sent on time change. More...
 
void titleChanged (int title)
 Signal sent on title change. More...
 
void vout (int count)
 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 () const
 Returns libvlc media player object. More...
 
VlcAudioaudio () const
 Returns audio manager object. More...
 
VlcVideovideo () const
 Returns video manager object. More...
 
VlcEqualizerequalizer () const
 Returns equalizer object. More...
 
int length () const
 Get the current movie length (in ms). More...
 
VlcMediacurrentMedia () const
 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...
 
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...
 
bool seekable () const
 Get seekable status. More...
 
Vlc::State state () const
 Get current player state. More...
 
VlcVideoDelegatevideoWidget () const
 Get current video widget. More...
 
float position ()
 Get media content position. More...
 
float sampleAspectRatio ()
 Get sample aspect ratio for current video track( vlc >= 2.1.0 ). More...
 
float playbackRate ()
 Get current media playback rate. More...
 

Detailed Description

Media Player.

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

Constructor & Destructor Documentation

VlcMediaPlayer::VlcMediaPlayer ( VlcInstance instance)
explicit

VlcMediaPlayer constructor.

This is mandatory to use libvlc playback functions.

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

VlcMediaPlayer destructor

Member Function Documentation

VlcAudio * VlcMediaPlayer::audio ( ) const

Returns audio manager object.

Returns
audio manager (VlcAudio *)
void VlcMediaPlayer::buffering ( float  buffer)
signal

Signal sent on buffering.

Parameters
bufferbuffer status in percent
void VlcMediaPlayer::buffering ( int  buffer)
signal

Signal sent on buffering.

Parameters
bufferbuffer status in percent
libvlc_media_player_t * VlcMediaPlayer::core ( ) const

Returns libvlc media player object.

Returns
libvlc media player (libvlc_media_player_t *)
VlcMedia * VlcMediaPlayer::currentMedia ( ) const

Get current media object.

Returns
media object (VlcMedia *)
libvlc_media_t * VlcMediaPlayer::currentMediaCore ( )

Get current media core object.

Returns
media core object (libvlc_media_t *)
VlcEqualizer * VlcMediaPlayer::equalizer ( ) const

Returns equalizer object.

Returns
equalizer (VlcEqualizer *)
bool VlcMediaPlayer::hasVout ( ) const

Get video output status.

Returns
video output status (const bool)
int VlcMediaPlayer::length ( ) const

Get the current movie length (in ms).

Returns
the movie length (in ms), or -1 if there is no media (const int)
void VlcMediaPlayer::lengthChanged ( int  length)
signal

Signal sent on length change.

Parameters
lengthnew length
void VlcMediaPlayer::mediaChanged ( libvlc_media_t *  media)
signal

Signal sent on media change.

Parameters
medianew media object
void VlcMediaPlayer::open ( VlcMedia media)

Open media file or stream. Any media should be playable and opened.

Parameters
mediaobject (VlcMedia *)
void VlcMediaPlayer::openOnly ( VlcMedia media)

Just opens the media file or stream, do not starts playing the media.

Parameters
mediaobject (VlcMedia *)
void VlcMediaPlayer::pausableChanged ( bool  pausable)
signal

Signal sent on pausable change.

Parameters
pausablepausable status
float VlcMediaPlayer::playbackRate ( )

Get current media playback rate.

Returns
current media playback rate (float)
float VlcMediaPlayer::position ( )

Get media content position.

Returns
current media position (float)
void VlcMediaPlayer::positionChanged ( float  position)
signal

Signal sent on position change.

Parameters
positionnew position
float VlcMediaPlayer::sampleAspectRatio ( )

Get sample aspect ratio for current video track( vlc >= 2.1.0 ).

Returns
sample aspect ratio (float)
bool VlcMediaPlayer::seekable ( ) const

Get seekable status.

Returns
seekable status (const bool)
Since
VLC-Qt 1.1
void VlcMediaPlayer::seekableChanged ( bool  seekable)
signal

Signal sent on seekable change.

Parameters
seekableseekable status
void VlcMediaPlayer::setPlaybackRate ( float  rate)
slot

Set the media playback rate.

Parameters
ratethe media playback rate (float)
void VlcMediaPlayer::setPosition ( float  pos)
slot

Set the media position.

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

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

Set the movie time (in ms).

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.

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

Parameters
widgetvideo widget (VlcVideoDelegate *)
void VlcMediaPlayer::snapshotTaken ( const QString &  filename)
signal

Signal sent on snapshot taken.

Parameters
filenamefilename of the snapshot
Vlc::State VlcMediaPlayer::state ( ) const

Get current player state.

Returns
current player state (const Vlc::State)
int VlcMediaPlayer::time ( ) const

Get the current movie time (in ms).

Returns
the movie time (in ms), or -1 if there is no media (const int)
void VlcMediaPlayer::timeChanged ( int  time)
signal

Signal sent on time change.

Parameters
timenew time
void VlcMediaPlayer::titleChanged ( int  title)
signal

Signal sent on title change.

Parameters
titlenew title
VlcVideo * VlcMediaPlayer::video ( ) const

Returns video manager object.

Returns
video manager (VlcVideo *)
VlcVideoDelegate * VlcMediaPlayer::videoWidget ( ) const

Get current video widget.

Returns
current video widget (VlcVideoWidget *)
void VlcMediaPlayer::vout ( int  count)
signal

Signal sent when video output is available.

Parameters
countnumber of video outputs available

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