mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-28 14:42:34 +02:00
2016-03-29 Fred Gleason <fredg@paravelsystems.com>
* Added a switcher driver for the Broadcast Tools SS 4.1 MLR Switcher/Router in 'ripcd/btss41mlr.cpp' and 'ripcd/btss41mlr.h'.
This commit is contained in:
parent
1f494fbc5d
commit
129004ace4
@ -15050,3 +15050,6 @@
|
||||
* Added the 'Copy Cut' ['CP'] RML in 'lib/rdmacro.cpp' and
|
||||
'lib/rdmacro.h'.
|
||||
* Implemented the 'Copy Cut' ['CP'] RML in 'rdcatchd/local_macros.cpp'.
|
||||
2016-03-29 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added a switcher driver for the Broadcast Tools SS 4.1 MLR
|
||||
Switcher/Router in 'ripcd/btss41mlr.cpp' and 'ripcd/btss41mlr.h'.
|
||||
|
@ -12,6 +12,7 @@ Broadcast Tools GPI-16 General Purpose Input Module
|
||||
Broadcast Tools Sentinel 4 Web AES Switcher
|
||||
Broadcast Tools SS 12.4 Audio Switcher
|
||||
Broadcast Tools SS 16.4 Audio Switcher
|
||||
Broadcast Tools SS 4.1 MLR Switcher/Router
|
||||
Broadcast Tools SS 4.2 Audio Switcher
|
||||
Broadcast Tools SS 4.4 Audio Switcher
|
||||
Broadcast Tools ACS 8.2 Audio Control Switcher
|
||||
@ -283,6 +284,33 @@ Tools documentation), then you will also need to be sure that DIP
|
||||
switch SW13-7 is ON.
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
BROADCAST TOOLS SS 4.1 MLR SWITCHER/ROUTER
|
||||
|
||||
Driver Name: BroadcastTools SS4.1 MLR
|
||||
|
||||
Supported RML Commands:
|
||||
Switch Take ('ST')
|
||||
GPI Enable ('GE')
|
||||
GPI Set ('GI')
|
||||
|
||||
GENERAL NOTES:
|
||||
Control is done by means of an RS-232C connection to a four pin RJ11
|
||||
modular jack on the back of the unit (an adapter to a standard DB9
|
||||
connector is supplied by Broadcast Tools with the unit). Serial port
|
||||
speed on the SS 4.1 should be set to 9600 (DIP switches SW6-4 and
|
||||
SW6-5 set to 'off'). Serial port parameters in RDAdmin should be set
|
||||
to 9600 baud rate, no parity, 8 data bits, 1 stop bit, CR/LF termination.
|
||||
|
||||
The SS 4.1 should be configured to use unit ID '0', with DIP switches
|
||||
SW6-1, SW6-2 and SW6-3 all set to 'off'.
|
||||
|
||||
Operation in 'multidrop' mode is not supported. If you wish to use
|
||||
GPI (referred to as 'PIP', for 'Parallel Input Port' in the Broadcast
|
||||
Tools documentation), then you will also need to be sure that DIP
|
||||
switch SW6-7 is ON.
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
BROADCAST TOOLS SS 4.4
|
||||
|
||||
|
@ -67,7 +67,8 @@ bool __mx_primary_controls[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
{0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0}, // Software Authority
|
||||
{0,1,1,1,0,0,1,1,0,0,0,1,1,0,0,0,1,1,1,1,0,0,0,0,1,0,0,0,0}, // SAS 16000
|
||||
{0,1,0,0,0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0}, // Ross NK/SCP
|
||||
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0} // BT ADMS 44.22
|
||||
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0}, // BT ADMS 44.22
|
||||
{0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0} // BT SS 4.1 MLR
|
||||
};
|
||||
bool __mx_backup_controls[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
{
|
||||
@ -109,7 +110,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}, // Software Authority
|
||||
{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}, // SAS 16000
|
||||
{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}, // ROSS NK/SCP
|
||||
{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 ADMS 44.22
|
||||
{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 ADMS 44.22
|
||||
{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 SS 4.1 MLR
|
||||
};
|
||||
|
||||
int __mx_default_values[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
@ -152,7 +154,8 @@ int __mx_default_values[RDMatrix::LastType][RDMatrix::LastControl]=
|
||||
{1,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}, // Software Authority
|
||||
{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}, // SAS 16000
|
||||
{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}, // Ross NK/SCP
|
||||
{0,0,0,0,0,0,0,0,0,0,0,8,2,16,13,0,0,0,0,0,0,0,0,0,0,0,0,1,0} // BT ADMS 44.22
|
||||
{0,0,0,0,0,0,0,0,0,0,0,8,2,16,13,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // BT ADMS 44.22
|
||||
{0,0,0,0,0,0,0,0,0,0,0,4,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0} // BT SS 4.1 MLR
|
||||
};
|
||||
|
||||
RDMatrix::RDMatrix(const QString &station,int matrix)
|
||||
@ -712,6 +715,10 @@ QString RDMatrix::typeString(RDMatrix::Type type)
|
||||
return QString("BroadcastTools ADMS 44.22");
|
||||
break;
|
||||
|
||||
case RDMatrix::BtSs41Mlr:
|
||||
return QString("BroadcastTools SS 4.1 MLR");
|
||||
break;
|
||||
|
||||
default:
|
||||
return QString("Unknown Type");
|
||||
break;
|
||||
|
@ -39,7 +39,7 @@ class RDMatrix
|
||||
BtSrc16=24,Harlond=25,Acu1p=26,LiveWireMcastGpio=27,Am16=28,
|
||||
LiveWireLwrpGpio=29,BtSentinel4Web=30,BtGpi16=31,ModemLines=32,
|
||||
SoftwareAuthority=33,Sas16000=34,RossNkScp=35,BtAdms4422=36,
|
||||
LastType=37};
|
||||
BtSs41Mlr=37,LastType=38};
|
||||
enum Endpoint {Input=0,Output=1};
|
||||
enum Mode {Stereo=0,Left=1,Right=2};
|
||||
enum VguestAttribute {VguestEngine=0,VguestDevice=1,VguestSurface=2,
|
||||
|
@ -43,6 +43,7 @@ dist_ripcd_SOURCES = acu1p.cpp acu1p.h\
|
||||
btsentinel4web.cpp btsentinel4web.h\
|
||||
btss124.cpp btss124.h\
|
||||
btss164.cpp btss164.h\
|
||||
btss41mlr.cpp btss41mlr.h\
|
||||
btss42.cpp btss42.h\
|
||||
btss44.cpp btss44.h\
|
||||
btss82.cpp btss82.h\
|
||||
@ -89,6 +90,7 @@ nodist_ripcd_SOURCES = moc_am16.cpp\
|
||||
moc_btsrc8iii.cpp\
|
||||
moc_btss124.cpp\
|
||||
moc_btss164.cpp\
|
||||
moc_btss41mlr.cpp\
|
||||
moc_btss42.cpp\
|
||||
moc_btss44.cpp\
|
||||
moc_btss82.cpp\
|
||||
|
213
ripcd/btss41mlr.cpp
Normal file
213
ripcd/btss41mlr.cpp
Normal file
@ -0,0 +1,213 @@
|
||||
// btss41mlr.cpp
|
||||
//
|
||||
// A Rivendell switcher driver for the BroadcastTools SS 4.1 MLR
|
||||
//
|
||||
// (C) Copyright 2002-2016 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 <qstringlist.h>
|
||||
#include <qtimer.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <globals.h>
|
||||
#include <btss41mlr.h>
|
||||
|
||||
|
||||
BtSs41Mlr::BtSs41Mlr(RDMatrix *matrix,QObject *parent)
|
||||
: Switcher(matrix,parent)
|
||||
{
|
||||
//
|
||||
// Initialize Data Structures
|
||||
//
|
||||
bt_istate=0;
|
||||
for(int i=0;i<BTSS41MLR_GPIO_PINS;i++) {
|
||||
bt_gpi_state[i]=false;
|
||||
bt_gpi_mask[i]=false;
|
||||
}
|
||||
|
||||
//
|
||||
// Get Matrix Parameters
|
||||
//
|
||||
bt_matrix=matrix->matrix();
|
||||
bt_inputs=matrix->inputs();
|
||||
bt_outputs=matrix->outputs();
|
||||
bt_gpis=matrix->gpis();
|
||||
bt_gpos=matrix->gpos();
|
||||
|
||||
//
|
||||
// Initialize the TTY Port
|
||||
//
|
||||
RDTty *tty=new RDTty(rdstation->name(),matrix->port(RDMatrix::Primary));
|
||||
bt_device=new RDTTYDevice();
|
||||
if(tty->active()) {
|
||||
bt_device->setName(tty->port());
|
||||
bt_device->setSpeed(tty->baudRate());
|
||||
bt_device->setWordLength(tty->dataBits());
|
||||
bt_device->setParity(tty->parity());
|
||||
bt_device->open(IO_Raw|IO_ReadWrite);
|
||||
}
|
||||
delete tty;
|
||||
|
||||
//
|
||||
// Interval OneShots
|
||||
//
|
||||
bt_gpi_oneshot=new RDOneShot(this);
|
||||
connect(bt_gpi_oneshot,SIGNAL(timeout(int)),this,SLOT(gpiOneshotData(int)));
|
||||
bt_gpo_oneshot=new RDOneShot(this);
|
||||
connect(bt_gpo_oneshot,SIGNAL(timeout(int)),this,SLOT(gpoOneshotData(int)));
|
||||
|
||||
//
|
||||
// The Poll Timer
|
||||
//
|
||||
QTimer *timer=new QTimer(this,"poll_timer");
|
||||
connect(timer,SIGNAL(timeout()),this,SLOT(readyReadData()));
|
||||
timer->start(BTSS41MLR_POLL_INTERVAL);
|
||||
}
|
||||
|
||||
|
||||
BtSs41Mlr::~BtSs41Mlr()
|
||||
{
|
||||
delete bt_device;
|
||||
delete bt_gpi_oneshot;
|
||||
delete bt_gpo_oneshot;
|
||||
}
|
||||
|
||||
|
||||
RDMatrix::Type BtSs41Mlr::type()
|
||||
{
|
||||
return RDMatrix::BtSs41Mlr;
|
||||
}
|
||||
|
||||
|
||||
unsigned BtSs41Mlr::gpiQuantity()
|
||||
{
|
||||
return bt_gpis;
|
||||
}
|
||||
|
||||
|
||||
unsigned BtSs41Mlr::gpoQuantity()
|
||||
{
|
||||
return bt_gpos;
|
||||
}
|
||||
|
||||
|
||||
bool BtSs41Mlr::primaryTtyActive()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool BtSs41Mlr::secondaryTtyActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void BtSs41Mlr::processCommand(RDMacro *cmd)
|
||||
{
|
||||
QString str;
|
||||
|
||||
switch(cmd->command()) {
|
||||
case RDMacro::ST:
|
||||
if((cmd->arg(1).toInt()<0)||(cmd->arg(1).toInt()>bt_inputs)||
|
||||
(cmd->arg(2).toInt()<1)||(cmd->arg(2).toInt()>1)) {
|
||||
cmd->acknowledge(false);
|
||||
emit rmlEcho(cmd);
|
||||
return;
|
||||
}
|
||||
if(cmd->arg(1).toInt()==0) {
|
||||
str=QString().sprintf("*%dMA",BTSS41MLR_UNIT_ID);
|
||||
bt_device->writeBlock(str,str.length());
|
||||
}
|
||||
else {
|
||||
str=QString().sprintf("*%d%02d",BTSS41MLR_UNIT_ID,
|
||||
cmd->arg(1).toInt());
|
||||
bt_device->writeBlock(str,str.length());
|
||||
}
|
||||
cmd->acknowledge(true);
|
||||
emit rmlEcho(cmd);
|
||||
break;
|
||||
|
||||
default:
|
||||
cmd->acknowledge(false);
|
||||
emit rmlEcho(cmd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BtSs41Mlr::readyReadData()
|
||||
{
|
||||
char buffer[256];
|
||||
int n;
|
||||
|
||||
while((n=bt_device->readBlock(buffer,255))>0) {
|
||||
for(int i=0;i<n;i++) {
|
||||
switch(0xFF&buffer[i]) {
|
||||
case 10:
|
||||
ProcessStatus(bt_accum);
|
||||
bt_accum="";
|
||||
break;
|
||||
|
||||
case 13:
|
||||
break;
|
||||
|
||||
default:
|
||||
bt_accum+=buffer[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BtSs41Mlr::gpiOneshotData(int value)
|
||||
{
|
||||
bt_gpi_mask[value]=false;
|
||||
bt_device->writeBlock("*0SPA",5);
|
||||
}
|
||||
|
||||
|
||||
void BtSs41Mlr::gpoOneshotData(int value)
|
||||
{
|
||||
emit gpoChanged(bt_matrix,value,false);
|
||||
}
|
||||
|
||||
|
||||
void BtSs41Mlr::ProcessStatus(const QString &msg)
|
||||
{
|
||||
QStringList f0=f0.split(",",msg);
|
||||
|
||||
if(f0.size()==10) {
|
||||
if((f0[0]==QString().sprintf("S%dP",BTSS41MLR_UNIT_ID))&&(f0[1]=="A")) {
|
||||
for(int i=0;i<bt_gpis;i++) {
|
||||
if(f0[2+i]=="0") {
|
||||
if(bt_gpi_state[i]&&(!bt_gpi_mask[i])) {
|
||||
emit gpiChanged(bt_matrix,i,false);
|
||||
bt_gpi_state[i]=false;
|
||||
}
|
||||
}
|
||||
if(f0[2+i]=="1") {
|
||||
if(!bt_gpi_state[i]&&(!bt_gpi_mask[i])) {
|
||||
emit gpiChanged(bt_matrix,i,true);
|
||||
bt_gpi_state[i]=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
71
ripcd/btss41mlr.h
Normal file
71
ripcd/btss41mlr.h
Normal file
@ -0,0 +1,71 @@
|
||||
// btss41mlr.h
|
||||
//
|
||||
// A Rivendell switcher driver for the BroadcastTools SS 4.1 MLR
|
||||
//
|
||||
// (C) Copyright 2002-2016 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 BTSS41MLR_H
|
||||
#define BTSS41MLR_H
|
||||
|
||||
#include <rd.h>
|
||||
#include <rdmatrix.h>
|
||||
#include <rdmacro.h>
|
||||
#include <rdtty.h>
|
||||
#include <rdoneshot.h>
|
||||
|
||||
#include <switcher.h>
|
||||
|
||||
#define BTSS41MLR_UNIT_ID 0
|
||||
#define BTSS41MLR_POLL_INTERVAL 100
|
||||
#define BTSS41MLR_GPIO_PINS 16
|
||||
|
||||
class BtSs41Mlr : public Switcher
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BtSs41Mlr(RDMatrix *matrix,QObject *parent=0);
|
||||
~BtSs41Mlr();
|
||||
RDMatrix::Type type();
|
||||
unsigned gpiQuantity();
|
||||
unsigned gpoQuantity();
|
||||
bool primaryTtyActive();
|
||||
bool secondaryTtyActive();
|
||||
void processCommand(RDMacro *cmd);
|
||||
|
||||
private slots:
|
||||
void readyReadData();
|
||||
void gpiOneshotData(int value);
|
||||
void gpoOneshotData(int value);
|
||||
|
||||
private:
|
||||
void ProcessStatus(const QString &msg);
|
||||
RDTTYDevice *bt_device;
|
||||
RDOneShot *bt_gpi_oneshot;
|
||||
RDOneShot *bt_gpo_oneshot;
|
||||
int bt_matrix;
|
||||
int bt_inputs;
|
||||
int bt_outputs;
|
||||
int bt_gpis;
|
||||
int bt_gpos;
|
||||
int bt_istate;
|
||||
bool bt_gpi_state[BTSS41MLR_GPIO_PINS];
|
||||
bool bt_gpi_mask[BTSS41MLR_GPIO_PINS];
|
||||
QString bt_accum;
|
||||
};
|
||||
|
||||
|
||||
#endif // BTSS41MLR_H
|
@ -2,9 +2,7 @@
|
||||
//
|
||||
// Load Switcher drivers for ripcd(8)
|
||||
//
|
||||
// (C) Copyright 2002-2004 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// $Id: loaddrivers.cpp,v 1.1.8.9 2014/02/17 02:19:03 cvs Exp $
|
||||
// (C) Copyright 2002-2016 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
|
||||
@ -39,6 +37,7 @@
|
||||
#include <btsrc8iii.h>
|
||||
#include <btss124.h>
|
||||
#include <btss164.h>
|
||||
#include <btss41mlr.h>
|
||||
#include <btss42.h>
|
||||
#include <btss44.h>
|
||||
#include <btss82.h>
|
||||
@ -122,6 +121,10 @@ bool MainObject::LoadSwitchDriver(int matrix_num)
|
||||
ripcd_switcher[matrix_num]=new BtSs164(matrix,this);
|
||||
break;
|
||||
|
||||
case RDMatrix::BtSs41Mlr:
|
||||
ripcd_switcher[matrix_num]=new BtSs41Mlr(matrix,this);
|
||||
break;
|
||||
|
||||
case RDMatrix::BtSs42:
|
||||
ripcd_switcher[matrix_num]=new BtSs42(matrix,this);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user