SUBTITLES

[Revised for QLab 4.1 13 JUL 17. Alternative version for Multi Line Titles added NOV 17]

One of the most  labour intensive tasks in QLab is creating a cuelist for a lot of very similar cues, which vary only in their content. If you are doing a show where you want to add subtitles (or supertitles or captions) to other video content, using the same displays, you may have to program thousands of cues. Wouldn’t it be great to just have all the subtitles in a text file, hit one button, and before you have time to make a cup of coffee, have a performance ready workspace automatically generated.

In this example you need a textedit document with your Titles (1 per paragraph) Open this QLab workspace and your TextEdit file,  press Control-S and the process begins.

Here is a  screen recording of a solution in action. Best viewed fullscreen.

How It Works:

Important Note:

From QLab 4 onwards TITLES Cues are now called TEXT. In the following examples all references to cue types should be changed from “Titles” to “Text”

The workspace uses 3 scripts in a group cue. The scripts are contained in a separate cue list in the workspace.

TITLES imports the paragraphs of the text document into QLab Titles cues, using the font settings in QLab/settings/Titles. It counts the number of paragraphs in the text document and then creates a Titles cue for each one, setting the text of the title and the q name of the cue to the imported text.

tell application “TextEdit”
set thetext to the text of the front document
set thecount to the number of paragraphs in thetext
end tell
tell application id “com.figure53.qlab.3” to tell front workspace
repeat with i from 1 to thecount
make type “Titles”
set selectedCues to selected as list
set newCue to last item of (selected as list)
set thecuenumber to q number of newCue
set thetitle to paragraph i of thetext
set q name of newCue to thetitle
set the text of newCue to thetitle
end repeat
end tell

MAKE  generates a group cue that fades the old title and starts the new title and fades it in. Rich Walsh contributed several improvements to my first version of this.

At the top of the script are some variables you can edit to set the timing of the cues.

set userUpTime to 2 — Time for images to fade up in
set userDownTime to 1 — Time for images to fade down in
set userHoldTime to 0.5
— Time to wait between starting fade down and starting fade up
— Declarations
set notFirstCue to false
— Main routine
tell application id “com.figure53.qlab.3” to tell front workspace
set selectedCues to every cue as list
repeat with eachCue in selectedCues
if q type of eachCue is “Titles” then — Any other selected cues will be ignored; the sequence will end up after them
— Make a fade out cue (not for the first cue)
if notFirstCue then
make type “Fade” — Cue numbers and names not altered from QLab defaults
set fadeOutCue to last item of (selected as list)
set cue target of fadeOutCue to previousCue
set duration of fadeOutCue to userDownTime
set do opacity of fadeOutCue to true
set opacity of fadeOutCue to 0
set stop target when done of fadeOutCue to true
end if
— Make a fade in cue
make type “Fade” — Cue numbers and names not altered from QLab defaults
set fadeInCue to last item of (selected as list)
set opacity of eachCue to 0
set cue target of fadeInCue to eachCue
set pre wait of fadeInCue to userHoldTime
set duration of fadeInCue to userUpTime
set do opacity of fadeInCue to true
— Make a Group Cue (have to do this here to get round QLab’s auto-grouping of selections ≥ 2 cues)
make type “Group” — Cue numbers not altered from QLab defaults
set groupCue to last item of (selected as list)
set mode of groupCue to fire_all
set q name of groupCue to “Crossfade to ” & q list name of eachCue
— Move cues into right place
move cue id (uniqueID of eachCue) of parent of eachCue to end of groupCue
if notFirstCue then move cue id (uniqueID of fadeOutCue) of parent of fadeOutCue to end of groupCue
move cue id (uniqueID of fadeInCue) of parent of fadeInCue to end of groupCue
— Setup variables for next pass
set previousCue to eachCue
set notFirstCue to true
end if
end repeat
end tell

NUMB cleans up the numbering, numbering all the generated group cues sequentially.

tell application id “com.figure53.qlab.3” to tell front workspace
set thecuelist to current cue list
set selectedCues to every cue
repeat with eachCue in selectedCues
if q type of eachCue is in {“Group”, “Titles”, “Fade”} then
set the q number of eachCue to “”
end if
end repeat
set thecuenumber to 1
set selectedCues to every cue in front cue list whose q type is “Group”
repeat with eachCue in selectedCues
set the q number of eachCue to thecuenumber
set thecuenumber to thecuenumber + 1
end repeat
end tell

You can download the Workspaces for QLab 3 and QLab 4 and an example text file here

If you want to be able to have more than 1 line per title, you are in luck!

A very small alteration to the TITLES script cue makes this possible.

tell application “TextEdit”
set thetext to the text of the front document
set thecount to the number of paragraphs in thetext

 

end tell

 

tell application id “com.figure53.qlab.3” to tell front workspace
repeat with i from 1 to thecount
make type “Titles”
set selectedCues to selected as list
set newCue to last item of (selected as list)
set thecuenumber to q number of newCue
set thetitle to paragraph i of thetext
set oldDelims to AppleScript’s text item delimiters
set AppleScript’s text item delimiters to {“/”}
set theparagraph to “”
set theItemCount to number of text items in thetitle
repeat with i from 1 to theItemCount
set theparagraph to theparagraph & (text item i of thetitle) & return
set q name of newCue to thetitle
set the text of newCue to theparagraph
end repeat
set AppleScript’s text item delimiters to oldDelims
end repeat
end tell

 

When each paragraph of you text file is read in it is examined to see if it contains any forward slash /  symbols. If it finds any it adds a return before the next item of text. It does this by setting the text delimiters to the forward slash temporarily

Subtitle 1/Subtitle2/Subtitle3/subtitle4 in your text file will be rendered in aTitles cue as:

Screen Shot 2017-11-17 at 14.15.28 (2)

 

You can download the  Multiline Workspaces for QLab 3 and QLab 4 and an example  text file here

Photo Credit: Mic Pool ©20015 All rights reserved

MenuGraphic