mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-24 08:31:41 +02:00
2017-09-02 Fred Gleason <fredg@paravelsystems.com>
* Implemented a driver for the Broadcast Tools Universal 4.1 MLR>>Web switcher.
This commit is contained in:
parent
1f574b9648
commit
dc8bfb8f49
@ -16014,3 +16014,6 @@
|
||||
2017-09-01 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Renamed 'Origin' field to 'Ingest' in the 'Cut Info/Record' dialog
|
||||
in RDLibrary.
|
||||
2017-09-02 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Implemented a driver for the Broadcast Tools Universal 4.1 MLR>>Web
|
||||
switcher.
|
||||
|
@ -18,6 +18,7 @@ Broadcast Tools SS 4.2 Audio Switcher
|
||||
Broadcast Tools SS 4.4 Audio Switcher
|
||||
Broadcast Tools ACS 8.2 Audio Control Switcher
|
||||
Broadcast Tools SS 8.2 Audio Switcher
|
||||
Broadcast Tools Universal 4.1MLR>>Web
|
||||
Harlond Virtual Mixer
|
||||
Kernel GPIO
|
||||
LiveWire LWRP Audio
|
||||
@ -438,6 +439,20 @@ Tools documentation), then you will also need to be sure that DIP
|
||||
switch SW-14-10 is ON.
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
BROADCAST TOOLS UNIVERSAL 4.1MLR>>WEB
|
||||
|
||||
Driver Name: BroadcastTools 4.1 MLR>>Web
|
||||
|
||||
Supported RML Commands:
|
||||
GPI Enable ('GE')
|
||||
GPI Set ('GI')
|
||||
Switch Take ('ST')
|
||||
|
||||
Control is by means of a TCP/IP connection to port 56. In 'Email/Network
|
||||
Setup' on the web configuration page, both the 'TCP Enabled' and 'PIP Mode
|
||||
Enabled' controls must be set to 'Enabled'.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Harlond Virtual Mixer
|
||||
|
||||
|
@ -70,7 +70,8 @@ bool __mx_primary_controls[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
{0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0}, // Modbus
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0}, // Kernel GPIO
|
||||
{0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0}, // WheatNet SLIO
|
||||
{0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0} // WheatNet LIO
|
||||
{0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0}, // WheatNet LIO
|
||||
{0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0} // BT Universale 4.1 MLR>>Web
|
||||
};
|
||||
bool __mx_backup_controls[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
{
|
||||
@ -117,7 +118,8 @@ bool __mx_backup_controls[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // Modbus
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // Kernel GPIO
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // WheatNet SLIO
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} // WheatNet LIO
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, // WheatNet LIO
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} // BT Universal 4.1 MLR>>Web
|
||||
};
|
||||
|
||||
int __mx_default_values[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
@ -165,7 +167,8 @@ int __mx_default_values[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
{1,0,0,502,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // Modbus
|
||||
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // Kernel GPIO
|
||||
{1,0,0,55776,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // WheatNet SLIO
|
||||
{1,0,0,55776,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0} // WheatNet LIO
|
||||
{1,0,0,55776,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // WheatNet LIO
|
||||
{1,0,0,56,0,0,0,0,0,0,0,4,1,5,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0} // BT Universal 4.1 MLR>>Web
|
||||
};
|
||||
|
||||
RDMatrix::RDMatrix(const QString &station,int matrix)
|
||||
@ -745,6 +748,10 @@ QString RDMatrix::typeString(RDMatrix::Type type)
|
||||
return QString("WheatNet LIO");
|
||||
break;
|
||||
|
||||
case RDMatrix::BtU41MlrWeb:
|
||||
return QString("BroadcastTools 4.1 MLR>>Web");
|
||||
break;
|
||||
|
||||
default:
|
||||
return QString("Unknown Type");
|
||||
break;
|
||||
|
@ -39,7 +39,7 @@ class RDMatrix
|
||||
LiveWireLwrpGpio=29,BtSentinel4Web=30,BtGpi16=31,ModemLines=32,
|
||||
SoftwareAuthority=33,Sas16000=34,RossNkScp=35,BtAdms4422=36,
|
||||
BtSs41Mlr=37,Modbus=38,KernelGpio=39,WheatnetSlio=40,
|
||||
WheatnetLio=41,LastType=42};
|
||||
WheatnetLio=41,BtU41MlrWeb=42,LastType=43};
|
||||
enum Endpoint {Input=0,Output=1};
|
||||
enum Mode {Stereo=0,Left=1,Right=2};
|
||||
enum VguestAttribute {VguestEngine=0,VguestDevice=1,VguestSurface=2,
|
||||
|
@ -49,6 +49,7 @@ dist_ripcd_SOURCES = acu1p.cpp acu1p.h\
|
||||
btss82.cpp btss82.h\
|
||||
btsrc16.cpp btsrc16.h\
|
||||
btsrc8iii.cpp btsrc8iii.h\
|
||||
btu41mlrweb.cpp btu41mlrweb.h\
|
||||
harlond.cpp harlond.h\
|
||||
kernelgpio.cpp kernelgpio.h\
|
||||
livewire_lwrpaudio.cpp livewire_lwrpaudio.h\
|
||||
@ -98,6 +99,7 @@ nodist_ripcd_SOURCES = moc_am16.cpp\
|
||||
moc_btss42.cpp\
|
||||
moc_btss44.cpp\
|
||||
moc_btss82.cpp\
|
||||
moc_btu41mlrweb.cpp\
|
||||
moc_harlond.cpp\
|
||||
moc_kernelgpio.cpp\
|
||||
moc_livewire_lwrpaudio.cpp\
|
||||
|
201
ripcd/btu41mlrweb.cpp
Normal file
201
ripcd/btu41mlrweb.cpp
Normal file
@ -0,0 +1,201 @@
|
||||
// btu41mlrweb.cpp
|
||||
//
|
||||
// Rivendell switcher driver for the BroadcastTools Universal 4.1 MLR>>Web
|
||||
//
|
||||
// (C) Copyright 2017 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public
|
||||
// License along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#include <syslog.h>
|
||||
|
||||
#include "btu41mlrweb.h"
|
||||
|
||||
BtU41MlrWeb::BtU41MlrWeb(RDMatrix *matrix,QObject *parent)
|
||||
: Switcher(matrix,parent)
|
||||
{
|
||||
bt_watchdog_active=false;
|
||||
|
||||
bt_ip_address=matrix->ipAddress(RDMatrix::Primary);
|
||||
bt_ip_port=matrix->ipPort(RDMatrix::Primary);
|
||||
|
||||
for(int i=0;i<BTU41MLRWEB_GPI_QUAN;i++) {
|
||||
bt_gpi_states[i]=false;
|
||||
}
|
||||
|
||||
bt_socket=new QSocket(this);
|
||||
connect(bt_socket,SIGNAL(connected()),this,SLOT(connectedData()));
|
||||
connect(bt_socket,SIGNAL(readyRead()),this,SLOT(readyReadData()));
|
||||
connect(bt_socket,SIGNAL(error(int)),this,SLOT(errorData(int)));
|
||||
bt_socket->connectToHost(bt_ip_address.toString(),bt_ip_port);
|
||||
|
||||
bt_keepalive_timer=new QTimer(this);
|
||||
connect(bt_keepalive_timer,SIGNAL(timeout()),this,SLOT(keepaliveData()));
|
||||
|
||||
bt_watchdog_timer=new QTimer(this);
|
||||
connect(bt_watchdog_timer,SIGNAL(timeout()),this,SLOT(watchdogData()));
|
||||
}
|
||||
|
||||
|
||||
BtU41MlrWeb::~BtU41MlrWeb()
|
||||
{
|
||||
delete bt_watchdog_timer;
|
||||
delete bt_keepalive_timer;
|
||||
delete bt_socket;
|
||||
}
|
||||
|
||||
|
||||
RDMatrix::Type BtU41MlrWeb::type()
|
||||
{
|
||||
return RDMatrix::BtU41MlrWeb;
|
||||
}
|
||||
|
||||
|
||||
unsigned BtU41MlrWeb::gpiQuantity()
|
||||
{
|
||||
return BTU41MLRWEB_GPI_QUAN;
|
||||
}
|
||||
|
||||
|
||||
unsigned BtU41MlrWeb::gpoQuantity()
|
||||
{
|
||||
return BTU41MLRWEB_GPO_QUAN;
|
||||
}
|
||||
|
||||
|
||||
bool BtU41MlrWeb::primaryTtyActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool BtU41MlrWeb::secondaryTtyActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void BtU41MlrWeb::processCommand(RDMacro *cmd)
|
||||
{
|
||||
switch(cmd->command()) {
|
||||
case RDMacro::ST:
|
||||
if((cmd->arg(1).toInt()<0)||(cmd->arg(1).toInt()>BTU41MLRWEB_INPUT_QUAN)||
|
||||
(cmd->arg(2).toInt()<1)||(cmd->arg(2).toInt()>2)) {
|
||||
cmd->acknowledge(false);
|
||||
emit rmlEcho(cmd);
|
||||
return;
|
||||
}
|
||||
if(cmd->arg(1).toInt()==0) {
|
||||
SendCommand("*0MA");
|
||||
}
|
||||
else {
|
||||
SendCommand(QString().sprintf("*0%02d",cmd->arg(1).toInt()));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BtU41MlrWeb::connectedData()
|
||||
{
|
||||
syslog(LOG_INFO,
|
||||
"connection to BroadcastTools device at %s:%u established",
|
||||
(const char *)bt_ip_address.toString(),0xffff&bt_ip_port);
|
||||
bt_watchdog_active=false;
|
||||
SendCommand("*0SPA");
|
||||
bt_keepalive_timer->start(BTU41MLRWEB_KEEPALIVE_INTERVAL);
|
||||
bt_watchdog_timer->start(BTU41MLRWEB_WATCHDOG_INTERVAL);
|
||||
}
|
||||
|
||||
|
||||
void BtU41MlrWeb::readyReadData()
|
||||
{
|
||||
char data[1501];
|
||||
int n=0;
|
||||
|
||||
while((n=bt_socket->readBlock(data,1500))>0) {
|
||||
data[n]=0;
|
||||
for(int i=0;i<n;i++) {
|
||||
switch(0xff&data[i]) {
|
||||
case 13:
|
||||
break;
|
||||
|
||||
case 10:
|
||||
ProcessCommand(bt_accum);
|
||||
bt_accum="";
|
||||
break;
|
||||
|
||||
default:
|
||||
bt_accum+=data[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BtU41MlrWeb::errorData(int err)
|
||||
{
|
||||
watchdogData();
|
||||
}
|
||||
|
||||
void BtU41MlrWeb::keepaliveData()
|
||||
{
|
||||
SendCommand("*0SL");
|
||||
}
|
||||
|
||||
|
||||
void BtU41MlrWeb::watchdogData()
|
||||
{
|
||||
if(!bt_watchdog_active) {
|
||||
syslog(LOG_WARNING,
|
||||
"connection to BroadcastTools device at %s:%u lost, attempting reconnect",
|
||||
(const char *)bt_ip_address.toString(),0xffff&bt_ip_port);
|
||||
bt_keepalive_timer->stop();
|
||||
bt_watchdog_active=true;
|
||||
}
|
||||
bt_socket->close();
|
||||
bt_socket->connectToHost(bt_ip_address.toString(),bt_ip_port);
|
||||
}
|
||||
|
||||
|
||||
void BtU41MlrWeb::ProcessCommand(const QString &cmd)
|
||||
{
|
||||
// syslog(LOG_NOTICE,"ProcessCommand(%s)\n",(const char *)cmd);
|
||||
|
||||
QStringList cmds=cmds.split(",",cmd);
|
||||
|
||||
if((cmds.size()==7)&&(cmds[0]=="S0P")) {
|
||||
for(int i=0;i<BTU41MLRWEB_GPI_QUAN;i++) {
|
||||
if(bt_gpi_states[i]!=(cmds[i+2]=="1")) {
|
||||
bt_gpi_states[i]=cmds[i+2]=="1";
|
||||
emit gpiChanged(matrixNumber(),i,bt_gpi_states[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if((cmds.size()==5)&&(cmds[0]=="S0L")) {
|
||||
bt_watchdog_timer->stop();
|
||||
bt_watchdog_timer->start(BTU41MLRWEB_WATCHDOG_INTERVAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BtU41MlrWeb::SendCommand(const QString &cmd)
|
||||
{
|
||||
bt_socket->writeBlock(cmd,cmd.length());
|
||||
}
|
77
ripcd/btu41mlrweb.h
Normal file
77
ripcd/btu41mlrweb.h
Normal file
@ -0,0 +1,77 @@
|
||||
// btu41mlrweb.h
|
||||
//
|
||||
// Rivendell switcher driver for the BroadcastTools Universal 4.1 MLR>>Web
|
||||
//
|
||||
// (C) Copyright 2017 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public
|
||||
// License along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef BTU41MLRWEB_H
|
||||
#define BTU41MLRWEB_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <qsignalmapper.h>
|
||||
#include <qsocket.h>
|
||||
#include <qtimer.h>
|
||||
|
||||
#include <rd.h>
|
||||
#include <rdmatrix.h>
|
||||
#include <rdmacro.h>
|
||||
|
||||
#include <switcher.h>
|
||||
|
||||
#define BTU41MLRWEB_INPUT_QUAN 4
|
||||
#define BTU41MLRWEB_OUTPUT_QUAN 1
|
||||
#define BTU41MLRWEB_GPI_QUAN 5
|
||||
#define BTU41MLRWEB_GPO_QUAN 0
|
||||
#define BTU41MLRWEB_KEEPALIVE_INTERVAL 2000
|
||||
#define BTU41MLRWEB_WATCHDOG_INTERVAL 5000
|
||||
|
||||
class BtU41MlrWeb : public Switcher
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BtU41MlrWeb(RDMatrix *matrix,QObject *parent=0);
|
||||
~BtU41MlrWeb();
|
||||
RDMatrix::Type type();
|
||||
unsigned gpiQuantity();
|
||||
unsigned gpoQuantity();
|
||||
bool primaryTtyActive();
|
||||
bool secondaryTtyActive();
|
||||
void processCommand(RDMacro *cmd);
|
||||
|
||||
private slots:
|
||||
void connectedData();
|
||||
void readyReadData();
|
||||
void errorData(int err);
|
||||
void keepaliveData();
|
||||
void watchdogData();
|
||||
|
||||
private:
|
||||
void ProcessCommand(const QString &cmd);
|
||||
void SendCommand(const QString &cmd);
|
||||
QSocket *bt_socket;
|
||||
QTimer *bt_watchdog_timer;
|
||||
bool bt_watchdog_active;
|
||||
QHostAddress bt_ip_address;
|
||||
uint16_t bt_ip_port;
|
||||
QString bt_accum;
|
||||
bool bt_gpi_states[BTU41MLRWEB_GPI_QUAN];
|
||||
QTimer *bt_keepalive_timer;
|
||||
};
|
||||
|
||||
|
||||
#endif // BTU41MLRWEB_H
|
@ -41,6 +41,7 @@
|
||||
#include <btss42.h>
|
||||
#include <btss44.h>
|
||||
#include <btss82.h>
|
||||
#include <btu41mlrweb.h>
|
||||
#include <harlond.h>
|
||||
#include <kernelgpio.h>
|
||||
#include <livewire_lwrpaudio.h>
|
||||
@ -141,6 +142,10 @@ bool MainObject::LoadSwitchDriver(int matrix_num)
|
||||
ripcd_switcher[matrix_num]=new BtSs82(matrix,this);
|
||||
break;
|
||||
|
||||
case RDMatrix::BtU41MlrWeb:
|
||||
ripcd_switcher[matrix_num]=new BtU41MlrWeb(matrix,this);
|
||||
break;
|
||||
|
||||
case RDMatrix::Harlond:
|
||||
ripcd_switcher[matrix_num]=new Harlond(matrix,this);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user