Skip to content

Commit

Permalink
Added a newtracks command
Browse files Browse the repository at this point in the history
  • Loading branch information
iluvcapra committed Nov 22, 2024
1 parent 57f5cde commit 6042a93
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion examples/toolshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import cmd
import shlex
import os.path
from typing import Optional

import ptsl
Expand Down Expand Up @@ -61,7 +62,7 @@ def do_newsession(self, args):
name, path, sr = shlex.split(args)
print(f"Creating new session {name} at {path} and SR {sr}")
command_args = {'session_name': name,
'session_location': path,
'session_location': os.path.expanduser(path),
'file_type': 'FT_WAVE',
'sample_rate': 'SR_' + str(sr),
'bit_depth': 'Bit24',
Expand All @@ -75,6 +76,18 @@ def do_newsession(self, args):
assert self.client
self.client.run_command(pt.CreateSession, command_args)

def do_newtracks(self, args):
'Create new audio track: NEWTRACKS count format'
count, fmt = shlex.split(args)
command_args = {'number_of_tracks': count,
'track_name': "New Track",
'track_format': 'TF_' + fmt,
'track_type': 'TT_Audio',
'track_timebase': 'TTB_Samples',
'insertion_point_position': 'TIPoint_Unknown',
}
self.run_command_on_session(pt.CreateNewTracks, command_args)

def do_locate(self, args):
'Locate to a given time: LOCATE time'
time = args.strip()
Expand Down

0 comments on commit 6042a93

Please sign in to comment.