Table Of Contents

Previous topic

Phonon.PlatformPlugin

Next topic

Phonon.MediaSource

Phonon.MediaObjectInterface

Detailed Description

Backend interface for media sources.

The backend implementation has to provide two signals, that are not defined in this interface:

  • void stateChanged( Phonon.State newstate, Phonon.State oldstate)

    Emitted when the state of the MediaObject has changed. In case you’re not interested in the old state you can also connect to a slot that only has one State argument.

    newstate The state the Player is in now. oldstate The state the Player was in before.

  • void tick(qint64 time)

    This signal gets emitted every tickInterval milliseconds.

    time The position of the media file in milliseconds.

See also

PySide.phonon.Phonon::MediaObjectInterface.setTickInterval() PySide.phonon.Phonon::MediaObjectInterface.tickInterval() MediaObject

class PySide.phonon.Phonon.MediaObjectInterface
PySide.phonon.Phonon.MediaObjectInterface.currentTime()
Return type:PySide.QtCore.qint64

Get the current time (in milliseconds) of the file currently being played.

PySide.phonon.Phonon.MediaObjectInterface.errorString()
Return type:unicode

A translated string describing the error.

PySide.phonon.Phonon.MediaObjectInterface.errorType()
Return type:PySide.phonon.Phonon.ErrorType

Tells your program what to do about the error.

See also

Phonon.ErrorType

PySide.phonon.Phonon.MediaObjectInterface.hasVideo()
Return type:PySide.QtCore.bool

Check whether the media data includes a video stream.

Returns true if the media contains video data.

PySide.phonon.Phonon.MediaObjectInterface.isSeekable()
Return type:PySide.QtCore.bool

If the current media may be seeked this function returns true; otherwise, false.

Returns whether the current media may be seeked.

PySide.phonon.Phonon.MediaObjectInterface.pause()

Requests the playback to pause.

This method is only called if the state transition to PausedState is possible.

The backend should react as fast as possible. Go to PausedState as soon as playback is paused.

PySide.phonon.Phonon.MediaObjectInterface.play()

Requests the playback to start.

This method is only called if the state transition to PlayingState is possible.

The backend should react immediately by either going into PlayingState or BufferingState if the former is not possible.

PySide.phonon.Phonon.MediaObjectInterface.prefinishMark()
Return type:PySide.QtCore.qint32
PySide.phonon.Phonon.MediaObjectInterface.remainingTime()
Return type:PySide.QtCore.qint64
PySide.phonon.Phonon.MediaObjectInterface.seek(milliseconds)
Parameters:millisecondsPySide.QtCore.qint64

Requests the playback to be seeked to the given time.

The backend does not have to finish seeking while in this function (i.e. the backend does not need to block the thread until the seek is finished; even worse it might lead to deadlocks when using a ByteStream which gets its data from the thread this function would block).

As soon as the seek is done the PySide.phonon.Phonon::MediaObjectInterface.currentTime() function and the tick() signal will report it.

milliseconds The time where playback should seek to in milliseconds.

PySide.phonon.Phonon.MediaObjectInterface.setNextSource(source)
Parameters:sourcePySide.phonon.Phonon::MediaSource

Sets the next source to be used for transitions. When a next source is set playback should continue with the new source. In that case finished and prefinishMarkReached are not emitted.

source The source to transition to (crossfade/gapless/gap). If source is an invalid MediaSource object then the queue is empty and the playback should stop normally.

Warning

Keep the MediaSource object around as long as the backend uses the AbstractMediaStream returned by the MediaSource . In case that no other reference to the MediaSource exists and it is set to MediaSource::autoDelete, the AbstractMediaStream is deleted when the last MediaSource ref is deleted.

PySide.phonon.Phonon.MediaObjectInterface.setPrefinishMark(arg__1)
Parameters:arg__1PySide.QtCore.qint32
PySide.phonon.Phonon.MediaObjectInterface.setSource(arg__1)
Parameters:arg__1PySide.phonon.Phonon::MediaSource

Sets the current source. When this function is called the MediaObject is expected to stop all current activity and start loading the new source (i.e. go into LoadingState ).

It is expected that the backend now starts preloading the media data, filling the audio and video buffers and making all media meta data available. It will also trigger the totalTimeChanged signal.

If the backend does not know how to handle the source it needs to change state to Phonon.ErrorState . Don’t bother about handling KIO URLs. It is enough to handle AbstractMediaStream sources correctly.

Warning

Keep the MediaSource object around as long as the backend uses the AbstractMediaStream returned by the MediaSource . In case that no other reference to the MediaSource exists and it is set to MediaSource::autoDelete, the AbstractMediaStream is deleted when the last MediaSource ref is deleted.

PySide.phonon.Phonon.MediaObjectInterface.setTickInterval(interval)
Parameters:intervalPySide.QtCore.qint32

Change the interval the tick signal is emitted. Set interval to 0 to disable the signal.

interval tick interval in milliseconds

Returns the tick interval that it was set to (might not be the same as you asked for).

PySide.phonon.Phonon.MediaObjectInterface.setTransitionTime(arg__1)
Parameters:arg__1PySide.QtCore.qint32
PySide.phonon.Phonon.MediaObjectInterface.source()
Return type:PySide.phonon.Phonon::MediaSource

Returns the current source.

PySide.phonon.Phonon.MediaObjectInterface.state()
Return type:PySide.phonon.Phonon.State

Get the current state.

PySide.phonon.Phonon.MediaObjectInterface.stop()

Requests the playback to be stopped.

This method is only called if the state transition to StoppedState is possible.

The backend should react as fast as possible. Go to StoppedState as soon as playback is stopped.

A subsequent call to PySide.phonon.Phonon::MediaObjectInterface.play() will start playback at the beginning of the media.

PySide.phonon.Phonon.MediaObjectInterface.tickInterval()
Return type:PySide.QtCore.qint32

Return the time interval in milliseconds between two ticks.

Returns the tick interval that it was set to (might not be the same as you asked for).

PySide.phonon.Phonon.MediaObjectInterface.totalTime()
Return type:PySide.QtCore.qint64

Returns the total time of the media in milliseconds.

If the total time is not know return -1. Do not block until it is known, instead emit the totalTimeChanged signal as soon as the total time is known or changes.

PySide.phonon.Phonon.MediaObjectInterface.transitionTime()
Return type:PySide.QtCore.qint32