QMediaPlayerControl Class Reference The QMediaPlayerControl class provides access to the media playing functionality of a QMediaService . More...
#include <QMediaPlayerControl> This class is under development and is subject to change.
Inherits QMediaControl .
Public Functions
29 public functions inherited from QObject
Signals
Protected Functions
7 protected functions inherited from QObject
Macros
Additional Inherited Members
1 property inherited from QObject
1 public slot inherited from QObject
1 public type inherited from QObject
4 static public members inherited from QObject
2 protected variables inherited from QObject
Detailed Description
The QMediaPlayerControl class provides access to the media playing functionality of a QMediaService .
If a QMediaService can play media is will implement QMediaPlayerControl. This control provides a means to set the media to play, start , pause and stop playback, seek , and control the volume . It also provides feedback on the duration of the media, the current position , and buffering progress.
The functionality provided by this control is exposed to application code through the QMediaPlayer class.
The interface name of QMediaPlayerControl is com.nokia.Qt.QMediaPlayerControl/1.0 as defined in QMediaPlayerControl_iid .
See also QMediaService::control () and QMediaPlayer .
Member Function Documentation
QMediaPlayerControl::QMediaPlayerControl ( QObject * parent = 0 ) [protected]
Constructs a new media player control with the given parent .
QMediaPlayerControl::~QMediaPlayerControl ()
Destroys a media player control.
int QMediaPlayerControl::bufferStatus () const [pure virtual]
Returns the buffering progress of the current media. Progress is measured in the percentage of the buffer filled.
void QMediaPlayerControl::bufferStatusChanged ( int progress ) [signal]
Signals that buffering progress has changed.
See also bufferStatus ().
qint64 QMediaPlayerControl::duration () const [pure virtual]
Returns the duration of the current media in milliseconds.
void QMediaPlayerControl::durationChanged ( qint64 duration ) [signal]
Signals that the duration of the current media has changed.
See also duration ().
void QMediaPlayerControl::error ( int error , const QString & errorString ) [signal]
Signals that an error has occurred. The errorString provides a more detailed explanation.
bool QMediaPlayerControl::isMuted () const [pure virtual]
Returns the mute state of a player control.
bool QMediaPlayerControl::isSeekable () const [pure virtual]
Identifies if the current media is seekable.
Returns true if it possible to seek within the current media, and false otherwise.
bool QMediaPlayerControl::isVideoAvailable () const [pure virtual]
Identifies if there is video output available for the current media.
Returns true if video output is available and false otherwise.
QMediaContent QMediaPlayerControl::media () const [pure virtual]
Returns the current media source.
See also setMedia ().
void QMediaPlayerControl::mediaChanged ( const QMediaContent & content ) [signal]
Signals that the current media content has changed.
QMediaPlayer::MediaStatus QMediaPlayerControl::mediaStatus () const [pure virtual]
Returns the status of the current media.
void QMediaPlayerControl::mediaStatusChanged ( QMediaPlayer::MediaStatus status ) [signal]
Signals that the status of the current media has changed.
See also mediaStatus ().
const QIODevice * QMediaPlayerControl::mediaStream () const [pure virtual]
Returns the current media stream. This is only a valid if a stream was passed to setMedia ().
See also setMedia ().
void QMediaPlayerControl::mutingChanged ( bool mute ) [signal]
Signals a change in the mute status of a player control.
See also isMuted ().
void QMediaPlayerControl::pause () [pure virtual]
Pauses playback of the current media.
If sucessful the player control will immediately enter the paused state.
See also state (), play (), and stop ().
void QMediaPlayerControl::play () [pure virtual]
Starts playback of the current media.
If successful the player control will immediately enter the playing state.
See also state ().
qreal QMediaPlayerControl::playbackRate () const [pure virtual]
Returns the rate of playback.
See also setPlaybackRate ().
void QMediaPlayerControl::playbackRateChanged ( qreal rate ) [signal]
Signal emitted when playback rate changes to rate .
qint64 QMediaPlayerControl::position () const [pure virtual]
Returns the current playback position in milliseconds.
See also setPosition ().
void QMediaPlayerControl::positionChanged ( qint64 position ) [signal]
Signals the playback position has changed.
This is only emitted in when there has been a discontinous change in the playback postion, such as a seek or the position being reset.
See also position ().
QPair <qint64 , qint64 > QMediaPlayerControl::seekRange () const [pure virtual]
Returns the range in milliseconds the player can seek to. Usually for local files this this range equals to [0..duration ()] or [0..0] if seeking is not supported, but for network sources it means the buffered part of media.
void QMediaPlayerControl::seekRangeChanged ( const QPair <qint64 , qint64 > & range ) [signal]
Signals that the media seek range has changed.
See also QMediaPlayerControl::seekRange ().
void QMediaPlayerControl::seekableChanged ( bool seekable ) [signal]
Signals that the seekable state of a player control has changed.
See also isSeekable ().
void QMediaPlayerControl::setMedia ( const QMediaContent & media , QIODevice * stream ) [pure virtual]
Sets the current media source. If a stream is supplied; data will be read from that instead of attempting to resolve the media source. The media source may still be used to supply media information such as mime type.
See also media ().
void QMediaPlayerControl::setMuted ( bool mute ) [pure virtual]
Sets the mute state of a player control.
See also isMuted ().
void QMediaPlayerControl::setPlaybackRate ( qreal rate ) [pure virtual]
Sets the rate of playback.
See also playbackRate ().
void QMediaPlayerControl::setPosition ( qint64 position ) [pure virtual]
Sets the playback position of the current media. This will initiate a seek and it may take some time for playback to reach the position set.
See also position ().
void QMediaPlayerControl::setVolume ( int volume ) [pure virtual]
Sets the audio volume of a player control.
See also volume ().
QMediaPlayer::State QMediaPlayerControl::state () const [pure virtual]
Returns the state of a player control.
void QMediaPlayerControl::stateChanged ( QMediaPlayer::State state ) [signal]
Signals that the state of a player control has changed.
See also state ().
void QMediaPlayerControl::stop () [pure virtual]
Stops playback of the current media.
If succesful the player control will immediately enter the stopped state.
void QMediaPlayerControl::videoAvailabilityChanged ( bool video ) [signal]
Signals that there has been a change in the availability of video output.
See also isVideoAvailable ().
int QMediaPlayerControl::volume () const [pure virtual]
Returns the audio volume of a player control.
See also setVolume ().
void QMediaPlayerControl::volumeChanged ( int volume ) [signal]
Signals the audio volume of a player control has changed.
See also volume ().
Macro Documentation
QMediaPlayerControl_iid
com.nokia.Qt.QMediaPlayerControl/1.0
Defines the interface name of the QMediaPlayerControl class.
Best Of
Actualités les plus lues
Le Qt Developer Network au hasard
Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework.
Lire l'article.
Communauté
Ressources
Liens utiles
Contact
Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).
Qt dans le magazine