Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QMediaPlayerControl Class Reference

The QMediaPlayerControl class provides access to the media playing functionality of a QMediaService. More...

 #include <QMediaPlayerControl>

Inherits: QMediaControl.

This class was introduced in Qt Mobility 1.0.

Public Functions

~QMediaPlayerControl ()
virtual QMediaTimeRange availablePlaybackRanges () const = 0
virtual int bufferStatus () const = 0
virtual qint64 duration () const = 0
virtual bool isAudioAvailable () const = 0
virtual bool isMuted () const = 0
virtual bool isSeekable () const = 0
virtual bool isVideoAvailable () const = 0
virtual QMediaContent media () const = 0
virtual QMediaPlayer::MediaStatus mediaStatus () const = 0
virtual const QIODevice * mediaStream () const = 0
virtual void pause () = 0
virtual void play () = 0
virtual qreal playbackRate () const = 0
virtual qint64 position () const = 0
virtual void setMedia ( const QMediaContent & media, QIODevice * stream ) = 0
virtual void setMuted ( bool mute ) = 0
virtual void setPlaybackRate ( qreal rate ) = 0
virtual void setPosition ( qint64 position ) = 0
virtual void setVolume ( int volume ) = 0
virtual QMediaPlayer::State state () const = 0
virtual void stop () = 0
virtual int volume () const = 0
  • 29 public functions inherited from QObject

Signals

void audioAvailableChanged ( bool audio )
void availablePlaybackRangesChanged ( const QMediaTimeRange & ranges )
void bufferStatusChanged ( int progress )
void durationChanged ( qint64 duration )
void error ( int error, const QString & errorString )
void mediaChanged ( const QMediaContent & content )
void mediaStatusChanged ( QMediaPlayer::MediaStatus status )
void mutedChanged ( bool mute )
void playbackRateChanged ( qreal rate )
void positionChanged ( qint64 position )
void seekableChanged ( bool seekable )
void stateChanged ( QMediaPlayer::State state )
void videoAvailableChanged ( bool video )
void volumeChanged ( int volume )

Protected Functions

QMediaPlayerControl ( QObject * parent = 0 )
  • 7 protected functions inherited from QObject

Macros

QMediaPlayerControl_iid

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable 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::requestControl() 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.

void QMediaPlayerControl::audioAvailableChanged ( bool audio ) [signal]

Signals that there has been a change in the availability of audio output.

This function was introduced in Qt Mobility 1.0.

See also isAudioAvailable().

QMediaTimeRange QMediaPlayerControl::availablePlaybackRanges () const [pure virtual]

Returns a range of times in milliseconds that can be played back.

Usually for local files this is a continuous interval equal to [0..duration()] or an empty time range if seeking is not supported, but for network sources it refers to the buffered parts of the media.

This function was introduced in Qt Mobility 1.0.

void QMediaPlayerControl::availablePlaybackRangesChanged ( const QMediaTimeRange & ranges ) [signal]

Signals that the available media playback ranges have changed.

This function was introduced in Qt Mobility 1.0.

See also QMediaPlayerControl::availablePlaybackRanges().

int QMediaPlayerControl::bufferStatus () const [pure virtual]

Returns the buffering progress of the current media. Progress is measured in the percentage of the buffer filled.

This function was introduced in Qt Mobility 1.0.

void QMediaPlayerControl::bufferStatusChanged ( int progress ) [signal]

Signals that buffering progress has changed.

This function was introduced in Qt Mobility 1.0.

See also bufferStatus().

qint64 QMediaPlayerControl::duration () const [pure virtual]

Returns the duration of the current media in milliseconds.

This function was introduced in Qt Mobility 1.0.

void QMediaPlayerControl::durationChanged ( qint64 duration ) [signal]

Signals that the duration of the current media has changed.

This function was introduced in Qt Mobility 1.0.

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.

This function was introduced in Qt Mobility 1.0.

bool QMediaPlayerControl::isAudioAvailable () const [pure virtual]

Identifies if there is audio output available for the current media.

Returns true if audio output is available and false otherwise.

This function was introduced in Qt Mobility 1.0.

bool QMediaPlayerControl::isMuted () const [pure virtual]

Returns the mute state of a player control.

This function was introduced in Qt Mobility 1.0.

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.

This function was introduced in Qt Mobility 1.0.

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.

This function was introduced in Qt Mobility 1.0.

QMediaContent QMediaPlayerControl::media () const [pure virtual]

Returns the current media source.

This function was introduced in Qt Mobility 1.0.

See also setMedia().

