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  · 

QMediaPlaylist Class Reference
[QtMediaModule]

The QMediaPlaylist class provides the basics for playlist handling of media content. More...

    #include <QMediaPlaylist>

Inherits QAbstractListModel.

Public Types

  • enum DataRole { Title, Url, Artist, Album, Genre, AlbumCover }
  • enum Probability { Frequent, Infrequent, Never, Unrated }

Public Functions

Signals

Static Public Members

  • 4 static public members inherited from QObject

Additional Inherited Members


Detailed Description

The QMediaPlaylist class provides the basics for playlist handling of media content.

The QMediaPlaylist class is useful for efficient handling and displaying media content. QMediaPlaylist class is implicitly shared, so can be passed around as arguments with minimal cost. Unless a QMediaPlaylist is explicitly copied via the copy() function, all modifications to a playlist object will be reflected in all other shared copies.

QMediaPlaylist is also derived from QAbstractListModel, and as such can be used by the model/view framework, or as the data source for a QMediaList object.

    mediaPlaylist = new QMediaPlayList();
    todo();

Member Type Documentation

enum QMediaPlaylist::DataRole

ConstantValueDescription
QMediaPlaylist::TitleQt::DisplayRoleTitle of media
QMediaPlaylist::UrlQt::UserRoleFilename, http address
QMediaPlaylist::Artist?Artist of media
QMediaPlaylist::Album?Album of media
QMediaPlaylist::Genre?Genre of media
QMediaPlaylist::AlbumCover?Cover image of media

enum QMediaPlaylist::Probability

ConstantValueDescription
QMediaPlaylist::Frequent0Play this track a greater frequency when compared to tracks of other ratings.
QMediaPlaylist::Infrequent1Play this track a lower frequency when compared to tracks of other ratings.
QMediaPlaylist::Never2Don't play this track again.
QMediaPlaylist::Unrated3Play this track a moderate frequency when compared to tracks of other ratings. This is the default probability rating for unrated tracks.


Member Function Documentation

QMediaPlaylist::QMediaPlaylist ()

Constructs an empty QMediaPlaylist object.

QMediaPlaylist::QMediaPlaylist ( const QString & filename )

Constructs a new QMediaPlaylist object. If filename is a url, or an unknown file format, tries to create a playlist, one entry per line from the file. If the file extension has been previously registered via registerTypeHandler(), then loading will be handed off to the registered file type loader.

See also registerTypeHandler().

QMediaPlaylist::QMediaPlaylist ( const QMediaPlaylist & playlist )

Constructs a shared copy of playlist.

QMediaPlaylist::QMediaPlaylist ( const QStringList & files )

Constructs a new QMediaPlaylist object, one entry per line from files.

QMediaPlaylist::QMediaPlaylist ( const QContentFilter & filter )

Constructs a new QMediaPlaylist object, using a QContentSet with passed filter to initialise.

QMediaPlaylist::~QMediaPlaylist ()   [virtual]

Destroys the playlist.

void QMediaPlaylist::clear ()   [virtual]

Removes all items from the playlist.

QContent QMediaPlaylist::content ( const QModelIndex & index ) const

Returns the QContent object for the media located at index.

void QMediaPlaylist::copy ( const QMediaPlaylist & other )   [virtual]

Creates a deep copy of playlist other.

void QMediaPlaylist::enqueue ( const QMediaPlaylist & playlist )   [virtual]

Appends the playlist onto the end of the current playlist. If the current playlist is empty, falls through to playNow().

QModelIndex QMediaPlaylist::firstIndex ()

Returns the index of the first media item in the playlist.

bool QMediaPlaylist::isShuffle () const   [virtual]

Returns true if shuffle has been set on this playlist.

QModelIndex QMediaPlaylist::nextIndex ()

Returns the index of the next media item in the playlist.

void QMediaPlaylist::playFirst ()   [virtual]

Sets the playing index to the first media in the playlist.

void QMediaPlaylist::playNext ()   [virtual]

Sets the playing index to the next media in the playlist.

