mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-08-07 07:39:33 +02:00
2022-10-31 Fred Gleason <fredg@paravelsystems.com>
* Removed vestigal support for the 'Reload Deck List' catch protocol command. * Removed vestigal support for the 'Reload Event List' catch protocol command. * Removed vestigal support for the 'Reload Event List' catch protocol command. * Removed vestigal support for the 'Reload Time Offset' catch protocol command. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
96dc57685c
commit
811cadfd4c
@ -23580,3 +23580,12 @@
|
||||
2022-10-30 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Refactored rdcatch(1) to use the notification mechanism instead of
|
||||
the 'PurgeEvent' command.
|
||||
2022-10-31 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Removed vestigal support for the 'Reload Deck List' catch
|
||||
protocol command.
|
||||
* Removed vestigal support for the 'Reload Event List' catch
|
||||
protocol command.
|
||||
* Removed vestigal support for the 'Reload Event List' catch
|
||||
protocol command.
|
||||
* Removed vestigal support for the 'Reload Time Offset' catch
|
||||
protocol command.
|
||||
|
@ -32,7 +32,6 @@ bin_PROGRAMS = nexgen_filter\
|
||||
panel_copy\
|
||||
rdcatch_copy\
|
||||
rivendell_filter\
|
||||
sas_filter\
|
||||
wings_filter
|
||||
|
||||
dist_nexgen_filter_SOURCES = nexgen_filter.cpp nexgen_filter.h
|
||||
@ -51,10 +50,6 @@ dist_rivendell_filter_SOURCES = rivendell_filter.cpp rivendell_filter.h
|
||||
nodist_rivendell_filter_SOURCES = moc_rivendell_filter.cpp
|
||||
rivendell_filter_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT5_LIBS@ @MUSICBRAINZ_LIBS@
|
||||
|
||||
dist_sas_filter_SOURCES = sas_filter.cpp sas_filter.h
|
||||
nodist_sas_filter_SOURCES = moc_sas_filter.cpp
|
||||
sas_filter_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT5_LIBS@ @MUSICBRAINZ_LIBS@
|
||||
|
||||
dist_wings_filter_SOURCES = wings_filter.cpp wings_filter.h
|
||||
nodist_wings_filter_SOURCES = moc_wings_filter.cpp
|
||||
wings_filter_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT5_LIBS@ @MUSICBRAINZ_LIBS@
|
||||
|
@ -1,246 +0,0 @@
|
||||
// sas_filter.cpp
|
||||
//
|
||||
// An RDCatch event import filter for the SAS64000
|
||||
//
|
||||
// (C) Copyright 2002-2021 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 free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.//
|
||||
// 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 <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
#include <rd.h>
|
||||
#include <rdapplication.h>
|
||||
#include <rddb.h>
|
||||
#include <rdescape_string.h>
|
||||
|
||||
#include "sas_filter.h"
|
||||
|
||||
MainObject::MainObject(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
QString err_msg;
|
||||
|
||||
//
|
||||
// Open the Database
|
||||
//
|
||||
rda=new RDApplication("sas_filter","sas_filter",SAS_FILTER_USAGE,this);
|
||||
if(!rda->open(&err_msg)) {
|
||||
fprintf(stderr,"sas_filter: %s\n",err_msg.toUtf8().constData());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
//
|
||||
// RIPCD Connection
|
||||
//
|
||||
rda->ripc()->connectHost("localhost",RIPCD_TCP_PORT,rda->config()->password());
|
||||
|
||||
//
|
||||
// RDCatchd Connection
|
||||
//
|
||||
filter_connect=new RDCatchConnect(0,this);
|
||||
filter_connect->connectHost("localhost",RDCATCHD_TCP_PORT,
|
||||
rda->config()->password());
|
||||
|
||||
//
|
||||
// Read Switches
|
||||
//
|
||||
if((qApp->arguments().size()==2)&& // Delete List
|
||||
(qApp->arguments().at(1)=="-d")) {
|
||||
DeleteList();
|
||||
filter_connect->reset();
|
||||
exit(0);
|
||||
}
|
||||
if((qApp->arguments().size()==3)&& // Insert List
|
||||
(qApp->arguments().at(1)=="-i")) {
|
||||
InsertList();
|
||||
filter_connect->reset();
|
||||
exit(0);
|
||||
}
|
||||
fprintf(stderr,"\nsas_filter %s\n",SAS_FILTER_USAGE);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
void MainObject::InsertList()
|
||||
{
|
||||
char line[256];
|
||||
int count=0;
|
||||
|
||||
FILE *fh=fopen(qApp->arguments().at(2).toUtf8(),"r");
|
||||
if(fh==NULL) {
|
||||
perror("sas_filter");
|
||||
exit(1);
|
||||
}
|
||||
printf("Importing events from %s...",
|
||||
qApp->arguments().at(2).toUtf8().constData());
|
||||
fflush(0);
|
||||
while(fgets(line,256,fh)!=NULL) {
|
||||
if(strlen(line)==79) {
|
||||
InjectLine(line);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
printf("done.\n");
|
||||
fclose(fh);
|
||||
printf("Imported %d switch events, %d macro events, %d total.\n",
|
||||
filter_switch_count,filter_macro_count,
|
||||
filter_switch_count+filter_macro_count);
|
||||
}
|
||||
|
||||
|
||||
void MainObject::DeleteList()
|
||||
{
|
||||
QString sql="delete from RECORDINGS";
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
filter_connect->reset();
|
||||
printf("RDCatch events list deleted!\n");
|
||||
}
|
||||
|
||||
|
||||
void MainObject::InjectLine(char *line)
|
||||
{
|
||||
QString temp;
|
||||
int input=0;
|
||||
int output=0;
|
||||
int gpo=0;
|
||||
|
||||
//
|
||||
// Initialize the SQL clause
|
||||
//
|
||||
QString base_sql=QString("insert into `RECORDINGS` set ")+
|
||||
"`STATION_NAME`='"+RDEscapeString(rda->config()->sasStation())+"',"+
|
||||
QString::asprintf("`CHANNEL`=%d,",rda->config()->sasMatrix());
|
||||
|
||||
//
|
||||
// Day of the week fields
|
||||
//
|
||||
if(line[0]=='X') {
|
||||
base_sql+="`MON`='Y',";
|
||||
}
|
||||
if(line[1]=='X') {
|
||||
base_sql+="`TUE`='Y',";
|
||||
}
|
||||
if(line[2]=='X') {
|
||||
base_sql+="`WED`='Y',";
|
||||
}
|
||||
if(line[3]=='X') {
|
||||
base_sql+="`THU`='Y',";
|
||||
}
|
||||
if(line[4]=='X') {
|
||||
base_sql+="`FRI`='Y',";
|
||||
}
|
||||
if(line[5]=='X') {
|
||||
base_sql+="`SAT`='Y',";
|
||||
}
|
||||
if(line[6]=='X') {
|
||||
base_sql+="`SUN`='Y',";
|
||||
}
|
||||
|
||||
//
|
||||
// Time
|
||||
//
|
||||
line[17]=0;
|
||||
base_sql+=QString::asprintf("`START_TIME`='%s',",line+9);
|
||||
|
||||
//
|
||||
// Title
|
||||
//
|
||||
line[60]=0;
|
||||
temp=QString(line+19).trimmed();
|
||||
base_sql+=QString("`DESCRIPTION`='")+RDEscapeString(temp)+"',";
|
||||
|
||||
//
|
||||
// Active Flag
|
||||
//
|
||||
if(line[77]=='I') {
|
||||
base_sql+="`IS_ACTIVE`='N',";
|
||||
}
|
||||
|
||||
//
|
||||
// Output
|
||||
//
|
||||
line[65]=0;
|
||||
sscanf(line+62,"%d",&output);
|
||||
|
||||
//
|
||||
// Input
|
||||
//
|
||||
line[70]=0;
|
||||
sscanf(line+67,"%d",&input);
|
||||
|
||||
//
|
||||
// GPO
|
||||
//
|
||||
line[75]=0;
|
||||
sscanf(line+73,"%d",&gpo);
|
||||
|
||||
if((input>0)&&(output>0)) {
|
||||
InjectSwitchEvent(base_sql,input,output);
|
||||
}
|
||||
if(gpo>0) {
|
||||
InjectCartEvent(base_sql,gpo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainObject::InjectSwitchEvent(QString sql,int input,int output)
|
||||
{
|
||||
//
|
||||
// Event Type
|
||||
//
|
||||
sql+="TYPE=2,";
|
||||
|
||||
//
|
||||
// Input and Output
|
||||
//
|
||||
sql+=QString::asprintf("`SWITCH_INPUT`=%d,`SWITCH_OUTPUT`=%d",input,output);
|
||||
RDSqlQuery::apply(sql);
|
||||
filter_switch_count++;
|
||||
}
|
||||
|
||||
|
||||
void MainObject::InjectCartEvent(QString sql,int gpo)
|
||||
{
|
||||
//
|
||||
// Event Type
|
||||
//
|
||||
sql+="`TYPE`=1,";
|
||||
|
||||
//
|
||||
// Macro Cart
|
||||
//
|
||||
sql+=QString::asprintf("`MACRO_CART`=%d",gpo+rda->config()->sasBaseCart());
|
||||
filter_macro_count++;
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
// printf("SQL: %s\n",(const char *)sql);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
QApplication a(argc,argv,false);
|
||||
new MainObject(NULL);
|
||||
return a.exec();
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
// sas_filter.h
|
||||
//
|
||||
// An RDCatch event import filter for the SAS64000
|
||||
//
|
||||
// (C) Copyright 2002-2004,2018 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 SAS_FILTER_H
|
||||
#define SAS_FILTER_H
|
||||
|
||||
#include <qobject.h>
|
||||
|
||||
#include <rdcatch_connect.h>
|
||||
|
||||
#define SAS_FILTER_USAGE "-d|-i <insert-list>\n"
|
||||
|
||||
class MainObject : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MainObject(QObject *parent=0);
|
||||
|
||||
private:
|
||||
void InsertList();
|
||||
void DeleteList();
|
||||
void InjectLine(char *line);
|
||||
void InjectSwitchEvent(QString sql,int input,int output);
|
||||
void InjectCartEvent(QString sql,int gpo);
|
||||
RDCatchConnect *filter_connect;
|
||||
int filter_switch_count;
|
||||
int filter_macro_count;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@ -106,30 +106,6 @@ void RDCatchConnect::reloadDropboxes()
|
||||
}
|
||||
|
||||
|
||||
void RDCatchConnect::reset()
|
||||
{
|
||||
SendCommand("RS!");
|
||||
}
|
||||
|
||||
|
||||
void RDCatchConnect::reload()
|
||||
{
|
||||
SendCommand("RD!");
|
||||
}
|
||||
|
||||
|
||||
void RDCatchConnect::refresh()
|
||||
{
|
||||
SendCommand("RE 0!");
|
||||
}
|
||||
|
||||
|
||||
void RDCatchConnect::reloadOffset()
|
||||
{
|
||||
SendCommand("RO!");
|
||||
}
|
||||
|
||||
|
||||
void RDCatchConnect::stop(int deck)
|
||||
{
|
||||
SendCommand(QString::asprintf("SR %d!",deck));
|
||||
|
@ -50,10 +50,6 @@ class RDCatchConnect : public QObject
|
||||
void reloadDropboxes();
|
||||
|
||||
public slots:
|
||||
void reset();
|
||||
void reload();
|
||||
void refresh();
|
||||
void reloadOffset();
|
||||
void stop(int deck);
|
||||
void monitor(int deck,bool state);
|
||||
void toggleMonitor(int deck);
|
||||
|
@ -691,7 +691,6 @@ void EditStation::okData()
|
||||
station_station->setHttpStation(station_http_station_box->currentText());
|
||||
station_station->setCaeStation(station_cae_station_box->currentText());
|
||||
station_catch_connect->reloadHeartbeat();
|
||||
station_catch_connect->reloadOffset();
|
||||
|
||||
//
|
||||
// Allow the event loop to run so the packets get delivered
|
||||
@ -728,7 +727,6 @@ void EditStation::editDeckData()
|
||||
{
|
||||
EditDecks *edit_conf=new EditDecks(station_station,station_cae_station,this);
|
||||
if(edit_conf->exec()==0) {
|
||||
station_catch_connect->reload();
|
||||
}
|
||||
delete edit_conf;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user