2016-05-18 Fred Gleason <fredg@paravelsystems.com>

* Added support for the RDCatchd 'DE' command in
	'rdcatchd/rdcatchd.cpp', 'rdcatchd/rdcatchd.h',
	'rdcatchd/event_player.cpp', 'rdcatchd/event_player.h' and
	'rdcatchd/local_macros.cpp'.
	* Added a deck event indicator to RDCatch's deck monitor in
	'rdcatch/deckmon.cpp' and 'rdcatch/deckmon.h'.
This commit is contained in:
Fred Gleason 2016-05-18 17:03:25 -04:00
parent 5190a8282b
commit d9023b1430
13 changed files with 152 additions and 69 deletions

View File

@ -15140,3 +15140,10 @@
* Implemented a 'Cut Event' ['CE'] RML. * Implemented a 'Cut Event' ['CE'] RML.
* Added a 'Event Carts' section to the Edit Deck dialog in * Added a 'Event Carts' section to the Edit Deck dialog in
'rdadmin/edit_deck.cpp' and 'rdadmin/edit_deck.h'. 'rdadmin/edit_deck.cpp' and 'rdadmin/edit_deck.h'.
2016-05-18 Fred Gleason <fredg@paravelsystems.com>
* Added support for the RDCatchd 'DE' command in
'rdcatchd/rdcatchd.cpp', 'rdcatchd/rdcatchd.h',
'rdcatchd/event_player.cpp', 'rdcatchd/event_player.h' and
'rdcatchd/local_macros.cpp'.
* Added a deck event indicator to RDCatch's deck monitor in
'rdcatch/deckmon.cpp' and 'rdcatch/deckmon.h'.

View File

@ -29,6 +29,9 @@ authentication.
PRIVILEDGED - a connection must be authenticated before these can be PRIVILEDGED - a connection must be authenticated before these can be
executed. executed.
DE <deck> <number>! -- Deck Event Processed
Sent by RDCatchd whenever a deck event is processed.
RD! -- Reload Deck List RD! -- Reload Deck List
Reload the record/play deck configuration. Rdcatchd will respond with RD Reload the record/play deck configuration. Rdcatchd will respond with RD
+!. +!.

View File

