Logo Search packages:      
Sourcecode: qt4-x11 version File versions

Phonon::MediaObject Class Reference

#include <Phonon/MediaObject>

Inheritance diagram for Phonon::MediaObject:

QObject QObject

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());
 media->setCurrentSource("/home/username/music/filename.ogg");
 media->play();

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

 media->setCurrentSource(":/sounds/startsound.ogg");
 media->enqueue("/home/username/music/song.mp3");
 media->enqueue(":/sounds/endsound.ogg");
or provide the next file just in time:
   media->setCurrentSource(":/sounds/startsound.ogg");
   connect(media, SIGNAL(aboutToFinish()), SLOT(enqueueNextSource()));
 }

 void enqueueNextSource()
 {
   media->enqueue("/home/username/music/song.mp3");
 }

Author:
Matthias Kretz <kretz@kde.org>

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


Public Slots

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

Signals

void aboutToFinish ()
void bufferStatus (int percentFilled)
void currentSourceChanged (const Phonon::MediaSource &newSource)
void destroyed (QObject *=0)
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

bool blockSignals (bool b)
const QObjectListchildren () const
void clearQueue ()
bool closePort (const Port &)
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
MediaSource currentSource () const
QList< SubStreamDescription > currentSubStreams (MediaStreamType=AllMedia)
qint64 currentTime () const
QList< DecoderParameter > decoderParameters (const Port &port)
QWidgetdecoderParameterWidget (const Port &port)
bool disconnect (const QObject *receiver, const char *member=0)
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
void dumpObjectInfo ()
void dumpObjectTree ()
QList< QByteArraydynamicPropertyNames () const
void enqueue (const QList< QUrl > &urls)
void enqueue (const QList< MediaSource > &sources)
void enqueue (const MediaSource &source)
QString errorString () const
ErrorType errorType () const
virtual bool event (QEvent *)
virtual bool eventFilter (QObject *, QEvent *)
template<typename T>
findChild (const QString &aName=QString()) const
template<typename T>
QList< T > findChildren (const QRegExp &re) const
template<typename T>
QList< T > findChildren (const QString &aName=QString()) const
bool hasVideo () const
bool inherits (const char *classname) const
QList< PathinputPaths () const
QList< Port > inputPorts (MediaStreamType type=Phonon::AllMedia)
void installEventFilter (QObject *)
bool isPortValid (const Port &p)
bool isSeekable () const
bool isValid () const
bool isWidgetType () const
void killTimer (int id)
 MediaObject (const MediaSource &, QObject *parent)
QMultiMap< QString, QStringmetaData () const
QStringList metaData (Phonon::MetaData key) const
QStringList metaData (const QString &key) const
void moveToThread (QThread *thread)
QString objectName () const
Port openPort (MediaStreamType type, const char *format=0)
QList< PathoutputPaths () const
QList< Port > outputPorts (MediaStreamType type=Phonon::AllMedia)
QObjectparent () const
qint32 prefinishMark () const
QVariant property (const char *name) const
QList< MediaSourcequeue () const
qint64 remainingTime () const
void removeEventFilter (QObject *)
bool selectSubstream (SubStreamDescription, const Port &port=Port())
void setCurrentSource (const MediaSource &source)
void setObjectName (const QString &name)
void setParent (QObject *)
void setPrefinishMark (qint32 msecToEnd)
bool setProperty (const char *name, const QVariant &value)
void setQueue (const QList< QUrl > &urls)
void setQueue (const QList< MediaSource > &sources)
void setTransitionTime (qint32 msec)
void setUserData (uint id, QObjectUserData *data)
bool signalsBlocked () const
int startTimer (int interval)
State state () const
QThreadthread () const
qint32 tickInterval () const
qint64 totalTime () const
qint32 transitionTime () const
QObjectUserData * userData (uint id) const
 ~MediaObject ()

Static Public Member Functions

static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
static uint registerUserData ()

Protected Member Functions

virtual void childEvent (QChildEvent *)
virtual void connectNotify (const char *signal)
virtual void customEvent (QEvent *)
virtual void disconnectNotify (const char *signal)
int receivers (const char *signal) const
QObjectsender () const
virtual void timerEvent (QTimerEvent *)

Protected Attributes

QObjectData * d_ptr
MediaNodePrivate *const k_ptr

Static Protected Attributes

static const QMetaObject staticQtMetaObject

Properties

QString objectName
 the name of this object
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()

Friends

class FrontendInterfacePrivate
class QApplication
class QApplicationPrivate
class QCoreApplication
class QCoreApplicationPrivate
struct QMetaObject
class QThreadData
class QWidget

Related Functions

(Note that these are not member functions.)

qFindChild (const QObject *obj, const QString &name)
qFindChildqFindChildren (const QObject *obj, const QString &name=QString(), T dummy=0)()
QList< T > qFindChildren (const QObject *obj, const QString &name)
QList< T > qFindChildrenqFindChildren (const QObject *obj, const QString &name=QString(), T dummy=0)()
QList< T > qFindChildrenqFindChildren (const QObject *obj, const QRegExp &regExp)()
T * qobject_cast (QObject *object)
 QObjectList
void * qt_find_obj_child (QObject *parent, const char *type, const QString &name)

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

Generated by  Doxygen 1.6.0   Back to index