diff --git a/ChangeLog b/ChangeLog index 7f5bfa93..317ec0f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16661,3 +16661,5 @@ 2018-06-20 Fred Gleason * Added a 'TranscodingDelay=' parameter to the '[Tuning]' section of rd.conf(5). +2018-06-21 Fred Gleason + * Added support for the Broadcast Tools SS 2.1 switcher. diff --git a/docs/opsguide/gpio_switcher_devices.xml b/docs/opsguide/gpio_switcher_devices.xml index a71b83da..8a7041e4 100644 --- a/docs/opsguide/gpio_switcher_devices.xml +++ b/docs/opsguide/gpio_switcher_devices.xml @@ -467,6 +467,40 @@ + + BroadcastTools SS 2.1 + + + Driver Name: + + + BroadcastTools SS 2.1 + + + + + Supported RML Commands: + + + + Switch Take ['ST'] + + + + + + + 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 + parameters should be set to 9600 baud rate, no parity, 8 data bits, 1 + stop bit, CR/LF termination. + + + Operation in 'multidrop' mode is not supported. + + + BroadcastTools SS 16.4 diff --git a/lib/rdmatrix.cpp b/lib/rdmatrix.cpp index 61943747..c532fa35 100644 --- a/lib/rdmatrix.cpp +++ b/lib/rdmatrix.cpp @@ -2,7 +2,7 @@ // // Abstract a Rivendell Switcher Matrix // -// (C) Copyright 2002-2016 Fred Gleason +// (C) Copyright 2002-2018 Fred Gleason // // 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 @@ -71,7 +71,8 @@ bool __mx_primary_controls[RDMatrix::LastType][RDMatrix::LastControl]= {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,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 + {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 + {0,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,0,0} // BT SS 2.1 }; bool __mx_backup_controls[RDMatrix::LastType][RDMatrix::LastControl]= { @@ -119,7 +120,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}, // 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} // BT Universal 4.1 MLR>>Web + {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 + {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 2.1 }; int __mx_default_values[RDMatrix::LastType][RDMatrix::LastControl]= @@ -168,7 +170,8 @@ int __mx_default_values[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,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,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 + {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 + {0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0} // BT SS 2.1 }; RDMatrix::RDMatrix(const QString &station,int matrix) @@ -652,6 +655,10 @@ QString RDMatrix::typeString(RDMatrix::Type type) return QString("Logitek vGuest"); break; + case RDMatrix::BtSs21: + return QString("BroadcastTools SS2.1"); + break; + case RDMatrix::BtSs164: return QString("BroadcastTools SS16.4"); break; diff --git a/lib/rdmatrix.h b/lib/rdmatrix.h index 3641d2dd..7d317899 100644 --- a/lib/rdmatrix.h +++ b/lib/rdmatrix.h @@ -2,7 +2,7 @@ // // Abstract a Rivendell Switcher Matrix // -// (C) Copyright 2002-2017 Fred Gleason +// (C) Copyright 2002-2018 Fred Gleason // // 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,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,BtU41MlrWeb=42,LastType=43}; + WheatnetLio=41,BtU41MlrWeb=42,BtSs21=43,LastType=44}; enum Endpoint {Input=0,Output=1}; enum Mode {Stereo=0,Left=1,Right=2}; enum VguestAttribute {VguestEngine=0,VguestDevice=1,VguestSurface=2, diff --git a/ripcd/Makefile.am b/ripcd/Makefile.am index 0353209d..db843ad0 100644 --- a/ripcd/Makefile.am +++ b/ripcd/Makefile.am @@ -42,6 +42,7 @@ dist_ripcd_SOURCES = acu1p.cpp acu1p.h\ btgpi16.cpp btgpi16.h\ btsentinel4web.cpp btsentinel4web.h\ btss124.cpp btss124.h\ + btss21.cpp btss21.h\ btss164.cpp btss164.h\ btss41mlr.cpp btss41mlr.h\ btss42.cpp btss42.h\ @@ -95,6 +96,7 @@ nodist_ripcd_SOURCES = moc_am16.cpp\ moc_btsrc8iii.cpp\ moc_btss124.cpp\ moc_btss164.cpp\ + moc_btss21.cpp\ moc_btss41mlr.cpp\ moc_btss42.cpp\ moc_btss44.cpp\ diff --git a/ripcd/btss21.cpp b/ripcd/btss21.cpp new file mode 100644 index 00000000..4952f279 --- /dev/null +++ b/ripcd/btss21.cpp @@ -0,0 +1,122 @@ +// btss21.cpp +// +// A Rivendell switcher driver for the BroadcastTools SS 2.1 +// +// (C) Copyright 2002-2018 Fred Gleason +// +// 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 +#include + +#include + +#include +#include + + +BtSs21::BtSs21(RDMatrix *matrix,QObject *parent) + : Switcher(matrix,parent) +{ + // + // Get Matrix Parameters + // + bt_matrix=matrix->matrix(); + bt_inputs=matrix->inputs(); + bt_outputs=matrix->outputs(); + + // + // 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; +} + + +BtSs21::~BtSs21() +{ + delete bt_device; +} + + +RDMatrix::Type BtSs21::type() +{ + return RDMatrix::BtSs21; +} + + +unsigned BtSs21::gpiQuantity() +{ + return 0; +} + + +unsigned BtSs21::gpoQuantity() +{ + return 0; +} + + +bool BtSs21::primaryTtyActive() +{ + return true; +} + + +bool BtSs21::secondaryTtyActive() +{ + return false; +} + + +void BtSs21::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("*%dM",BTSS21_UNIT_ID); + bt_device->writeBlock(str,str.length()); + } + else { + str=QString().sprintf("*%d%d",BTSS21_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; + } +} diff --git a/ripcd/btss21.h b/ripcd/btss21.h new file mode 100644 index 00000000..3ef22b1f --- /dev/null +++ b/ripcd/btss21.h @@ -0,0 +1,55 @@ +// btss21.h +// +// A Rivendell switcher driver for the BroadcastTools SS 2.1 +// +// (C) Copyright 2002-2018 Fred Gleason +// +// 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 BTSS21_H +#define BTSS21_H + +#include +#include +#include +#include +#include + +#include + +#define BTSS21_UNIT_ID 0 + +class BtSs21 : public Switcher +{ + Q_OBJECT + public: + BtSs21(RDMatrix *matrix,QObject *parent=0); + ~BtSs21(); + RDMatrix::Type type(); + unsigned gpiQuantity(); + unsigned gpoQuantity(); + bool primaryTtyActive(); + bool secondaryTtyActive(); + void processCommand(RDMacro *cmd); + + private: + RDTTYDevice *bt_device; + int bt_matrix; + int bt_inputs; + int bt_outputs; +}; + + +#endif // BTSS21_H diff --git a/ripcd/loaddrivers.cpp b/ripcd/loaddrivers.cpp index 084da9f2..642ce41e 100644 --- a/ripcd/loaddrivers.cpp +++ b/ripcd/loaddrivers.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -126,6 +127,10 @@ bool MainObject::LoadSwitchDriver(int matrix_num) ripcd_switcher[matrix_num]=new BtSs164(matrix,this); break; + case RDMatrix::BtSs21: + ripcd_switcher[matrix_num]=new BtSs21(matrix,this); + break; + case RDMatrix::BtSs41Mlr: ripcd_switcher[matrix_num]=new BtSs41Mlr(matrix,this); break;