2018-05-29 Fred Gleason <fredg@paravelsystems.com>

* Fixed a regression that caused meters to fail when rdvairplayd(8)
	was operated with invalid channel assignments.
This commit is contained in:
Fred Gleason 2018-05-29 19:12:21 +00:00
parent 954252fd62
commit b97f158435
14 changed files with 178 additions and 30 deletions

View File

@ -16917,3 +16917,6 @@
wildcards".
2018-05-29 Fred Gleason <fredg@paravelsystems.com>
* Merged pull request #000212, "Patches for building on Ubuntu 18.04".
2018-05-29 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression that caused meters to fail when rdvairplayd(8)
was operated with invalid channel assignments.

View File

@ -200,6 +200,13 @@ int RDLogPlay::port(int channum) const
}
bool RDLogPlay::channelsValid() const
{
return (play_card[0]>=0)&&(play_card[1]>=0)&&
(play_port[0]>=0)&&(play_port[1]>=0);
}
RDAirPlayConf::OpMode RDLogPlay::mode() const
{
return play_op_mode;
@ -305,10 +312,13 @@ void RDLogPlay::auditionStop()
bool RDLogPlay::play(int line,RDLogLine::StartSource src,
int mport,bool skip_meta)
int mport,bool skip_meta)
{
QTime current_time=QTime::currentTime();
RDLogLine *logline;
if(!channelsValid()) {
return false;
}
if((logline=logLine(line))==NULL) {
return false;
}
@ -1760,7 +1770,8 @@ void RDLogPlay::notificationReceivedData(RDNotification *notify)
bool RDLogPlay::StartEvent(int line,RDLogLine::TransType trans_type,
int trans_length,RDLogLine::StartSource src,int mport,int duck_length)
int trans_length,RDLogLine::StartSource src,
int mport,int duck_length)
{
int running;
int lines[TRANSPORT_QUANTITY];
@ -1772,6 +1783,9 @@ bool RDLogPlay::StartEvent(int line,RDLogLine::TransType trans_type,
int aport;
bool was_paused=false;
if(!channelsValid()) {
return false;
}
if((logline=logLine(line))==NULL) {
return false;
}
@ -2498,10 +2512,12 @@ void RDLogPlay::SetTransTimer(QTime current_time,bool stop)
RDLogLine *logline;
if(play_trans_timer->isActive()) {
if(stop)
play_trans_timer->stop();
else
if(stop) {
play_trans_timer->stop();
}
else {
return;
}
}
play_trans_line=-1;
for(int i=0;i<size();i++) {

View File

@ -61,6 +61,7 @@ class RDLogPlay : public QObject,public RDLogEvent
void setDefaultServiceName(const QString &svcname);
int card(int channum) const;
int port(int channum) const;
bool channelsValid() const;
RDAirPlayConf::OpMode mode() const;
void setOpMode(RDAirPlayConf::OpMode mode);
void setLogName(QString name);

View File

@ -378,7 +378,7 @@ MainWidget::MainWidget(QWidget *parent)
start_rmls[i]=rda->airplayConf()->startRml((RDAirPlayConf::Channel)i);
stop_rmls[i]=rda->airplayConf()->stopRml((RDAirPlayConf::Channel)i);
}
if(air_meter_card[1]<0) { // Fixup disabled main log port 2 playout
if((air_meter_card[1]<0)||(air_meter_port[1]<0)) { // Fixup disabled main log port 2 playout
air_meter_card[1]=air_meter_card[0];
air_meter_port[1]=air_meter_port[0];
cards[1]=cards[0];
@ -753,11 +753,13 @@ MainWidget::MainWidget(QWidget *parent)
}
air_log_button[0]->setText(tr("Main Log\n[--]"));
air_log_button[1]->setText(tr("Aux 1 Log\n[--]"));
if(!rda->airplayConf()->showAuxButton(0)) {
if((!rda->airplayConf()->showAuxButton(0))||
(!air_log[1]->channelsValid())) {
air_log_button[1]->hide();
}
air_log_button[2]->setText(tr("Aux 2 Log\n[--]"));
if(!rda->airplayConf()->showAuxButton(1)) {
if((!rda->airplayConf()->showAuxButton(1))||
(!air_log[2]->channelsValid())) {
air_log_button[2]->hide();
}
@ -924,6 +926,14 @@ void MainWidget::ripcConnected(bool state)
rml.setAddress(addr);
rml.setEchoRequested(false);
//
// Check Channel Assignments
//
if(!air_log[0]->channelsValid()) {
QMessageBox::warning(this,"RDAirPlay - "+tr("Warning"),
tr("Main Log channel assignments are invalid!"));
}
//
// Get Onair Flag State
//

View File

@ -27,8 +27,6 @@ x11 {
SOURCES += list_log.cpp
SOURCES += list_logs.cpp
SOURCES += local_macros.cpp
SOURCES += log_play.cpp
SOURCES += log_traffic.cpp
SOURCES += loglinebox.cpp
SOURCES += mode_display.cpp
SOURCES += pie_counter.cpp
@ -47,8 +45,6 @@ x11 {
HEADERS += lib_listview.h
HEADERS += list_log.h
HEADERS += list_logs.h
HEADERS += log_play.h
HEADERS += log_traffic.h
HEADERS += loglinebox.h
HEADERS += mode_display.h
HEADERS += pie_counter.h

View File

@ -644,6 +644,14 @@ OBNOVEN</translation>
<source>Unknown command option</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Main Log channel assignments are invalid!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ModeDisplay</name>

View File

@ -644,6 +644,14 @@ AKTUALISIERT</translation>
<source>Unknown command option</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Main Log channel assignments are invalid!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ModeDisplay</name>

View File

@ -644,6 +644,14 @@ LISTA</translation>
<source>Unknown command option</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Main Log channel assignments are invalid!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ModeDisplay</name>

View File

@ -644,6 +644,14 @@ DU LOG</translation>
<source>Unknown command option</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Main Log channel assignments are invalid!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ModeDisplay</name>

View File

@ -654,6 +654,14 @@ LASTAR PÅ NYTT</translation>
<source>Unknown command option</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Main Log channel assignments are invalid!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ModeDisplay</name>

View File

@ -654,6 +654,14 @@ LASTAR PÅ NYTT</translation>
<source>Unknown command option</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Main Log channel assignments are invalid!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ModeDisplay</name>

View File

@ -650,6 +650,14 @@ LISTA</translation>
<source>Unknown command option</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Main Log channel assignments are invalid!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ModeDisplay</name>

View File

@ -80,10 +80,21 @@ void MainObject::rmlReceivedData(RDMacro *rml)
if(rml->argQuantity()==3) { // Start Log
if(rml->arg(2).toInt()<air_logs[index]->size()) {
if(rml->arg(2).toInt()>=0) { // Unconditional start
air_logs[index]->play(rml->arg(2).toInt(),RDLogLine::StartMacro);
rda->log(RDConfig::LogInfo,QString().
sprintf("started log machine %d at line %d",
rml->arg(0).toInt(),rml->arg(2).toInt()));
if(air_logs[index]->play(rml->arg(2).toInt(),RDLogLine::StartMacro)) {
rda->log(RDConfig::LogInfo,QString().
sprintf("started log machine %d at line %d",
rml->arg(0).toInt(),rml->arg(2).toInt()));
}
else {
rda->log(RDConfig::LogWarning,QString().
sprintf("1 log machine %d failed to start",
rml->arg(0).toInt()));
if(rml->echoRequested()) {
rml->acknowledge(false);
rda->ripc()->sendRml(rml);
}
return;
}
}
if(rml->arg(2).toInt()==-2) { // Start if trans type allows
// Find first non-running event
@ -100,10 +111,21 @@ void MainObject::rmlReceivedData(RDMacro *rml)
switch(logline->transType()) {
case RDLogLine::Play:
case RDLogLine::Segue:
air_logs[index]->play(0,RDLogLine::StartMacro);
rda->log(RDConfig::LogInfo,QString().
sprintf("started log machine %d at line 0",
rml->arg(0).toInt()));
if(air_logs[index]->play(0,RDLogLine::StartMacro)) {
rda->log(RDConfig::LogInfo,QString().
sprintf("started log machine %d at line 0",
rml->arg(0).toInt()));
}
else {
rda->log(RDConfig::LogWarning,QString().
sprintf("2 log machine %d failed to start",
rml->arg(0).toInt()));
if(rml->echoRequested()) {
rml->acknowledge(false);
rda->ripc()->sendRml(rml);
}
return;
}
break;
case RDLogLine::Stop:
@ -205,11 +227,19 @@ void MainObject::rmlReceivedData(RDMacro *rml)
return;
}
if(!air_logs[index]->running()) {
if(!air_logs[index]->play(rml->arg(1).toInt(),RDLogLine::StartMacro)) {
if(air_logs[index]->play(rml->arg(1).toInt(),RDLogLine::StartMacro)) {
rda->log(RDConfig::LogInfo,QString().
sprintf("started log machine %d at line %d",
rml->arg(0).toInt(),rml->arg(2).toInt()));
}
else {
rda->log(RDConfig::LogWarning,QString().
sprintf("3 log machine %d failed to start",
rml->arg(0).toInt()));
if(rml->echoRequested()) {
rml->acknowledge(false);
rda->ripc()->sendRml(rml);
}
}
return;
}
}
@ -313,18 +343,46 @@ void MainObject::rmlReceivedData(RDMacro *rml)
next_line=air_logs[index]->nextLine();
if(air_logs[index]->nextLine()>=0) {
if(rml->argQuantity()==1) {
air_logs[index]->
play(air_logs[index]->nextLine(),RDLogLine::StartMacro);
if(!air_logs[index]->
play(air_logs[index]->nextLine(),RDLogLine::StartMacro)) {
rda->log(RDConfig::LogWarning,QString().
sprintf("4 log machine %d failed to start",
rml->arg(0).toInt()));
if(rml->echoRequested()) {
rml->acknowledge(false);
rda->ripc()->sendRml(rml);
}
return;
}
}
else {
if(rml->argQuantity()==2) {
air_logs[index]->play(air_logs[index]->nextLine(),
RDLogLine::StartMacro,rml->arg(1).toInt()-1);
if(!air_logs[index]->play(air_logs[index]->nextLine(),
RDLogLine::StartMacro,
rml->arg(1).toInt()-1)) {
rda->log(RDConfig::LogWarning,QString().
sprintf("5 log machine %d failed to start",
rml->arg(0).toInt()));
if(rml->echoRequested()) {
rml->acknowledge(false);
rda->ripc()->sendRml(rml);
}
return;
}
}
else {
air_logs[index]->
play(air_logs[index]->nextLine(),RDLogLine::StartMacro,
rml->arg(1).toInt()-1,rml->arg(2).toInt());
if(!air_logs[index]->
play(air_logs[index]->nextLine(),RDLogLine::StartMacro,
rml->arg(1).toInt()-1,rml->arg(2).toInt())) {
rda->log(RDConfig::LogWarning,QString().
sprintf("6 log machine %d failed to start",
rml->arg(0).toInt()));
if(rml->echoRequested()) {
rml->acknowledge(false);
rda->ripc()->sendRml(rml);
}
return;
}
}
}
rda->log(RDConfig::LogInfo,QString().

View File

@ -150,9 +150,17 @@ MainObject::MainObject(QObject *parent)
int cards[2]={0,0};
cards[0]=rda->airplayConf()->virtualCard(i+RD_RDVAIRPLAY_LOG_BASE);
cards[1]=rda->airplayConf()->virtualCard(i+RD_RDVAIRPLAY_LOG_BASE);
if(rda->station()->cardDriver(cards[0])==RDStation::None) {
cards[0]=-1;
cards[1]=-1;
}
int ports[2]={0,0};
ports[0]=rda->airplayConf()->virtualPort(i+RD_RDVAIRPLAY_LOG_BASE);
ports[1]=rda->airplayConf()->virtualPort(i+RD_RDVAIRPLAY_LOG_BASE);
if((cards[0]<0)||(ports[0]>=rda->station()->cardOutputs(cards[0]))) {
ports[0]=-1;
ports[1]=-1;
}
QString start_rml[2]={"",""};
start_rml[0]=rda->airplayConf()->virtualStartRml(i+RD_RDVAIRPLAY_LOG_BASE);
start_rml[1]=rda->airplayConf()->virtualStartRml(i+RD_RDVAIRPLAY_LOG_BASE);
@ -199,7 +207,7 @@ MainObject::MainObject(QObject *parent)
//
air_exit_timer=new QTimer(this);
connect(air_exit_timer, SIGNAL(timeout()),this,SLOT(exitData()));
air_exit_timer->start(100);
air_exit_timer->start(1000);
::signal(SIGINT,SigHandler);
::signal(SIGTERM,SigHandler);
}