Go to end 30 seconds

386 views
Skip to first unread message

Nick Spica

unread,
Apr 11, 2018, 2:00:19 PM4/11/18
to QLab
Hey everyone,
I am switching over from Playback Pro. and there was an option in  PBP that allowed me to do a keyboard command and automatically jump to the last 30 seconds of any file that I had selected.
Is there a way to create a script to automatically do this for me in different intervals?
Thanks so much
-Nick

micpool

unread,
Apr 11, 2018, 2:32:19 PM4/11/18
to QLab
The basic script would be something like this

set the endtimer to 10 --set how many seconds of end to play here

tell application id "com.figure53.QLab.4" to tell front workspace

try

set theselected to last item of (selected as list)

pause theselected

set theduration to duration of theselected

load theselected time theduration - endtimer

start theselected

end try

end tell


Mic

Sean Dougall

unread,
Apr 11, 2018, 5:01:20 PM4/11/18
to ql...@googlegroups.com
Alternatively, if you’re okay with a few more keystrokes, you can use the Load to Time slider with a negative number to load from the end of the selected cue, without setting up any scripts. For example, [⌘T, -10, enter] will load to the last ten seconds.

Using the Load to Time slider has the added benefit of working on most Group cues. Scripting will necessarily rely on the selected cue providing a duration, which Group cues only do if their mode is set to “Start all children simultaneously”. The Load to Time slider, on the other hand, operates internally on an entire cue sequence, rather than an individual cue, so it will work on other group modes (all except “Start random child”, for reasons that may be unsurprising).

Cheers,
Sean

--
Sean Dougall

micpool

unread,
Apr 12, 2018, 5:54:35 AM4/12/18
to QLab
Indeed, but if you are jumping a running cue to the last 10 secs you will have to pause the cue before performing the load to time, and restart it once it has loaded. So 8 keypresses instead of 1.

If /cue/{cue_number}/loadAt {number} accepted negative numbers then this might allow a group of OSC cues to perform this function on running group cues. 

This script will use the fact that /cue/{cue_number}/maxTimeInCueSequence can accurately calculate the total duration of a group cue:

set the endtimer to 10 --set how many seconds of end to play here

tell application id "com.figure53.QLab.4" to tell front workspace

try

delay 0.1

set theselected to last item of (selected as list)

pause theselected

set theduration to (post wait of cue "last10" as string) - end timer --post wait time of cue "last10" is set with preceding network cue

set oscCmd to "/cue/selected/loadAt " & theduration

do shell script "echo " & oscCmd & " | nc -u -w 0 127.0.0.1 53535"

delay 0.1

start theselected

set the post wait of cue "last10" to 0

stop cue "last10"

end try

end tell


I can't find a way of incorporating an OSC query in a shell script, so have had to set the post wait to the group time with a separate OSC message before running the script.






Mic

Reply all
Reply to author
Forward
0 new messages