void QMediaPlaylist::playNow ( const QMediaPlaylist & playlist )   [virtual]

Replaces the current playlist with playlist, and calls playFirst().

void QMediaPlaylist::playPrevious ()   [virtual]

Sets the playing index to the previous media in the playlist.

QModelIndex QMediaPlaylist::playing () const   [virtual]

Returns the index of the currently playing track.

See also setPlaying().

void QMediaPlaylist::playingChanged ( const QModelIndex & index )   [signal]

This signal is emitted whenever the current playing index is changed.

See also setPlaying().

QModelIndex QMediaPlaylist::previousIndex ()

Returns the index of the previous media item in the playlist.

Probability QMediaPlaylist::probability ( const QModelIndex & index ) const   [virtual]

Returns the shuffle mode probability setting of the media located at index.

See also setProbability() and setShuffle().

void QMediaPlaylist::registerTypeHandler ( const QString & extension, QPlaylistHandlerInterface * handler )   [static]

Registers a playlist load/save handler for the given file extension.

See also load() and save().

void QMediaPlaylist::remove ( const QModelIndex & index )   [virtual]

Removes the item at index.

void QMediaPlaylist::resetProbabilities ()   [virtual]

Resets the shuffle mode probabilities of all media items in the playlist to QMediaPlaylist::Unrated.

See also setProbability().

bool QMediaPlaylist::save ( const QString & filename ) const   [virtual]

Saves the playlist into filename. If a handler is registered for the file extension of the filename, then the handler will be called to save the file, otherwise it will return false and not save the file.

void QMediaPlaylist::setPlaying ( const QModelIndex & index )   [virtual]

Sets the currently playing track to index.

See also playingChanged().

void QMediaPlaylist::setProbability ( const QModelIndex & index, Probability probability )   [virtual]

Sets the shuffle probability for the media located at index.

See also probability(), setShuffle(), and setShuffleValues().

void QMediaPlaylist::setShuffle ( bool shuffle )   [virtual]

Turns on or off shuffle functionality on this playlist. Shuffle is a special weighted play queue, that dynamically resizes to keep shuffleTotalCount() items visible, with shuffleHistoryCount() number of songs visible as "history" when shuffle is set to true. Using probabilities set via setProbability(), tracks are added as needed to then end of the queue as the play location is moved, and the history is shrunk to maintain maximum of shuffleHistoryCount() number of recently played entries.

See also isShuffle(), setShuffleValues(), and setProbability().

void QMediaPlaylist::setShuffleValues ( int historyCount, int totalCount )

Sets historyCount number of recently played entries, and totalCount total number of entries in the list when shuffle mode is turned on.

See also setShuffle() and setProbability().

int QMediaPlaylist::shuffleHistoryCount ()

Returns the shuffle mode history value.

See also setShuffleValues() and setShuffle().

int QMediaPlaylist::shuffleTotalCount ()

Returns the shuffle mode history value.

See also setShuffleValues() and setShuffle().

QString QMediaPlaylist::suggestedName () const   [virtual]

Returns a suggested filename for saving the playlist to.

See also save().

void QMediaPlaylist::unregisterTypeHandler ( const QString & extension )   [static]

Unregisters a playlist load/save handler for the given file extension.

bool QMediaPlaylist::operator!= ( const QMediaPlaylist & other ) const

If other is a shared copy of this playlist, return false, otherwise, compare internal values and if they match up, return false.

QMediaPlaylist & QMediaPlaylist::operator= ( const QMediaPlaylist & other )

Sets this playlist to be a shallow copy of other. Any modifications to the other playlist object will be reflected by this object, and vice-versa.

bool QMediaPlaylist::operator== ( const QMediaPlaylist & other ) const

If other is a shared copy of this playlist, return true, otherwise, compare internal values and if they match up, return true.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  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. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le blog Digia au hasard

Logo

Créer des applications avec un style Metro avec Qt, exemples en QML et C++, un article de Digia Qt traduit par Thibaut Cuvelier

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 qtextended4.4
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