@ -263,6 +263,7 @@ void RDCatchConnect::DispatchCommand()
unsigned chan; unsigned chan;
int status; int status;
int id; int id;
int number;
if(!strcmp(args[0],"PW")) { // Password Response if(!strcmp(args[0],"PW")) { // Password Response
if(args[1][0]=='+') { if(args[1][0]=='+') {
@ -274,6 +275,16 @@ void RDCatchConnect::DispatchCommand()
} }
} }
if(!strcmp(args[0],"DE")) { // Deck Event
if(sscanf(args[1],"%d",&deck)!=1) {
return;
}
if(sscanf(args[2],"%d",&number)!=1) {
return;
}
emit deckEventSent(cc_serial,deck,number);
}
if(!strcmp(args[0],"RE")) { // Channel Status if(!strcmp(args[0],"RE")) { // Channel Status
if(sscanf(args[1],"%u",&chan)!=1){ if(sscanf(args[1],"%u",&chan)!=1){
return; return;

View File

@ -72,6 +72,7 @@ class RDCatchConnect : public QObject
void meterLevel(int serial,int deck,int chan,int level); void meterLevel(int serial,int deck,int chan,int level);
void eventUpdated(int id); void eventUpdated(int id);
void eventPurged(int id); void eventPurged(int id);
void deckEventSent(int serial,int chan,int number);
void heartbeatFailed(int id); void heartbeatFailed(int id);
private slots: private slots:

View File

@ -2,9 +2,7 @@
// //
// Monitor a Rivendell RDCatch Deck // Monitor a Rivendell RDCatch Deck
// //
// (C) Copyright 2002-2004 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2016 Fred Gleason <fredg@paravelsystems.com>
//
// $Id: deckmon.cpp,v 1.25 2010/07/29 19:32:36 cvs Exp $
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -29,9 +27,8 @@
#include <globals.h> #include <globals.h>
DeckMon::DeckMon(QString station,unsigned channel, DeckMon::DeckMon(QString station,unsigned channel,QWidget *parent)
QWidget *parent,const char *name) : QFrame(parent)
: QFrame(parent,name)
{ {
mon_station=station; mon_station=station;
mon_channel=channel; mon_channel=channel;
@ -47,11 +44,24 @@ DeckMon::DeckMon(QString station,unsigned channel,
small_font.setPixelSize(6); small_font.setPixelSize(6);
QFont label_font("Helvetica",12,QFont::Normal); QFont label_font("Helvetica",12,QFont::Normal);
label_font.setPixelSize(12); label_font.setPixelSize(12);
QFont event_font("Helvetica",12,QFont::Bold);
event_font.setPixelSize(12);
//
// Generate Palettes
//
mon_red_palette=palette();
mon_red_palette.setColor(QColorGroup::Background,Qt::darkRed);
mon_red_palette.setColor(QColorGroup::Foreground,Qt::white);
mon_dark_palette=palette();
mon_dark_palette.
setColor(QColorGroup::Background,palette().color(QPalette::Active,QColorGroup::Mid));
mon_dark_palette.setColor(QColorGroup::Foreground,Qt::white);
// //
// Station/Channel // Station/Channel
// //
mon_station_label=new QLabel(this,"mon_station_label"); mon_station_label=new QLabel(this);
mon_station_label->setFont(label_font); mon_station_label->setFont(label_font);
if((mon_channel>0)&&(mon_channel<(MAX_DECKS+1))) { if((mon_channel>0)&&(mon_channel<(MAX_DECKS+1))) {
mon_station_label-> mon_station_label->
@ -67,7 +77,7 @@ DeckMon::DeckMon(QString station,unsigned channel,
// //
// Monitor Button // Monitor Button
// //
mon_monitor_button=new QPushButton(this,"mon_monitor_button"); mon_monitor_button=new QPushButton(this);
mon_monitor_button->setFont(small_font); mon_monitor_button->setFont(small_font);
mon_monitor_button->setText(tr("MON")); mon_monitor_button->setText(tr("MON"));
mon_monitor_palette=new QPalette(QColor(BUTTON_MONITOR_FLASHING_COLOR), mon_monitor_palette=new QPalette(QColor(BUTTON_MONITOR_FLASHING_COLOR),
@ -81,7 +91,7 @@ DeckMon::DeckMon(QString station,unsigned channel,
// //
// Abort Button // Abort Button
// //
mon_abort_button=new QPushButton(this,"mon_abort_button"); mon_abort_button=new QPushButton(this);
mon_abort_button->setFont(small_font); mon_abort_button->setFont(small_font);
mon_abort_button->setText(tr("ABORT")); mon_abort_button->setText(tr("ABORT"));
mon_abort_button->setDisabled(true); mon_abort_button->setDisabled(true);
@ -90,25 +100,37 @@ DeckMon::DeckMon(QString station,unsigned channel,
// //
// Cut // Cut
// //
mon_cut_label=new QLabel(this,"mon_cut_label"); mon_cut_label=new QLabel(this);
mon_cut_label->setFont(label_font); mon_cut_label->setFont(label_font);
//
// Event Indicator
//
mon_event_label=new QLabel(this);
mon_event_label->setFont(event_font);
mon_event_label->setAlignment(Qt::AlignCenter);
mon_event_label->setFrameStyle(QFrame::Panel|QFrame::Sunken);
mon_event_label->setPalette(mon_dark_palette);
mon_event_label->setText("--");
mon_event_timer=new QTimer(this);
connect(mon_event_timer,SIGNAL(timeout()),this,SLOT(eventResetData()));
// //
// Status // Status
// //
mon_status_label=new QLabel(tr("OFFLINE"),this,"mon_status_label"); mon_status_label=new QLabel(tr("OFFLINE"),this);
mon_status_label->setFont(label_font); mon_status_label->setFont(label_font);
// //
// Audio Meter // Audio Meter
// //
mon_left_meter=new RDPlayMeter(RDSegMeter::Right,this,"mon_left_meter"); mon_left_meter=new RDPlayMeter(RDSegMeter::Right,this);
mon_left_meter->setMode(RDSegMeter::Peak); mon_left_meter->setMode(RDSegMeter::Peak);
mon_left_meter->setRange(-4600,-800); mon_left_meter->setRange(-4600,-800);
mon_left_meter->setHighThreshold(-1600); mon_left_meter->setHighThreshold(-1600);
mon_left_meter->setClipThreshold(-1100); mon_left_meter->setClipThreshold(-1100);
mon_left_meter->setLabel(tr("L")); mon_left_meter->setLabel(tr("L"));
mon_right_meter=new RDPlayMeter(RDSegMeter::Right,this,"mon_right_meter"); mon_right_meter=new RDPlayMeter(RDSegMeter::Right,this);
mon_right_meter->setMode(RDSegMeter::Peak); mon_right_meter->setMode(RDSegMeter::Peak);
mon_right_meter->setRange(-4600,-800); mon_right_meter->setRange(-4600,-800);
mon_right_meter->setHighThreshold(-1600); mon_right_meter->setHighThreshold(-1600);
@ -217,6 +239,15 @@ void DeckMon::setStatus(RDDeck::Status status,int id,const QString &cutname)
mon_abort_button->setEnabled(true); mon_abort_button->setEnabled(true);
break; break;
} }
mon_event_label->setText("--");
}
void DeckMon::setEvent(int number)
{
mon_event_label->setText(QString().sprintf("%d",number));
mon_event_label->setPalette(mon_red_palette);
mon_event_timer->start(1000,true);
} }
@ -244,13 +275,20 @@ void DeckMon::abortButtonData()
} }
void DeckMon::eventResetData()
{
mon_event_label->setPalette(mon_dark_palette);
}
void DeckMon::resizeEvent(QResizeEvent *e) void DeckMon::resizeEvent(QResizeEvent *e)
{ {
mon_station_label->setGeometry(10,10,150,12); mon_station_label->setGeometry(10,6,140,18);
mon_monitor_button->setGeometry(155,5,40,20); mon_monitor_button->setGeometry(155,5,40,20);
mon_abort_button->setGeometry(200,5,40,20); mon_abort_button->setGeometry(200,5,40,20);
mon_cut_label->setGeometry(260,10,e->size().width()-580,12); mon_cut_label->setGeometry(245,6,e->size().width()-595,18);
mon_status_label->setGeometry(e->size().width()-320,10,80,12); mon_event_label->setGeometry(e->size().width()-345,6,20,18);
mon_status_label->setGeometry(e->size().width()-320,6,80,18);
mon_left_meter->setGeometry(e->size().width()-235,6,225,10); mon_left_meter->setGeometry(e->size().width()-235,6,225,10);
mon_right_meter->setGeometry(e->size().width()-235,16,225,10); mon_right_meter->setGeometry(e->size().width()-235,16,225,10);
QFrame::resizeEvent(e); QFrame::resizeEvent(e);

View File

@ -2,9 +2,7 @@
// //
// Monitor a Rivendell Netcatcher Deck // Monitor a Rivendell Netcatcher Deck
// //
// (C) Copyright 2002-2004 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2016 Fred Gleason <fredg@paravelsystems.com>
//
// $Id: deckmon.h,v 1.15 2010/07/29 19:32:36 cvs Exp $
// //
// This program is free software; you can redistribute it and/or modify // 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 // it under the terms of the GNU General Public License version 2 as
@ -37,8 +35,7 @@ class DeckMon : public QFrame
{ {
Q_OBJECT Q_OBJECT
public: public:
DeckMon(QString station,unsigned channel, DeckMon(QString station,unsigned channel,QWidget *parent=0);
QWidget *parent=0,const char *name=0);
~DeckMon(); ~DeckMon();
QSize sizeHint() const; QSize sizeHint() const;
QSizePolicy sizePolicy() const; QSizePolicy sizePolicy() const;
@ -51,6 +48,7 @@ class DeckMon : public QFrame
public slots: public slots:
void setMonitor(bool state); void setMonitor(bool state);
void setStatus(RDDeck::Status status,int id,const QString &cutname); void setStatus(RDDeck::Status status,int id,const QString &cutname);
void setEvent(int number);
void setLeftMeter(int level); void setLeftMeter(int level);
void setRightMeter(int level); void setRightMeter(int level);
@ -64,11 +62,13 @@ class DeckMon : public QFrame
private slots: private slots:
void monitorButtonData(); void monitorButtonData();
void abortButtonData(); void abortButtonData();
void eventResetData();
private: private:
void SetCutInfo(int id,const QString &cutname); void SetCutInfo(int id,const QString &cutname);
QLabel *mon_station_label; QLabel *mon_station_label;
QLabel *mon_cut_label; QLabel *mon_cut_label;
QLabel *mon_event_label;
QLabel *mon_status_label; QLabel *mon_status_label;
QPushButton *mon_abort_button; QPushButton *mon_abort_button;
QPushButton *mon_monitor_button; QPushButton *mon_monitor_button;
@ -77,6 +77,9 @@ class DeckMon : public QFrame
RDPlayMeter *mon_right_meter; RDPlayMeter *mon_right_meter;
QString mon_station; QString mon_station;
unsigned mon_channel; unsigned mon_channel;
QTimer *mon_event_timer;
QPalette mon_red_palette;
QPalette mon_dark_palette;
}; };

View File

@ -296,6 +296,9 @@ MainWidget::MainWidget(QWidget *parent,const char *name)
connect(catch_connect[catch_station_count].connect, connect(catch_connect[catch_station_count].connect,
SIGNAL(eventPurged(int)), SIGNAL(eventPurged(int)),
this,SLOT(eventPurgedData(int))); this,SLOT(eventPurgedData(int)));
connect(catch_connect[catch_station_count].connect,
SIGNAL(deckEventSent(int,int,int)),
this,SLOT(deckEventSentData(int,int,int)));
connect(catch_connect[catch_station_count].connect, connect(catch_connect[catch_station_count].connect,
SIGNAL(heartbeatFailed(int)), SIGNAL(heartbeatFailed(int)),
this,SLOT(heartbeatFailedData(int))); this,SLOT(heartbeatFailedData(int)));
@ -1040,6 +1043,15 @@ void MainWidget::monitorChangedData(int serial,unsigned chan,bool state)
} }
void MainWidget::deckEventSentData(int serial,int chan,int number)
{
int mon=GetMonitor(serial,chan);
if(mon>=0) {
catch_monitor[mon]->deckMon()->setEvent(number);
}
}
void MainWidget::scrollButtonData() void MainWidget::scrollButtonData()
{ {
EnableScroll(!catch_scroll); EnableScroll(!catch_scroll);

View File

@ -83,6 +83,7 @@ class MainWidget : public QWidget
void statusChangedData(int,unsigned,RDDeck::Status,int, void statusChangedData(int,unsigned,RDDeck::Status,int,
const QString &cutname); const QString &cutname);
void monitorChangedData(int serial,unsigned chan,bool state); void monitorChangedData(int serial,unsigned chan,bool state);
void deckEventSentData(int serial,int chan,int number);
void scrollButtonData(); void scrollButtonData();
void reportsButtonData(); void reportsButtonData();
void headButtonData(); void headButtonData();

View File

@ -99,14 +99,12 @@ void EventPlayer::timeoutData()
// //
// Dispatch current event // Dispatch current event
// //
if(event_numbers[event_current_event]>=(int)event_deck_events.size()) { if(event_numbers[event_current_event]>(int)event_deck_events.size()) {
syslog(LOG_ERR,"playout cut event referenced non-existent deck event"); syslog(LOG_ERR,"playout cut event referenced non-existent deck event");
return; return;
} }
unsigned cartnum=event_deck_events[event_numbers[event_current_event]-1]; emit runCart(event_channel,event_numbers[event_current_event],
if(cartnum>0) { event_deck_events[event_numbers[event_current_event]-1]);
emit runCart(cartnum);
}
// //
// Set up next event // Set up next event

View File

@ -39,7 +39,7 @@ class EventPlayer : public QObject
void stop(); void stop();
signals: signals:
void runCart(unsigned cartnum); void runCart(int chan,int number,unsigned cartnum);
private slots: private slots:
void timeoutData(); void timeoutData();

View File

@ -64,6 +64,7 @@ void MainObject::RunLocalMacros(RDMacro *rml)
msecsTo(QTime::currentTime())); msecsTo(QTime::currentTime()));
q=new RDSqlQuery(sql); q=new RDSqlQuery(sql);
delete q; delete q;
SendDeckEvent(decknum+1,eventnum);
} }
} }
if(rml->echoRequested()) { if(rml->echoRequested()) {

View File

@ -338,8 +338,8 @@ MainObject::MainObject(QObject *parent,const char *name)
// //
for(unsigned i=0;i<MAX_DECKS;i++) { for(unsigned i=0;i<MAX_DECKS;i++) {
catch_playout_event_player[i]=new EventPlayer(catch_rdstation,i+129,this); catch_playout_event_player[i]=new EventPlayer(catch_rdstation,i+129,this);
connect(catch_playout_event_player[i],SIGNAL(runCart(unsigned)), connect(catch_playout_event_player[i],SIGNAL(runCart(int,int,unsigned)),
this,SLOT(runCartData(unsigned))); this,SLOT(runCartData(int,int,unsigned)));
} }
// //
@ -1057,13 +1057,14 @@ void MainObject::playUnloadedData(int handle)
} }
void MainObject::runCartData(unsigned cartnum) void MainObject::runCartData(int chan,int number,unsigned cartnum)
{ {
RDCart *cart=new RDCart(cartnum); RDCart *cart=new RDCart(cartnum);
if(cart->exists()&&(cart->type()==RDCart::Macro)) { if(cart->exists()&&(cart->type()==RDCart::Macro)) {
ExecuteMacroCart(cart); ExecuteMacroCart(cart);
} }
delete cart; delete cart;
SendDeckEvent(chan,number);
} }
@ -1567,6 +1568,12 @@ void MainObject::SendMeterLevel(int deck,short levels[2])
} }
void MainObject::SendDeckEvent(int deck,int number)
{
BroadcastCommand(QString().sprintf("DE %d %d!",deck,number));
}
void MainObject::ParseCommand(int ch) void MainObject::ParseCommand(int ch)
{ {
char buf[256]; char buf[256];

View File

@ -108,7 +108,7 @@ class MainObject : public QObject
void playingData(int handle); void playingData(int handle);
void playStoppedData(int handle); void playStoppedData(int handle);
void playUnloadedData(int handle); void playUnloadedData(int handle);
void runCartData(unsigned cartnum); void runCartData(int chan,int number,unsigned cartnum);
void meterData(); void meterData();
void eventFinishedData(int id); void eventFinishedData(int id);
void freeEventsData(); void freeEventsData();
@ -149,6 +149,7 @@ class MainObject : public QObject
bool ExecuteMacroCart(RDCart *cart,int id=-1,int event=-1); bool ExecuteMacroCart(RDCart *cart,int id=-1,int event=-1);
void SendFullStatus(int ch); void SendFullStatus(int ch);
void SendMeterLevel(int deck,short levels[2]); void SendMeterLevel(int deck,short levels[2]);
void SendDeckEvent(int deck,int number);
void ParseCommand(int); void ParseCommand(int);
void DispatchCommand(int); void DispatchCommand(int);
void KillSocket(int); void KillSocket(int);