• PySide 模块
  • PySide.phonon
  • 内容表

    上一话题

    Phonon.PlatformPlugin

    下一话题

    Phonon.MediaSource

    Phonon.MediaObjectInterface

    详细描述

    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.

    另请参阅

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

    class PySide.phonon.Phonon. MediaObjectInterface
    PySide.phonon.Phonon.MediaObjectInterface. currentTime ( )
    返回类型: PySide.QtCore.qint64

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

    PySide.phonon.Phonon.MediaObjectInterface. errorString ( )
    返回类型: unicode

    A translated string describing the error.

    PySide.phonon.Phonon.MediaObjectInterface. errorType ( )
    返回类型: PySide.phonon.Phonon.ErrorType

    Tells your program what to do about the error.

    另请参阅

    Phonon.ErrorType

    PySide.phonon.Phonon.MediaObjectInterface. hasVideo ( )
    返回类型: 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 ( )
    返回类型: 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 ( )
    返回类型: PySide.QtCore.qint32
    PySide.phonon.Phonon.MediaObjectInterface. remainingTime ( )
    返回类型: PySide.QtCore.qint64
    PySide.phonon.Phonon.MediaObjectInterface. seek ( 毫秒 )
    参数: 毫秒 PySide.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.

    毫秒 The time where playback should seek to in milliseconds.

    PySide.phonon.Phonon.MediaObjectInterface. setNextSource ( source )
    参数: source PySide.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 是无效 MediaSource object then the queue is empty and the playback should stop normally.

    警告

    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 )
    参数: arg__1 PySide.QtCore.qint32
    PySide.phonon.Phonon.MediaObjectInterface. setSource ( arg__1 )
    参数: arg__1 PySide.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.

    警告

    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 )
    参数: interval PySide.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 )
    参数: arg__1 PySide.QtCore.qint32
    PySide.phonon.Phonon.MediaObjectInterface. source ( )
    返回类型: PySide.phonon.Phonon::MediaSource

    Returns the current source.

    PySide.phonon.Phonon.MediaObjectInterface. state ( )
    返回类型: 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 ( )
    返回类型: 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 ( )
    返回类型: 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 ( )
    返回类型: PySide.QtCore.qint32