mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-12-05 08:10:21 +01:00
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:
@@ -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 ¬ify)
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user