Logo Search packages:      
Sourcecode: phonon version File versions  Download package

Phonon::MediaObject Class Reference

#include <Phonon/MediaObject>

Inheritance diagram for Phonon::MediaObject:

List of all members.

Detailed Description

Interface for media playback of a given URL.

This class is the most important class in Phonon. Use it to open a media file at an arbitrary location, a CD or DVD or to stream media data from the application to the backend.

This class controls the state (play, pause, stop, seek) and you can use it to get a lot of information about the media data.

Notice that most functions of this class are asynchronous. That means if you call play() the object only starts playing when the stateChanged() signal tells you that the object changed into PlayingState. The states you can expect are documented for those methods.

A common usage example is the following:

 media = new MediaObject(this);
 connect(media, SIGNAL(finished()), SLOT(slotFinished());

If you want to play more that one media file (one after another) you can either tell MediaObject about all those files

or provide the next file just in time:
   connect(media, SIGNAL(aboutToFinish()), SLOT(enqueueNextSource()));

 void enqueueNextSource()

Matthias Kretz <kretz@kde.org>

Definition at line 25 of file Phonon-Graph.cpp.

Public Slots

void pause ()
void play ()
void seek (qint64 time)
void setTickInterval (qint32 newTickInterval)
void stop ()


void aboutToFinish ()
void bufferStatus (int percentFilled)
void currentSourceChanged (const Phonon::MediaSource &newSource)
void finished ()
void hasVideoChanged (bool hasVideo)
void metaDataChanged ()
void prefinishMarkReached (qint32 msecToEnd)
void seekableChanged (bool isSeekable)
void stateChanged (Phonon::State newstate, Phonon::State oldstate)
void tick (qint64 time)
void totalTimeChanged (qint64 newTotalTime)

Public Member Functions

void clearQueue ()
bool closePort (const Port &)
MediaSource currentSource () const
QList< SubStreamDescription > currentSubStreams (MediaStreamType=AllMedia)
qint64 currentTime () const
QList< DecoderParameter > decoderParameters (const Port &port)
QWidget * decoderParameterWidget (const Port &port)
void enqueue (const QList< QUrl > &urls)
void enqueue (const QList< MediaSource > &sources)
void enqueue (const MediaSource &source)
QString errorString () const
ErrorType errorType () const
bool hasVideo () const
QList< PathinputPaths () const
QList< Port > inputPorts (MediaStreamType type=Phonon::AllMedia)
bool isPortValid (const Port &p)
bool isSeekable () const
bool isValid () const
 MediaObject (const MediaSource &, QObject *parent)
QMultiMap< QString, QString > metaData () const
QStringList metaData (Phonon::MetaData key) const
QStringList metaData (const QString &key) const
Port openPort (MediaStreamType type, const char *format=0)
QList< PathoutputPaths () const
QList< Port > outputPorts (MediaStreamType type=Phonon::AllMedia)
qint32 prefinishMark () const
QList< MediaSourcequeue () const
qint64 remainingTime () const
bool selectSubstream (SubStreamDescription, const Port &port=Port())
void setCurrentSource (const MediaSource &source)
void setPrefinishMark (qint32 msecToEnd)
void setQueue (const QList< QUrl > &urls)
void setQueue (const QList< MediaSource > &sources)
void setTransitionTime (qint32 msec)
State state () const
qint32 tickInterval () const
qint64 totalTime () const
qint32 transitionTime () const
 ~MediaObject ()

Protected Attributes

MediaNodePrivate *const k_ptr


qint32 prefinishMark
 Get a signal before playback finishes.
qint32 tickInterval
 The time interval in milliseconds between two ticks.
qint32 transitionTime
 Defines the time between media sources.

Private Member Functions

void void void void _k_aboutToFinish ()) Q_PRIVATE_SLOT(k_func()
void void _k_metaDataChanged (const QMultiMap< QString, QString > &)) Q_PRIVATE_SLOT(k_func()
void _k_resumePause ()) Q_PRIVATE_SLOT(k_func()
void void void _k_stateChanged (Phonon::State, Phonon::State)) Q_PRIVATE_SLOT(k_func()
 Q_PRIVATE_SLOT (k_func(), void _k_resumePlay()) Q_PRIVATE_SLOT(k_func()


class FrontendInterfacePrivate

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

Generated by  Doxygen 1.6.0   Back to index