Command Implementations in Engine
How to Add a New Command Implementation
Create a new
Operationsubclass for the command.
- In the ptsl/ops directory, create a new source file for the command or commands you wish to implement.
For the implementation to work correctly, the name of the operation subclass must be identical to the name of the Command in the PTSL protocol.
In general, this class shouldn’t need to have any implementation (the class block can simply be a
pass). The Operation class handles looking up the request and response types, looks up the command ID, and maps kwargs of the operation to request args. Sometimes some implementation is required to clean up erroneous JSON data from the server or to rationalize certain responses.In ptsl/ops/__init__.py, import the name of the operation class.
Add a new method to
ptsl.Engine.
- On the Engine class create a new method to offer callers.
This method should accept all request arguments in its signature. If the method requres ptsl types that are not currently imported into engine.py, you should import these at the time and refer to them by their short name in the signature. Do not accept a PTSL Request type as a parameter.
- In the method body, create an instance of the
Operationclass you created in step 1.Pass all request arguments as kwargs to the operation’s initializer. Use the field names for your operation’s corresponding request type.
- Pass the operation to client.run().
This will encode the operation as a request, post it to the server and capture the response, if any.
- If there was a response, it will be set on the operation object you created in the response field.
Access that field’s members and return fields from it to the caller.
PTSL Version 1
Command |
Version |
|
|---|---|---|
CreateSession |
>=2022.12 |
|
OpenSession |
>=2022.12 |
|
Import |
>=2022.12 |
|
GetTrackList |
>=2022.12 |
|
SelectAllClipsOnTrack |
>=2022.12 |
|
ExtendSelectionToTargetTracks |
>=2022.12 |
|
TrimToSelection |
>=2022.12 |
|
CreateFadesBasedOnPreset |
>=2022.12 |
|
RenameTargetTrack |
>=2022.12 |
|
ConsolidateClip |
>=2022.12 |
|
ExportClipsAsFiles |
>=2022.12 |
|
ExportSelectedTracksAsAAFOMF |
>=2022.12 |
|
GetTaskStatus |
>=2022.12 |
|
HostReadyCheck |
>=2022.12 |
|
RefreshTargetAudioFiles |
>=2022.12 |
|
RefreshAllModifiedAudioFiles |
>=2022.12 |
|
GetFileLocation |
>=2022.12 |
|
CloseSession |
>=2022.12 |
|
SaveSession |
>=2022.12 |
|
SaveSessionAs |
>=2022.12 |
|
Cut |
>=2022.12 |
|
Copy |
>=2022.12 |
|
Paste |
>=2022.12 |
|
Clear |
>=2022.12 |
|
CutSpecial |
>=2022.12 |
|
CopySpecial |
>=2022.12 |
|
ClearSpecial |
>=2022.12 |
|
PasteSpecial |
>=2022.12 |
|
ExportMix |
>=2022.12 |
|
Spot |
>=2022.12 |
|
ExportSessionInfoAsText |
>=2022.12 |
|
GetDynamicProperties |
>=2022.12 |
|
SetPlaybackMode |
>=2022.12 |
|
SetRecordMode |
>=2022.12 |
|
GetSessionAudioFormat |
>=2022.12 |
|
GetSessionSampleRate |
>=2022.12 |
|
GetSessionBitDepth |
>=2022.12 |
|
GetSessionInterleavedState |
>=2022.12 |
|
GetSessionTimeCodeRate |
>=2022.12 |
|
GetSessionFeetFramesRate |
>=2022.12 |
|
GetSessionAudioRatePullSettings |
>=2022.12 |
|
GetSessionVideoRatePullSettings |
>=2022.12 |
|
GetSessionName |
>=2022.12 |
|
GetSessionPath |
>=2022.12 |
|
GetSessionStartTime |
>=2022.12 |
|
GetSessionLength |
>=2022.12 |
|
SetSessionAudioFormat |
>=2022.12 |
|
SetSessionBitDepth |
>=2022.12 |
|
SetSessionInterleavedState |
>=2022.12 |
|
SetSessionTimeCodeRate |
>=2022.12 |
|
SetSessionFeetFramesRate |
>=2022.12 |
|
SetSessionAudioRatePullSettings |
>=2022.12 |
|
SetSessionVideoRatePullSettings |
>=2022.12 |
|
SetSessionStartTime |
>=2022.12 |
|
SetSessionLength |
>=2022.12 |
|
GetPTSLVersion |
>=2022.12 |
|
GetPlaybackMode |
>=2022.12 |
|
GetRecordMode |
>=2022.12 |
|
GetTransportArmed |
>=2022.12 |
|
GetTransportState |
>=2022.12 |
|
AuthorizeConnection |
==2022.12 |
Implicit in |
RenameSelectedClip |
>=2023.3 |
|
RenameTargetClip |
>=2023.3 |
|
TogglePlayState |
>=2023.3 |
|
ToggleRecordEnable |
>=2023.3 |
|
PlayHalfSpeed |
>=2023.3 |
|
RecordHalfSpeed |
>=2023.3 |
|
EditMemoryLocation |
>=2023.3 |
|
GetMemoryLocations |
>=2023.3 |
|
RegisterConnection |
>=2023.3 |
Implicit in |
CreateMemoryLocation |
>=2023.6 |
|
CreateNewTracks |
>=2023.7 |
|
GetEditMode |
>=2023.7 |
|
SetEditMode |
>=2023.7 |
|
GetEditModeOptions |
>=2023.7 |
|
SetEditModeOptions |
>=2023.7 |
|
SelectTracksByName |
>=2023.7 |
|
SetZoomPreset |
>=2023.7 |
|
RecallZoomPreset |
>=2023.7 |
|
GetEditTool |
>=2023.7 |
|
SetEditTool |
>=2023.7 |
|
GetTimelineSelection |
>=2023.7 |
|
SetTimelineSelection |
>=2023.7 |