QLab冗余备份包含一台主机和一台备用机,当主机出现故障时切换到备用机播放,也就是常说的双机同步播放。QLab中实现双机冗余备份同步播放主要有以下几种方式:

网络Cue同步:
方便直接不需要任何硬件设备和脚本知识,请查看:QLab热备份 多台电脑QLab同步播放
硬件控制:
使用一个带双USB输出的MIDI控制器 同时给两台电脑发送GO或暂停指令达到同步的目的。需要购买一个双输出的控制器或自己手搓一个 如下图这种 网上很多制作方式的,有动手能力的可以自己制作


OSC控制:
OSC控制和前面的网络Cue同步方案类似原理。就是通过OSC发送QLab OSC指令 目前最新版的TouchOSC支持同时连接5个IP 也就相当于一个控制界面可以同步触发5台电脑。可以参考这个文章:TouchOSC制作QLab控制按钮及多设备多软件同时控制

本文介绍的是:脚本化主备切换  (转载自QLab官网)

首先介绍这个脚本切换的原理:如果只是简单的播放音频或视频(图像)的话只需把备用机静音即可,切换的时候把主机静音 备用机输出,这样两台电脑中每次只有一台在“输出”。切换音频和视频信号的解决方案多种多样,但切换 DMX、MIDI、时间码和 OSC 等控制信号就有点困难了。

这个时候QLab 的Override Controls可以巧妙地解决这个问题,允许您将 QLab 的 MIDI、MSC、SysEx、OSC、Timecode 和 DMX 输出关闭,但手动切换 Override Controls 面板中的所有按钮可能会很不方便,尤其是在主 Mac 和备用 Mac 上。

 

此工作区演示了一种自动静音和取消静音控制信号的方法。在桌面上创建「computer.rtf」文件,内容标记为主机”main”或备用机”backup”。使用AppleScript脚本定时检测该文件以区分工作区是主机还是从机,并允许您通过在主工作区和备用工作区上运行相同的脚本提示,将输出从主工作区切换到备用工作区。

示例工作区包含三个编号的 Cue,其中包含交换系统的工作智能。您可以将这三个 Cue 复制到您平时的工作区中。

第一个是编号为“status”的备忘录Cue,用于显示工作区的当前状态。此Cue的名称和颜色可根据需要由脚本Cue更改。
第二个是编号为“choose”的脚本Cue,要将工作区设置为主工作区或备用工作区,请运行此Cue。脚本如下:

-- tell the script where to look for your text file
-- this example uses the Desktop for the current user
set newFile to ((POSIX path of (path to home folder)) & "Desktop/computer.rtf")
set theFileContents to paragraphs of (read newFile)

-- define a variable, computerType, that will be filled in by the next block of code
set computerType to ""

-- check the text file for the word 'Main' or the word 'Backup', and fill in the appropriate value for computerType
repeat with p in theFileContents
if p contains "Backup" then
set computerType to "Backup"
else if p contains "Main" then
set computerType to "Main"
end if
end repeat

-- set up the mac as main or backup depending on the contents of computerType
tell application id "com.figure53.QLab.4" to tell front workspace

if computerType is "Main" then --set this mac as the main computer

-- set the overrides
tell application id "com.figure53.QLab.4"
set midi output enabled of overrides to true
set msc output enabled of overrides to true
set sysex output enabled of overrides to true
set osc output enabled of overrides to true
set timecode output enabled of overrides to true
set artnet enabled of overrides to true
end tell

-- set up the "switch" cue appropriately
set script source of cue "switch" to "tell application id \"com.figure53.QLab.4\"
set midi output enabled of overrides to false
set msc output enabled of overrides to false
set sysex output enabled of overrides to false
set osc output enabled of overrides to false
set timecode output enabled of overrides to false
set artnet enabled of overrides to false
set q name of cue \"status\" of front workspace to \"Main – MUTED\"
set q color of cue \"status\" of front workspace to \"red\"
end tell"

-- report back to the user
set q name of cue "status" to "Main – Active"
set q color of cue "status" to "green"
display dialog "I'm the Main" buttons {"OK"} default button 1

else if computerType is "Backup" then

-- set the overrides
tell application id "com.figure53.QLab.4"
set midi output enabled of overrides to false
set msc output enabled of overrides to false
set sysex output enabled of overrides to false
set osc output enabled of overrides to false
set timecode output enabled of overrides to false
set artnet enabled of overrides to false
end tell

-- set up the "switch" cue appropriately
set script source of cue "switch" to "tell application id \"com.figure53.QLab.4\"
set midi output enabled of overrides to true
set msc output enabled of overrides to true
set sysex output enabled of overrides to true
set osc output enabled of overrides to true
set timecode output enabled of overrides to true
set artnet enabled of overrides to true
set q name of cue \"status\" of front workspace to \"Backup – ACTIVE\"
set q color of cue \"status\" of front workspace to \"blue\"
end tell"

-- report back to the user
set q name of cue "status" to "Backup – Muted"
set q color of cue "status" to "orange"
display dialog "I'm the Backup" buttons {"OK"} default button 1

end if
end tell

该脚本定义了一个变量“computerType”,然后在桌面上名为“computer.rtf”的文本文件中查找单词“main”或“backup”(不区分大小写……“Main”或“main”,“Backup”或“backup”。)该单词被复制到变量中,然后该变量用于指示是否应该启用或禁用输出覆盖。

第三个是编号为“switch”的脚本Cue
该脚本还会将脚本Cue的内容替换switch为一个可反转覆盖的脚本。因此,如果文本文件显示这台计算机是“主计算机”,则所有覆盖都会设置为 false(取消静音),并且switch重写提示,将所有覆盖设置为 true(静音)。如果文本文件显示这台计算机是“备用计算机”,则所有覆盖都会设置为 true(静音),并且switch重写提示,将所有覆盖设置为 false(取消静音)。

choose脚本和脚本都switch设置了Cue的颜色和名称status来显示工作区的当前状态。

当switch在两台 Mac 上同时运行时,主工作区会自动静音,备用工作区会自动取消静音。为了switch在两台 Mac 上同时运行提示,建议您使用一个可以向两台 Mac 发送消息的 MIDI 控制器,并在控制器上指定一个按钮作为switch提示的 MIDI 触发器。

这个脚本切换工作区分QLab4和QLab5版本 请自行下载相应版本使用

发表回复

后才能评论