Miam-Player  0.8.0
A nice music player
IMediaPlayer Class Referenceabstract

IMediaPlayer class is a pure virtual class implemented by plugins. More...

#include <imediaplayer.h>

Inheritance diagram for IMediaPlayer:

Public Slots

virtual void pause ()=0
 Must be implemented in derived class. More...
 
virtual void play (const QUrl &track)=0
 
virtual void resume ()=0
 
virtual void seek (float pos)=0
 
virtual void setVolume (qreal volume)=0
 
virtual void stop ()=0
 

Signals

void paused ()
 
void positionChanged (qint64 pos, qint64 duration)
 
void started (qint64 duration)
 
void stopped ()
 
void trackHasEnded ()
 

Public Member Functions

 IMediaPlayer (QObject *parent=nullptr)
 
virtual ~IMediaPlayer ()
 
virtual QString host () const =0
 
virtual qint64 duration () const =0
 
virtual qreal position () const =0
 
virtual void setMute (bool b)=0
 
virtual void setPosition (qint64 pos)=0
 
virtual void setTime (qint64 t)=0
 
virtual qint64 time () const =0
 
virtual qreal volume () const =0
 

Detailed Description

IMediaPlayer class is a pure virtual class implemented by plugins.

When one wants to extend this player by enabling remote playing, it must use this interface. Signals are already connected to MediaPlayer class which acts as a dispatcher.

Author
Matthieu Bachelier

Constructor & Destructor Documentation

IMediaPlayer::IMediaPlayer ( QObject *  parent = nullptr)
inlineexplicit
virtual IMediaPlayer::~IMediaPlayer ( )
inlinevirtual

Member Function Documentation

virtual qint64 IMediaPlayer::duration ( ) const
pure virtual

Current media length in ms.

virtual QString IMediaPlayer::host ( ) const
pure virtual

The host acts as a key to play medias, like http://www.my-favourite-streaming-website.com/.

virtual void IMediaPlayer::pause ( )
pure virtualslot

Must be implemented in derived class.

void IMediaPlayer::paused ( )
signal

Current player has been put in pause mode by one.

virtual void IMediaPlayer::play ( const QUrl &  track)
pure virtualslot
virtual qreal IMediaPlayer::position ( ) const
pure virtual

The position in the current media being played. Percent-based.

void IMediaPlayer::positionChanged ( qint64  pos,
qint64  duration 
)
signal

Current track position has changed. 'Pos' and 'duration' are expressed in milliseconds.

virtual void IMediaPlayer::resume ( )
pure virtualslot
virtual void IMediaPlayer::seek ( float  pos)
pure virtualslot
virtual void IMediaPlayer::setMute ( bool  b)
pure virtual
virtual void IMediaPlayer::setPosition ( qint64  pos)
pure virtual

Sets the current position in ms in the current media being played (useful for seeking).

virtual void IMediaPlayer::setTime ( qint64  t)
pure virtual

Sets the total time in ms in the current media being played (useful for seeking).

virtual void IMediaPlayer::setVolume ( qreal  volume)
pure virtualslot
void IMediaPlayer::started ( qint64  duration)
signal

The player has started to play a new track. 'Duration' is expressed in milliseconds.

virtual void IMediaPlayer::stop ( )
pure virtualslot
void IMediaPlayer::stopped ( )
signal

Current player has been put in stop mode by one.

virtual qint64 IMediaPlayer::time ( ) const
pure virtual
void IMediaPlayer::trackHasEnded ( )
signal

Current track has finished to be played.

virtual qreal IMediaPlayer::volume ( ) const
pure virtual

The current volume of this remote player.


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