void QMediaPlayerControl::mediaChanged ( const QMediaContent & content ) [signal]

Signals that the current media content has changed.

This function was introduced in Qt Mobility 1.0.

QMediaPlayer::MediaStatus QMediaPlayerControl::mediaStatus () const [pure virtual]

Returns the status of the current media.

This function was introduced in Qt Mobility 1.0.

void QMediaPlayerControl::mediaStatusChanged ( QMediaPlayer::MediaStatus status ) [signal]

Signals that the status of the current media has changed.

This function was introduced in Qt Mobility 1.0.

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().

This function was introduced in Qt Mobility 1.0.

See also setMedia().

void QMediaPlayerControl::mutedChanged ( bool mute ) [signal]

Signals a change in the mute status of a player control.

This function was introduced in Qt Mobility 1.0.

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.

This function was introduced in Qt Mobility 1.0.

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.

This function was introduced in Qt Mobility 1.0.

See also state().

qreal QMediaPlayerControl::playbackRate () const [pure virtual]

Returns the rate of playback.

This function was introduced in Qt Mobility 1.0.

See also setPlaybackRate().

void QMediaPlayerControl::playbackRateChanged ( qreal rate ) [signal]

Signal emitted when playback rate changes to rate.

This function was introduced in Qt Mobility 1.0.

qint64 QMediaPlayerControl::position () const [pure virtual]

Returns the current playback position in milliseconds.

This function was introduced in Qt Mobility 1.0.

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.

This function was introduced in Qt Mobility 1.0.

See also position().

void QMediaPlayerControl::seekableChanged ( bool seekable ) [signal]

Signals that the seekable state of a player control has changed.

This function was introduced in Qt Mobility 1.0.

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.

Setting the media to a null QMediaContent will cause the control to discard all information relating to the current media source and to cease all I/O operations related to that media.

This function was introduced in Qt Mobility 1.0.

See also media().

void QMediaPlayerControl::setMuted ( bool mute ) [pure virtual]

Sets the mute state of a player control.

This function was introduced in Qt Mobility 1.0.

See also isMuted().

void QMediaPlayerControl::setPlaybackRate ( qreal rate ) [pure virtual]

Sets the rate of playback.

This function was introduced in Qt Mobility 1.0.

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.

This function was introduced in Qt Mobility 1.0.

See also position().

void QMediaPlayerControl::setVolume ( int volume ) [pure virtual]

Sets the audio volume of a player control.

This function was introduced in Qt Mobility 1.0.

See also volume().

QMediaPlayer::State QMediaPlayerControl::state () const [pure virtual]

Returns the state of a player control.

This function was introduced in Qt Mobility 1.0.

void QMediaPlayerControl::stateChanged ( QMediaPlayer::State state ) [signal]

Signals that the state of a player control has changed.

This function was introduced in Qt Mobility 1.0.

See also state().

void QMediaPlayerControl::stop () [pure virtual]

Stops playback of the current media.

If successful the player control will immediately enter the stopped state.

This function was introduced in Qt Mobility 1.0.

void QMediaPlayerControl::videoAvailableChanged ( bool video ) [signal]

Signals that there has been a change in the availability of video output.

This function was introduced in Qt Mobility 1.0.

See also isVideoAvailable().

int QMediaPlayerControl::volume () const [pure virtual]

Returns the audio volume of a player control.

This function was introduced in Qt Mobility 1.0.

See also setVolume().

void QMediaPlayerControl::volumeChanged ( int volume ) [signal]

Signals the audio volume of a player control has changed.

This function was introduced in Qt Mobility 1.0.

See also volume().

Macro Documentation

QMediaPlayerControl_iid

com.nokia.Qt.QMediaPlayerControl/1.0

Defines the interface name of the QMediaPlayerControl class.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 23
  2. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 45
  3. Une nouvelle ère d'IHM 3D pour les automobiles, un concept proposé par Digia et implémenté avec Qt 3
  4. Qt Creator 2.5 est sorti en beta, l'EDI supporte maintenant plus de fonctionnalités de C++11 2
  5. PySide devient un add-on Qt et rejoint le Qt Project et le modèle d'open gouvernance 1
  6. Vingt sociétés montrent leurs décodeurs basés sur Qt au IPTV World Forum, en en exploitant diverses facettes (déclaratif, Web, widgets) 0
  7. Thread travailleur avec Qt en utilisant les signaux et les slots, un article de Christophe Dumez traduit par Thibaut Cuvelier 1
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 50
  4. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 23
  5. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 45
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
Page suivante

Le blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. 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

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtmobility-1.2
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web