Remote Control of QLC+ using perl script
Posted: Mon Aug 19, 2013 9:10 pm
I created a perl script so that I could control my QLC+ virtual console remotely. I thought I would share it for those who might be interested. The script opens the doors for many different types of remote control. You can simply control it via command line, or use a web server language to execute the perl script and make a web interface.
~~~~
#!/usr/bin/perl
use Net::OpenSoundControl::Client;
# Put the IP Address of your QLC+ controller and set the port
my $QLC_Controller = "192.168.0.5";
my $QLC_Port = 7770;
# Setup your buttons here
@buttons = (
['/1/push1', 'f', '1'], # Button 1
['/1/push2', 'f', '1'], # Button 2
['/1/push3', 'f', '1'], # Button 3
['/1/push4', 'f', '1'], # Button 4
['/1/push5', 'f', '1'], # Button 5
['/1/push6', 'f', '1'], # Button 6
['/1/push7', 'f', '1'], # Button 7
['/5/OFF', 'f', '1'] # Button 8
);
my $client = Net::OpenSoundControl::Client->new(
Host => $QLC_Controller, Port => $QLC_Port )
or die "Could not start client: $@\n";
$arg = $ARGV[0];
$client->send($buttons[$arg]);
print "Sending signal for button $arg\n";
~~~~
To use this script, make sure you have perl installed, install the Net::OpenSoundControl module, setup OSC as your input on QLC, then edit a button and auto detect the input. From the command line run:
~~~~
perl_script_name.pl
~~~~
I used this script with PHP to build a web interface, then have ajax call your php script (http://.../script.php?button=1) which looks something like this:
~~~~
~~~~
~~~~
#!/usr/bin/perl
use Net::OpenSoundControl::Client;
# Put the IP Address of your QLC+ controller and set the port
my $QLC_Controller = "192.168.0.5";
my $QLC_Port = 7770;
# Setup your buttons here
@buttons = (
['/1/push1', 'f', '1'], # Button 1
['/1/push2', 'f', '1'], # Button 2
['/1/push3', 'f', '1'], # Button 3
['/1/push4', 'f', '1'], # Button 4
['/1/push5', 'f', '1'], # Button 5
['/1/push6', 'f', '1'], # Button 6
['/1/push7', 'f', '1'], # Button 7
['/5/OFF', 'f', '1'] # Button 8
);
my $client = Net::OpenSoundControl::Client->new(
Host => $QLC_Controller, Port => $QLC_Port )
or die "Could not start client: $@\n";
$arg = $ARGV[0];
$client->send($buttons[$arg]);
print "Sending signal for button $arg\n";
~~~~
To use this script, make sure you have perl installed, install the Net::OpenSoundControl module, setup OSC as your input on QLC, then edit a button and auto detect the input. From the command line run:
~~~~
perl_script_name.pl
~~~~
I used this script with PHP to build a web interface, then have ajax call your php script (http://.../script.php?button=1) which looks something like this:
~~~~
~~~~