qlab-html - Render QLab workspaces to HTML for printing

239 views
Skip to first unread message

Jesse Friedman

unread,
Jul 13, 2017, 1:08:09 AM7/13/17
to QLab
I recently saw a member of our theater company taking phone pictures of a QLab workspace on their phone to review later at home. This got me wishing for a QLab function to print workspaces. Remembering Josh Langman's excellent specimen for his QLab 3 icon font, I ended up making this qlab-html tool for rendering the contents of a QLab workspace to HTML, which can then be printed or exported to PDF from your browser. Instructions are on the GitHub page. The tool requires Node.js - I haven't made a pre-packaged version yet.

Let me know what you think!
-Jesse

Dale Norris

unread,
Jul 14, 2017, 8:44:55 AM7/14/17
to QLab
I tried opening / running with your script but not quite sure of the  node process but would totally be on board when you've got a pre-packaged version 

Chris Ashworth

unread,
Jul 14, 2017, 11:46:40 AM7/14/17
to Jesse Friedman, ql...@googlegroups.com
Jesse this is so cool!

A few initial notes based on my first trial run (note I have not looked at the code at all):
  • When reading the docs I wasn’t sure if the “-O” options was a zero or the letter O
  • I wasn’t sure exactly how to pass in the name of the workspace, especially in cases such as a workspace that has spaces in the name:
    • qlab-html -O my workspace
    • qlab-html -O "my workspace"
    • qlab-html -O my\ workspace
    • qlab-html -O "my workspace.qlab4”
    • etc
    • Oh! Wait! I just realized this is probably only used as the name of the output file, not to actually find the workspace, yes?
  • I believe there is a workspace size limit beyond which it will produce an exception; it worked first try on a small test workspace but was not able to process a large workspace that had 1694 cues in 6 lists.
That’s all I have at first pass. 

This is really impressive!

-C

Jesse Friedman

unread,
Jul 14, 2017, 9:11:44 PM7/14/17
to QLab, je...@jesse.ws
Hi Chris, thanks for pointing out those issues. I've changed the -O option to -p to make it easier to distinguish. The -o argument does indeed specify the output filename. It defaults to the workspace filename, removing the .qlab4 and adding .html. To just export an HTML file with default settings you need use no arguments at all - the frontmost workspace is selected automatically. The -O (now -p) argument is boolean, and tells the script to automatically open the exported HTML file in your default browser.

The third issue you noticed is more complex, and I'm not sure why it's occurring. I've determined that it starts failing at messages around 121KB (500-800 cues, depending on cue number, type, and name length.) The error message indicates that it's happening in the OSC library I'm using, OSC.js, and says "Maximum call stack size exceeded", which usually indicates unintentional infinite recursion. This doesn't make sense though, as the library shouldn't be doing any parsing of the OSC message arguments, just separating them and passing them along, and this message only has one argument (a big JSON string). I will investigate this further, and probably file a bug report with OSC.js.

Thank you for your bug-hunting, and I'm glad you like qlab-html!
-Jesse

Christopher Ashworth

unread,
Jul 14, 2017, 9:46:57 PM7/14/17
to ql...@googlegroups.com, je...@jesse.ws
Jesse is the OSC library using UDP or TCP? 

If it's UDP I bet you're hitting the maximum message size limit of a UDP packet. (We hit this when working on QLab Remote early on, which is why we added TCP support too.)

(mobile)

Jesse Friedman

unread,
Jul 14, 2017, 9:56:15 PM7/14/17
to QLab, je...@jesse.ws
It's using TCP, I specifically chose this library because it has support for multiple transport layers. I think I've found the issue though, it has to do with the library using String.fromCharCode.apply with an array of all the characters in the string - if the string has 200k characters, then it's calling fromCharCode with 200k arguments, and depending on the JS VM's stack size this can hit an effective limit on number of arguments. I'm working on a fix, and will be submitting a pull request to OSC.js soon.

-Jesse

slev...@gmail.com

unread,
Jul 25, 2017, 5:33:23 PM7/25/17
to QLab
Very cool Jesse! 

Just out of curiosity, what are you going to use to make a pre-packaged version?

Sam

Jesse Friedman

unread,
Jul 27, 2017, 9:42:25 PM7/27/17
to QLab
Hi Sam, I think I'll probably just publish a ZIP with a Node executable and a .command shell script that launches qlab-html.

Derek Dumais

unread,
Sep 21, 2017, 3:02:55 PM9/21/17
to QLab
I just came here to search the group for a feature just like this.  I was recently doing the same thing, taking pictures of the workspace to reference later in emailing notes.  Being able to just print the workspace would be great.  I see this thread hasn't been updated in a few months, is there still a plan to release this?  Thanks!
Reply all
Reply to author
Forward
0 new messages