Miam-Player  0.8.0
A nice music player
MediaPlayer Class Reference

The MediaPlayer class is a central class which controls local and remote sources. More...

#include <mediaplayer.h>

Inheritance diagram for MediaPlayer:

Public Slots

void pause ()
 
void play ()
 
void seekBackward ()
 
void seekForward ()
 
void skipBackward ()
 
void skipForward ()
 
void stop ()
 
void stopAfterCurrent (bool b)
 
void toggleMute () const
 
void togglePlayback ()
 

Signals

void currentMediaChanged (const QString &uri)
 
void mediaStatusChanged (QMediaPlayer::MediaStatus)
 
void positionChanged (qint64 pos, qint64 duration)
 
void stateChanged (QMediaPlayer::State)
 

Public Member Functions

 MediaPlayer (QObject *parent=nullptr)
 
void addRemotePlayer (IMediaPlayer *remotePlayer)
 
void changeTrack (const QMediaContent &mediaContent)
 
void changeTrack (MediaPlaylist *playlist, int trackIndex)
 
qint64 duration ()
 
bool isStopAfterCurrent () const
 
MediaPlaylistplaylist ()
 
void seek (qreal pos)
 
void setMute (bool b) const
 
void setPlaylist (MediaPlaylist *playlist)
 
void setState (QMediaPlayer::State state)
 
void setVolume (qreal v)
 
QMediaPlayer::State state () const
 
void playMediaContent (const QMediaContent &mc)
 

Detailed Description

The MediaPlayer class is a central class which controls local and remote sources.

Author
Matthieu Bachelier

Constructor & Destructor Documentation

MediaPlayer::MediaPlayer ( QObject *  parent = nullptr)
explicit

Member Function Documentation

void MediaPlayer::addRemotePlayer ( IMediaPlayer remotePlayer)
void MediaPlayer::changeTrack ( const QMediaContent &  mediaContent)
void MediaPlayer::changeTrack ( MediaPlaylist playlist,
int  trackIndex 
)
void MediaPlayer::currentMediaChanged ( const QString &  uri)
signal
qint64 MediaPlayer::duration ( )

Current duration of the media, in ms.

bool MediaPlayer::isStopAfterCurrent ( ) const
inline
void MediaPlayer::mediaStatusChanged ( QMediaPlayer::MediaStatus  )
signal
void MediaPlayer::pause ( )
slot

Pause current playing track.

void MediaPlayer::play ( )
slot

Play current track in the playlist.

MediaPlaylist* MediaPlayer::playlist ( )
inline
void MediaPlayer::playMediaContent ( const QMediaContent &  mc)

Play track directly in the player, without playlist.

void MediaPlayer::positionChanged ( qint64  pos,
qint64  duration 
)
signal
void MediaPlayer::seek ( qreal  pos)
void MediaPlayer::seekBackward ( )
slot

Seek backward in the current playing track for a small amount of time.

void MediaPlayer::seekForward ( )
slot

Seek forward in the current playing track for a small amount of time.

void MediaPlayer::setMute ( bool  b) const

Set mute on or off.

void MediaPlayer::setPlaylist ( MediaPlaylist playlist)
inline
void MediaPlayer::setState ( QMediaPlayer::State  state)
void MediaPlayer::setVolume ( qreal  v)
void MediaPlayer::skipBackward ( )
slot

Change the current track.

void MediaPlayer::skipForward ( )
slot

Change the current track.

QMediaPlayer::State MediaPlayer::state ( ) const
inline
void MediaPlayer::stateChanged ( QMediaPlayer::State  )
signal
void MediaPlayer::stop ( )
slot

Stop current track in the playlist.

void MediaPlayer::stopAfterCurrent ( bool  b)
inlineslot
void MediaPlayer::toggleMute ( ) const
slot

Activate or desactive audio output.

void MediaPlayer::togglePlayback ( )
slot

Play or pause current track in the playlist depending of the state of the player.


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