nexxT.services.SrvPlaybackControl module
This module provides the playback control console service for the nexxT framework.
- class nexxT.services.SrvPlaybackControl.MVCPlaybackControlBase[source]
Bases:
QObjectBase class for interacting with playback controller, usually this is connected to a harddisk player. This class provides the functions setupConnections and removeConnections which can be called by filters to register and deregister themselfs as a playback device.
- __init__(self, /, parent: PySide6.QtCore.QObject | None = None, *, objectName: str | None = None) None[source]
Initialize self. See help(type(self)) for accurate signature.
- removeConnections(playbackDevice)[source]
unregisters the given playbackDevice and disconnects all. It is intended that this function is called in the onClose(…) method of a filter.
- Parameters:
playbackDevice – the playback device to be unregistered.
- Returns:
None
- setupConnections(playbackDevice, nameFilters)[source]
Sets up signal/slot connections between this view/controller instance and the given playbackDevice. This function is thread safe and shall be called by a direct QT connection. It is intended, that this function is called in the onOpen(…) method of a filter. It expects playbackDevice to provide the following slots:
startPlayback() (starts generating DataSamples)
pausePlayback() (pause mode, stop generating DataSamples)
- stepForward(QString stream) (optional; in case given, a single step operation shall be performed.
if stream is not None, the playback shall stop when receiving the next data sample of stream; otherwise the playback shall proceed to the next data sample of any stream)
stepBackward(QString stream) (optional; see stepForward)
seekBeginning(QString stream) (optional; goes to the beginning of the sequence)
seekEnd() (optional; goes to the end of the stream)
seekTime(qint64) (optional; goes to the specified time stamp)
setSequence(QString) (optional; opens the given sequence)
setTimeFactor(float) (optional; sets the playback time factor, factor > 0)
It expects playbackDevice to provide the following signals (all signals are optional):
sequenceOpened(QString filename, qint64 begin, qint64 end, QStringList streams)
currentTimestampChanged(qint64 currentTime)
playbackStarted()
playbackPaused()
timeRatioChanged(float)
- Parameters:
playbackDevice – a QObject providing the aforementioned signals and slots
nameFilters – a QStringList providing information about suported fileextensions (e.g. [”.avi”, “.mp4”])
- Returns:
- staticMetaObject = PySide6.QtCore.QMetaObject("MVCPlaybackControlBase" inherits "QObject": Methods: #4 type=Signal, signature=_startPlayback() #5 type=Signal, signature=_pausePlayback() #6 type=Signal, signature=_stepForward(QString), parameters=QString #7 type=Signal, signature=_stepBackward(QString), parameters=QString #8 type=Signal, signature=_seekBeginning() #9 type=Signal, signature=_seekEnd() #10 type=Signal, signature=_seekTime(qlonglong), parameters=qlonglong #11 type=Signal, signature=_setSequence(PyObject), parameters=PyObject #12 type=Signal, signature=_setTimeFactor(double), parameters=double #13 type=Slot, signature=setupConnections(QObject*,QStringList), parameters=QObject*, QStringList #14 type=Slot, signature=removeConnections(QObject*), parameters=QObject* )
- class nexxT.services.SrvPlaybackControl.PlaybackControlConsole(config)[source]
Bases:
MVCPlaybackControlBaseConsole service for playback control. Basically inverts the signals and slots and provides an API for scripting. The GUI service inherits from this class, so that the GUI can also be scripted in the same way.
- __init__(self, /, parent: PySide6.QtCore.QObject | None = None, *, objectName: str | None = None) None[source]
Initialize self. See help(type(self)) for accurate signature.
- currentTimestampChanged
- playbackPaused
- playbackStarted
- seekTime(timestampNS)[source]
Seek to the specified time
- Parameters:
timestampNS – the timestamp in nanoseconds
- Returns:
- sequenceOpened
- setSequence(file)[source]
Set the sequence to be played.
- Parameters:
file – a string containing a filename
- Returns:
- setTimeFactor(factor)[source]
Set the time factor to be used.
- Parameters:
factor – a float containing the factor.
- Returns:
- staticMetaObject = PySide6.QtCore.QMetaObject("PlaybackControlConsole" inherits "MVCPlaybackControlBase": Methods: #15 type=Signal, signature=supportedFeaturesChanged(PyObject,PyObject), parameters=PyObject, PyObject #16 type=Signal, signature=sequenceOpened(QString,qlonglong,qlonglong,PyObject), parameters=QString, qlonglong, qlonglong, PyObject #17 type=Signal, signature=currentTimestampChanged(qlonglong), parameters=qlonglong #18 type=Signal, signature=playbackStarted() #19 type=Signal, signature=playbackPaused() #20 type=Signal, signature=timeRatioChanged(double), parameters=double )
- stepBackward(stream)[source]
Step one frame backward in the given stream (might be None)
- Parameters:
stream – a string containing the selected stream.
- Returns:
- stepForward(stream)[source]
Step one frame forward in the given stream (might be None).
- Parameters:
stream – a string containing the selected stream.
- Returns:
- supportedFeaturesChanged
- timeRatioChanged
- class nexxT.services.SrvPlaybackControl.PlaybackDeviceProxy(playbackControl, playbackDevice, nameFilters)[source]
Bases:
QObjectThis class acts as a proxy and is connected to exactly one playback device over QT signals slots for providing thread safety.
- __init__(self, /, parent: PySide6.QtCore.QObject | None = None, *, objectName: str | None = None) None[source]
Initialize self. See help(type(self)) for accurate signature.
- currentTimestampChanged
- hasControl()[source]
Returns whether this proxy object has control over the player
- Returns:
true if this proxy object has control
- pausePlayback()[source]
Proxy function, checks whether this proxy has control and emits the signal if necessary
- playbackPaused
- playbackStarted
- seekBeginning()[source]
Proxy function, checks whether this proxy has control and emits the signal if necessary
- seekEnd()[source]
Proxy function, checks whether this proxy has control and emits the signal if necessary
- seekTime(timestampNS)[source]
Proxy function, checks whether this proxy has control and emits the signal if necessary
- Parameters:
timestampNS – the timestamp in nanoseconds
- sequenceOpened
- setSequence(filename)[source]
Proxy function, checks whether filename matches the filter’s name filter list and takes control if necessary.
- Parameters:
filename – a string instance or None
- setTimeFactor(factor)[source]
Proxy function, checks whether this proxy has control and emits the signal if necessary
- Parameters:
factor – time factor as a float
- startPlayback()[source]
Proxy function, checks whether this proxy has control and emits the signal if necessary
- staticMetaObject = PySide6.QtCore.QMetaObject("PlaybackDeviceProxy" inherits "QObject": Methods: #4 type=Signal, signature=_startPlayback() #5 type=Signal, signature=_pausePlayback() #6 type=Signal, signature=_stepForward(QString), parameters=QString #7 type=Signal, signature=_stepBackward(QString), parameters=QString #8 type=Signal, signature=_seekBeginning() #9 type=Signal, signature=_seekEnd() #10 type=Signal, signature=_seekTime(qlonglong), parameters=qlonglong #11 type=Signal, signature=_setSequence(PyObject), parameters=PyObject #12 type=Signal, signature=_setTimeFactor(double), parameters=double #13 type=Signal, signature=sequenceOpened(QString,qlonglong,qlonglong,PyObject), parameters=QString, qlonglong, qlonglong, PyObject #14 type=Signal, signature=currentTimestampChanged(qlonglong), parameters=qlonglong #15 type=Signal, signature=playbackStarted() #16 type=Signal, signature=playbackPaused() #17 type=Signal, signature=timeRatioChanged(double), parameters=double )
- stepBackward(stream)[source]
Proxy function, checks whether this proxy has control and emits the signal if necessary
- stepForward(stream)[source]
Proxy function, checks whether this proxy has control and emits the signal if necessary
- timeRatioChanged