diff --git a/ChangeLog b/ChangeLog index 7eda85be..2de06438 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14870,3 +14870,9 @@ * Added default parameters to the 'PadPoint' RLM in 'rlm_padpoint.c'. 2015-05-28 Fred Gleason * Added rdcleandirs(8) utility in 'utils/rdcleandirs/'. +2015-05-28 Fred Gleason + * Added an 'RDMatrix::RossNkScp' value to the 'RDMatrix::Type' + enumeration in 'lib/rdmatrix.cpp' and 'lib/rdmatrix.h'. + * Implemented a switcher driver for the Ross NK line of video + switchers via the SCP/A serial interface in 'ripcd/rossnkscp.cpp' + and 'riptcd/rossnkscp.h'. diff --git a/docs/SWITCHERS.txt b/docs/SWITCHERS.txt index b7a1b8f8..956f9e14 100644 --- a/docs/SWITCHERS.txt +++ b/docs/SWITCHERS.txt @@ -22,6 +22,7 @@ LiveWire Multicast GPIO Local Audio Adapter Logitek vGuest Quartz Electronics Type 1 Routing Protocol +Ross NK Video Switchers (via SCP/A Serial Interface) Serial Port Modem Control Lines Sierra Automated Systems 16000(D) Audio Router Sierra Automated Systems 32000 Audio Router @@ -511,6 +512,22 @@ Control can done either by means of an RS-232C connection or by means of TCP/IP to TCP port 23. +---------------------------------------------------------------------------- +Ross NK Video Switchers (via SCP/A Serial Interface) + +Driver Name: Ross NK-SCP/A Interface + +Supported RML Commands: + Switch Take ('ST') + +GENERAL NOTES: +Control is done by means of an RS-232C connection to a NK-SCP/A serial +interface. Serial port parameters should be set to 9600 baud rate, no parity, +8 data bits, 1 stop bit, CR termination. The Breakaway to use is defined +by setting the 'Card' parameter in the driver configuration, with +Card 0 = Breakaway 1, Card 1 = Breakaway 2, etc. + + ---------------------------------------------------------------------------- SERIAL PORT MODEM CONTROL LINES diff --git a/lib/rdmatrix.cpp b/lib/rdmatrix.cpp index 71ec588b..d10b84a7 100644 --- a/lib/rdmatrix.cpp +++ b/lib/rdmatrix.cpp @@ -65,7 +65,8 @@ bool __mx_primary_controls[RDMatrix::LastType][RDMatrix::LastControl]= {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0}, // BT GPI-16 {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0}, // Modem Lines {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,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 }; bool __mx_backup_controls[RDMatrix::LastType][RDMatrix::LastControl]= { @@ -105,7 +106,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}, // BT GPI-16 {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}, // Modem Lines {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}, // 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 }; int __mx_default_values[RDMatrix::LastType][RDMatrix::LastControl]= @@ -146,7 +148,8 @@ int __mx_default_values[RDMatrix::LastType][RDMatrix::LastControl]= {0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // BT GPI-16 {0,0,0,0,0,0,0,0,0,0,0,0,0,4,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0}, // Modem Lines {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}, // 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 }; RDMatrix::RDMatrix(const QString &station,int matrix) @@ -698,6 +701,10 @@ QString RDMatrix::typeString(RDMatrix::Type type) return QString("Software Authority Protocol"); break; + case RDMatrix::RossNkScp: + return QString("Ross NK-SCP/A Interface"); + break; + default: return QString("Unknown Type"); break; diff --git a/lib/rdmatrix.h b/lib/rdmatrix.h index 4cce1d15..a66b75d4 100644 --- a/lib/rdmatrix.h +++ b/lib/rdmatrix.h @@ -38,7 +38,7 @@ class RDMatrix BtSs42=19,LiveWireLwrpAudio=20,Quartz1=21,BtSs44=22,BtSrc8III=23, BtSrc16=24,Harlond=25,Acu1p=26,LiveWireMcastGpio=27,Am16=28, LiveWireLwrpGpio=29,BtSentinel4Web=30,BtGpi16=31,ModemLines=32, - SoftwareAuthority=33,Sas16000=34,LastType=35}; + SoftwareAuthority=33,Sas16000=34,RossNkScp=35,LastType=36}; 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 14e6b972..2eb6944d 100644 --- a/ripcd/Makefile.am +++ b/ripcd/Makefile.am @@ -60,6 +60,7 @@ dist_ripcd_SOURCES = acu1p.cpp acu1p.h\ ripcd.cpp ripcd.h globals.h\ ripcd_connection.cpp ripcd_connection.h\ ripcd_socket.cpp ripcd_socket.h\ + rossnkscp.cpp rossnkscp.h\ sas32000.cpp sas32000.h\ sas64000.cpp sas64000.h\ sas64000gpi.cpp sas64000gpi.h\ @@ -99,6 +100,7 @@ nodist_ripcd_SOURCES = moc_am16.cpp\ moc_quartz1.cpp\ moc_ripcd.cpp\ moc_ripcd_socket.cpp\ + moc_rossnkscp.cpp\ moc_sas32000.cpp\ moc_sas64000.cpp\ moc_sas64000gpi.cpp\ diff --git a/ripcd/loaddrivers.cpp b/ripcd/loaddrivers.cpp index c2b85358..4ec8be4c 100644 --- a/ripcd/loaddrivers.cpp +++ b/ripcd/loaddrivers.cpp @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -164,6 +165,10 @@ bool MainObject::LoadSwitchDriver(int matrix_num) ripcd_switcher[matrix_num]=new Quartz1(matrix,this); break; + case RDMatrix::RossNkScp: + ripcd_switcher[matrix_num]=new RossNkScp(matrix,this); + break; + case RDMatrix::Sas16000: ripcd_switcher[matrix_num]=new Sas16000(matrix,this); break; diff --git a/ripcd/rossnkscp.cpp b/ripcd/rossnkscp.cpp new file mode 100644 index 00000000..da0267ae --- /dev/null +++ b/ripcd/rossnkscp.cpp @@ -0,0 +1,114 @@ +// rossnkscp.cpp +// +// A Rivendell switcher driver for the Ross NK switchers via the SCP/A +// +// (C) Copyright 2002-2015 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 + + +RossNkScp::RossNkScp(RDMatrix *matrix,QObject *parent,const char *name) + : Switcher(matrix,parent,name) +{ + // + // Get Matrix Parameters + // + ross_inputs=matrix->inputs(); + ross_outputs=matrix->outputs(); + ross_breakaway=matrix->card()+1; + + // + // Initialize the TTY Port + // + RDTty *tty=new RDTty(rdstation->name(),matrix->port(RDMatrix::Primary)); + ross_device=new RDTTYDevice(); + if(tty->active()) { + ross_device->setName(tty->port()); + ross_device->setSpeed(tty->baudRate()); + ross_device->setWordLength(tty->dataBits()); + ross_device->setParity(tty->parity()); + ross_device->open(IO_Raw|IO_ReadWrite); + } + delete tty; +} + + +RossNkScp::~RossNkScp() +{ + delete ross_device; +} + + +RDMatrix::Type RossNkScp::type() +{ + return RDMatrix::RossNkScp; +} + + +unsigned RossNkScp::gpiQuantity() +{ + return 0; +} + + +unsigned RossNkScp::gpoQuantity() +{ + return 0; +} + + +bool RossNkScp::primaryTtyActive() +{ + return true; +} + + +bool RossNkScp::secondaryTtyActive() +{ + return false; +} + + +void RossNkScp::processCommand(RDMacro *cmd) +{ + char str[11]; + + switch(cmd->command()) { + case RDMacro::ST: + if((cmd->arg(1).toInt()<=0)||(cmd->arg(1).toInt()>ross_inputs)|| + (cmd->arg(2).toInt()<1)||(cmd->arg(2).toInt()>ross_outputs)) { + cmd->acknowledge(false); + emit rmlEcho(cmd); + return; + } + sprintf(str,"X%03d,%03d,%d\x0d",cmd->arg(2).toInt()-1, + cmd->arg(1).toInt()-1,ross_breakaway); + syslog(LOG_WARNING,"sent: %s\n",str); + ross_device->writeBlock(str,11); + cmd->acknowledge(true); + emit rmlEcho(cmd); + break; + + default: + cmd->acknowledge(false); + emit rmlEcho(cmd); + break; + } +} diff --git a/ripcd/rossnkscp.h b/ripcd/rossnkscp.h new file mode 100644 index 00000000..ad3dce86 --- /dev/null +++ b/ripcd/rossnkscp.h @@ -0,0 +1,55 @@ +// rossnkscp.h +// +// A Rivendell switcher driver for the Ross NK switchers via the SCP/A +// +// (C) Copyright 2015 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 ROSSNKSCP_H +#define ROSSNKSCP_H + +#include +#include +#include +#include + +#include + +#define ROSSNKSCP_MIN_GAIN -99 +#define ROSSNKSCP_MAX_GAIN 28 + +class RossNkScp : public Switcher +{ + Q_OBJECT + public: + RossNkScp(RDMatrix *matrix,QObject *parent=0,const char *name=0); + ~RossNkScp(); + RDMatrix::Type type(); + unsigned gpiQuantity(); + unsigned gpoQuantity(); + bool primaryTtyActive(); + bool secondaryTtyActive(); + void processCommand(RDMacro *cmd); + + private: + RDTTYDevice *ross_device; + int ross_inputs; + int ross_outputs; + int ross_breakaway; +}; + + +#endif // ROSSNKSCP_H