mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-16 15:41:13 +02:00
2022-11-01 Fred Gleason <fredg@paravelsystems.com>
* Refactored rdcatch(1) to use the notification mechanism instead of the 'Input Monitor State' catch command. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -29,6 +29,7 @@ DeckMon::DeckMon(QString station,unsigned channel,QWidget *parent)
|
||||
{
|
||||
mon_station=station;
|
||||
mon_channel=channel;
|
||||
mon_monitor_state=false;
|
||||
|
||||
setFrameStyle(Box|Raised);
|
||||
setLineWidth(1);
|
||||
@@ -139,17 +140,6 @@ void DeckMon::enableMonitorButton(bool state)
|
||||
}
|
||||
|
||||
|
||||
void DeckMon::setMonitor(bool state)
|
||||
{
|
||||
if(state) {
|
||||
mon_monitor_button->setPalette(*mon_monitor_palette);
|
||||
}
|
||||
else {
|
||||
mon_monitor_button->setPalette(palette());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DeckMon::setStatus(RDDeck::Status status,int id,const QString &cutname)
|
||||
{
|
||||
if(id==0) {
|
||||
@@ -231,13 +221,38 @@ void DeckMon::setRightMeter(int level)
|
||||
void DeckMon::processCatchEvent(RDCatchEvent *evt)
|
||||
{
|
||||
if((evt->hostName()==mon_station)&&(evt->deckChannel()==mon_channel)) {
|
||||
if(evt->operation()==RDCatchEvent::DeckEventProcessedOp) {
|
||||
switch(evt->operation()) {
|
||||
case RDCatchEvent::DeckEventProcessedOp:
|
||||
mon_event_light->trigger(evt->eventNumber());
|
||||
}
|
||||
break;
|
||||
|
||||
if(evt->operation()==RDCatchEvent::DeckStatusResponseOp) {
|
||||
case RDCatchEvent::DeckStatusResponseOp:
|
||||
setStatus(evt->deckStatus(),evt->eventId(),
|
||||
RDCut::cutName(evt->cartNumber(),evt->cutNumber()));
|
||||
break;
|
||||
|
||||
case RDCatchEvent::SetInputMonitorResponseOp:
|
||||
if((evt->hostName()==mon_station)&&
|
||||
(evt->deckChannel()==mon_channel)&&
|
||||
(evt->inputMonitorActive()!=mon_monitor_state)) {
|
||||
mon_monitor_state=evt->inputMonitorActive();
|
||||
if(mon_monitor_state) {
|
||||
mon_monitor_button->setPalette(mon_red_palette);
|
||||
mon_monitor_button->setStyleSheet(mon_red_stylesheet);
|
||||
}
|
||||
else {
|
||||
mon_monitor_button->setPalette(palette());
|
||||
mon_monitor_button->setStyleSheet("");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case RDCatchEvent::DeckStatusQueryOp:
|
||||
case RDCatchEvent::StopDeckOp:
|
||||
case RDCatchEvent::SetInputMonitorOp:
|
||||
case RDCatchEvent::NullOp:
|
||||
case RDCatchEvent::LastOp:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -245,7 +260,15 @@ void DeckMon::processCatchEvent(RDCatchEvent *evt)
|
||||
|
||||
void DeckMon::monitorButtonData()
|
||||
{
|
||||
emit monitorClicked();
|
||||
RDCatchEvent *evt=new RDCatchEvent();
|
||||
|
||||
evt->setOperation(RDCatchEvent::SetInputMonitorOp);
|
||||
evt->setTargetHostName(mon_station);
|
||||
evt->setDeckChannel(mon_channel);
|
||||
evt->setInputMonitorActive(!mon_monitor_state);
|
||||
rda->ripc()->sendCatchEvent(evt);
|
||||
|
||||
delete evt;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Monitor a Rivendell Netcatcher Deck
|
||||
//
|
||||
// (C) Copyright 2002-2019 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
|
||||
@@ -42,16 +42,11 @@ class DeckMon : public RDFrame
|
||||
void enableMonitorButton(bool state);
|
||||
|
||||
public slots:
|
||||
void setMonitor(bool state);
|
||||
void setStatus(RDDeck::Status status,int id,const QString &cutname);
|
||||
void setLeftMeter(int level);
|
||||
void setRightMeter(int level);
|
||||
void processCatchEvent(RDCatchEvent *evt);
|
||||
|
||||
signals:
|
||||
void monitorClicked();
|
||||
// void abortClicked();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *e);
|
||||
|
||||
@@ -67,6 +62,7 @@ class DeckMon : public RDFrame
|
||||
QLabel *mon_status_label;
|
||||
QPushButton *mon_abort_button;
|
||||
QPushButton *mon_monitor_button;
|
||||
bool mon_monitor_state;
|
||||
QPalette *mon_monitor_palette;
|
||||
RDPlayMeter *mon_left_meter;
|
||||
RDPlayMeter *mon_right_meter;
|
||||
@@ -80,5 +76,5 @@ class DeckMon : public RDFrame
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif // DECKMON_H
|
||||
|
||||
|
@@ -181,10 +181,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
||||
catch_monitor_vbox->setSpacing(2);
|
||||
catch_monitor_area->setWidget(catch_monitor_vbox);
|
||||
|
||||
// QSignalMapper *mapper=new QSignalMapper(this);
|
||||
// connect(mapper,SIGNAL(mapped(int)),this,SLOT(abortData(int)));
|
||||
QSignalMapper *mon_mapper=new QSignalMapper(this);
|
||||
connect(mon_mapper,SIGNAL(mapped(int)),this,SLOT(monitorData(int)));
|
||||
QString sql;
|
||||
RDSqlQuery *q1;
|
||||
sql=QString("select `NAME`,`IPV4_ADDRESS` from `STATIONS` where ")+
|
||||
@@ -196,18 +192,12 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
||||
SIGNAL(statusChanged(int,unsigned,RDDeck::Status,int,const QString &)),
|
||||
this,
|
||||
SLOT(statusChangedData(int,unsigned,RDDeck::Status,int,const QString &)));
|
||||
connect(catch_connect.back()->connector(),
|
||||
SIGNAL(monitorChanged(int,unsigned,bool)),
|
||||
this,SLOT(monitorChangedData(int,unsigned,bool)));
|
||||
connect(catch_connect.back()->connector(),
|
||||
SIGNAL(connected(int,bool)),
|
||||
this,SLOT(connectedData(int,bool)));
|
||||
connect(catch_connect.back()->connector(),
|
||||
SIGNAL(meterLevel(int,int,int,int)),
|
||||
this,SLOT(meterLevelData(int,int,int,int)));
|
||||
connect(catch_connect.back()->connector(),
|
||||
SIGNAL(heartbeatFailed(int)),
|
||||
this,SLOT(heartbeatFailedData(int)));
|
||||
catch_connect.back()->connector()->
|
||||
connectHost(q->value(1).toString(),RDCATCHD_TCP_PORT,
|
||||
rda->config()->password());
|
||||
@@ -239,10 +229,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
||||
(rda->config()->stationName().toLower()==
|
||||
q->value(0).toString().toLower()));
|
||||
catch_monitor.back()->deckMon()->show();
|
||||
mon_mapper->setMapping(catch_monitor.back()->deckMon(),
|
||||
catch_monitor.size()-1);
|
||||
connect(catch_monitor.back()->deckMon(),SIGNAL(monitorClicked()),
|
||||
mon_mapper,SLOT(map()));
|
||||
}
|
||||
delete q1;
|
||||
}
|
||||
@@ -761,16 +747,6 @@ void MainWidget::statusChangedData(int serial,unsigned chan,
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::monitorChangedData(int serial,unsigned chan,bool state)
|
||||
{
|
||||
// printf("monitorChangedData(%d,%u,%d)\n",serial,chan,state);
|
||||
int mon=GetMonitor(serial,chan);
|
||||
if(mon>=0) {
|
||||
catch_monitor[mon]->deckMon()->setMonitor(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::catchEventReceivedData(RDCatchEvent *evt)
|
||||
{
|
||||
// printf("catchEventReceivedData()\n");
|
||||
@@ -789,6 +765,8 @@ void MainWidget::catchEventReceivedData(RDCatchEvent *evt)
|
||||
case RDCatchEvent::DeckEventProcessedOp:
|
||||
case RDCatchEvent::DeckStatusQueryOp:
|
||||
case RDCatchEvent::StopDeckOp:
|
||||
case RDCatchEvent::SetInputMonitorOp:
|
||||
case RDCatchEvent::SetInputMonitorResponseOp:
|
||||
case RDCatchEvent::NullOp:
|
||||
case RDCatchEvent::LastOp:
|
||||
break;
|
||||
@@ -942,13 +920,6 @@ void MainWidget::meterLevelData(int serial,int deck,int l_r,int level)
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::monitorData(int id)
|
||||
{
|
||||
catch_connect[catch_monitor[id]->serialNumber()]->connector()->
|
||||
toggleMonitor(catch_monitor[id]->channelNumber());
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::selectionChangedData(const QItemSelection &before,
|
||||
const QItemSelection &after)
|
||||
{
|
||||
@@ -1000,17 +971,6 @@ void MainWidget::eventUpdatedData(int id)
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::heartbeatFailedData(int id)
|
||||
{
|
||||
if(!catch_host_warnings) {
|
||||
return;
|
||||
}
|
||||
QString msg=tr("Control connection timed out to host")+
|
||||
" `"+catch_connect[id]->stationName()+"'?";
|
||||
QMessageBox::warning(this,"RDCatch - "+tr("Connection Error"),msg);
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::quitMainWidget()
|
||||
{
|
||||
catch_db->removeDatabase(rda->config()->mysqlDbname());
|
||||
|
@@ -81,8 +81,6 @@ class MainWidget : public RDMainWindow
|
||||
void ripcUserData();
|
||||
void statusChangedData(int,unsigned,RDDeck::Status,int,
|
||||
const QString &cutname);
|
||||
void monitorChangedData(int serial,unsigned chan,bool state);
|
||||
// void deckEventSentData(int serial,int chan,int number);
|
||||
void catchEventReceivedData(RDCatchEvent *evt);
|
||||
void scrollButtonData();
|
||||
void reportsButtonData();
|
||||
@@ -93,8 +91,6 @@ class MainWidget : public RDMainWindow
|
||||
void playedData(int);
|
||||
void playStoppedData(int);
|
||||
void meterLevelData(int,int,int,int);
|
||||
// void abortData(int);
|
||||
void monitorData(int);
|
||||
void selectionChangedData(const QItemSelection &before,
|
||||
const QItemSelection &after);
|
||||
void doubleClickedData(const QModelIndex &index);
|
||||
@@ -103,7 +99,6 @@ class MainWidget : public RDMainWindow
|
||||
void clockData();
|
||||
void midnightData();
|
||||
void eventUpdatedData(int id);
|
||||
void heartbeatFailedData(int id);
|
||||
void quitMainWidget();
|
||||
|
||||
protected:
|
||||
|
Reference in New Issue
Block a user