2022-10-28 Fred Gleason <fredg@paravelsystems.com>

* Added an 'RDCatchEvent' class.
	* Reimplemented the 'Deck Event Processed' command using
	'RDCatchEvent'.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2022-10-28 09:26:37 -04:00
parent 751600dd5d
commit d38349cf39
21 changed files with 863 additions and 153 deletions

View File

@@ -2,7 +2,7 @@
//
// Connection to the Rivendell Interprocess Communication Daemon
//
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2022 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
@@ -147,6 +147,13 @@ void RDRipc::sendNotification(const RDNotification &notify)
}
void RDRipc::sendCatchEvent(RDCatchEvent *evt)
{
SendCommand("ON "+evt->write()+"!");
rda->syslog(LOG_NOTICE,"sent catch event: %s\n",evt->write().toUtf8().constData());
}
void RDRipc::sendOnairFlag()
{
SendCommand(QString::asprintf("TA %d!",ripc_onair_flag));
@@ -406,12 +413,24 @@ void RDRipc::DispatchCommand()
msg+=QString(cmds[i])+" ";
}
msg=msg.left(msg.length()-1);
RDNotification *notify=new RDNotification();
if(!notify->read(msg)) {
QStringList f0=msg.split(" ",QString::SkipEmptyParts);
if(f0.at(0)=="NOTIFY") {
RDNotification *notify=new RDNotification();
if(!notify->read(msg)) {
delete notify;
return;
}
emit notificationReceived(notify);
delete notify;
return;
}
emit notificationReceived(notify);
delete notify;
if(f0.at(0)=="CATCH") {
RDCatchEvent *evt=new RDCatchEvent();
if(!evt->read(msg)) {
delete evt;
return;
}
emit catchEventReceived(evt);
delete evt;
}
}
}