iluvcapra / py-ptsl

Native Python PTSL (Pro Tools Scripting Library) RPC interface
BSD 3-Clause "New" or "Revised" License
29 stars 8 forks source link

[BUG] #36

Closed evanmang closed 4 months ago

evanmang commented 4 months ago

Describe the bug get_timeline_selection is not working. I get this error:

function get_timeline_selection in engine.py at line 947

response = self.client.run(op) function run in client.py at line 161 raise CommandError(command_errors.errors)

function get_timeline_selection in engine.py at line 947 response = self.client.run(op) function run in client.py at line 161 raise CommandError(command_errors.errors)

To Reproduce Please enter code here that demonstrates the bug:


import sys
import datetime
import math

from ptsl import open_engine
from ptsl import PTSL_pb2 as pt

with open_engine(company_name="py-ptsl",
                 application_name=sys.argv[0]) as engine:

    selection = engine.get_timeline_selection()
    print(selection)

Expected behavior Return of Timeline Selection

Platform:

Additional context I tried changing


def get_timeline_selection(self) -> Tuple[str, str]:
            """
            Returns data about the current timeline selection.
            :returns: a Tuple of the In and Out time.
            """
            op = ops.GetMemoryLocations()
            response = self.client.run(op)
            return (response.in_time, ops.response.out_time)

to


def get_timeline_selection(self) -> Tuple[str, str]:
            """
            Returns data about the current timeline selection.
            :returns: a Tuple of the In and Out time.
            """
            op = ops.GetTimelineSelection()
            response = self.client.run(op)
            return (response.in_time, ops.response.out_time)

but just get no return value.

iluvcapra commented 4 months ago

Do you mind posting the stderr message you get?

iluvcapra commented 4 months ago

I figured it out, this was a typo in the engine source, it's fixed on master.

evanmang commented 4 months ago

thanks!