From b7b3083c9501a24fce2b36136bc78797697411d0 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sun, 10 Dec 2023 21:29:21 -0800 Subject: [PATCH] Renamed `interleaved` property for issue #25 --- docs/source/implementation.rst | 13 ++++++++ ptsl/__init__.py | 2 +- ptsl/builders/create_session_builder.py | 2 +- ptsl/engine.py | 40 ++++++++++++++++++++++++- tests/test_builders.py | 2 +- 5 files changed, 55 insertions(+), 4 deletions(-) diff --git a/docs/source/implementation.rst b/docs/source/implementation.rst index f5fa0bd..87157c3 100644 --- a/docs/source/implementation.rst +++ b/docs/source/implementation.rst @@ -77,4 +77,17 @@ RecordHalfSpeed >=2023.3 :meth:`~ptsl.Engine.record_hal EditMemoryLocation >=2023.3 :meth:`~ptsl.Engine.edit_memory_location` GetMemoryLocations >=2023.3 :meth:`~ptsl.Engine.get_memory_locations` RegisterConnection >=2023.3 Implicit in :meth:`~ptsl.Client.__init__` +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 =================================== ========= ============================================================= diff --git a/ptsl/__init__.py b/ptsl/__init__.py index 0e5ab67..73408dc 100644 --- a/ptsl/__init__.py +++ b/ptsl/__init__.py @@ -24,9 +24,9 @@ - The third element increments with bug fixes or modifcations to docs, build system, etc. - """ + from .client import Client from .engine import Engine, open_engine from .errors import CommandError diff --git a/ptsl/builders/create_session_builder.py b/ptsl/builders/create_session_builder.py index 1f5ac77..135a478 100644 --- a/ptsl/builders/create_session_builder.py +++ b/ptsl/builders/create_session_builder.py @@ -58,7 +58,7 @@ def stereo_io_settings(self): def smpte51_io_settings(self): self._io_settings = IO_51SMPTEMix - def interlaved(self, value: bool): + def interleaved(self, value: bool): self._is_interleaved = value def create(self) -> None: diff --git a/ptsl/engine.py b/ptsl/engine.py index 23ef321..f16961a 100644 --- a/ptsl/engine.py +++ b/ptsl/engine.py @@ -28,7 +28,6 @@ MemoryLocationReference, MemoryLocationProperties, \ TimeProperties, CL_ClipLocation - @contextmanager def open_engine(*args, **kwargs): """ @@ -323,6 +322,45 @@ def record_half_speed(self): """ self.client.run(ops.RecordHalfSpeed()) + def create_memory_location(self, + location_number: int, + name: str, + start_time: str, + end_time: str, + time_properties: TimeProperties, + reference: MemoryLocationReference, + general_properties: MemoryLocationProperties, + comments: str) -> None: + """ + Create a new memory location. + """ + op = ops.CreateMemoryLocation( + number=location_number, + name=name, + start_time=start_time, + end_time=end_time, + time_properties=time_properties, + reference=reference, + general_properties=general_properties, + comments=comments + ) + + self.client.run(op) + + + def get_edit_mode(self): + """ + :returns: The current edit mode and options: + """ + op = ops.GetEditMode() + self.client.run(op) + mode = op.response.current_setting + + op2 = ops.GetEditModeOptions() + self.client.run(op2) + options = op.response.edit_mode_options + + def edit_memory_location(self, location_number: int, name: str, start_time: str, end_time: str, diff --git a/tests/test_builders.py b/tests/test_builders.py index 40179a0..9b16186 100644 --- a/tests/test_builders.py +++ b/tests/test_builders.py @@ -42,7 +42,7 @@ def test_create2(self): builder.wave_format() builder.bit_depth(32) builder.smpte51_io_settings() - builder.interlaved(False) + builder.interleaved(False) builder.create() engine.client.run.assert_called()