From 5d3f321377190c5be6425075af3e5c78ab336b63 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Mon, 14 Aug 2023 10:43:14 -0400 Subject: [PATCH] 2023-08-14 Fred Gleason * Fixed a bug in rdvairplayd(8) that caused virtual logs to fail to process 'Load Log' ['LL'], 'Set Duck Level' ['MD'] and 'Stop' ['PS] RMLs with a 'mach' parameter of '0'. Signed-off-by: Fred Gleason --- ChangeLog | 4 ++++ rdvairplayd/local_macros.cpp | 21 ++++++++++----------- rdvairplayd/rdvairplayd.h | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index aaa312e6..8d824656 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24339,3 +24339,7 @@ * Incremented the package version to 4.0.2int1. 2023-08-09 Fred Gleason * Incremented the package version to 4.1.0. +2023-08-14 Fred Gleason + * Fixed a bug in rdvairplayd(8) that caused virtual logs to fail + to process 'Load Log' ['LL'], 'Set Duck Level' ['MD'] and 'Stop' ['PS] + RMLs with a 'mach' parameter of '0'. diff --git a/rdvairplayd/local_macros.cpp b/rdvairplayd/local_macros.cpp index a1c6f1c6..27446730 100644 --- a/rdvairplayd/local_macros.cpp +++ b/rdvairplayd/local_macros.cpp @@ -34,7 +34,6 @@ void MainObject::rmlReceivedData(RDMacro *rml) int fade; RDLogLine *logline=NULL; int index=-1; - bool all_logs=false; int start; int end; int next_line; @@ -392,8 +391,8 @@ void MainObject::rmlReceivedData(RDMacro *rml) } return; } - index=LogMachineIndex(rml->arg(0).toInt(),&all_logs); - if((index<0)&(!all_logs)) { + index=LogMachineIndex(rml->arg(0).toInt()); + if(index<0) { if(rml->echoRequested()) { rml->acknowledge(false); rda->ripc()->sendRml(rml); @@ -404,7 +403,7 @@ void MainObject::rmlReceivedData(RDMacro *rml) if(rml->argQuantity()>1) { fade=rml->arg(1).toInt(); } - if(all_logs) { + if(index==0) { for(int i=0;istop(true,0,fade); } @@ -434,15 +433,15 @@ void MainObject::rmlReceivedData(RDMacro *rml) } return; } - index=LogMachineIndex(rml->arg(0).toInt(),&all_logs); - if((index<0)&&(!all_logs)) { + index=LogMachineIndex(rml->arg(0).toInt()); + if(index<0) { if(rml->echoRequested()) { rml->acknowledge(false); rda->ripc()->sendRml(rml); } return; } - if(all_logs) { + if(index==0) { for(int i=0;iduckVolume(rml->arg(1).toInt()*100,rml->arg(2).toInt()); } @@ -590,14 +589,14 @@ void MainObject::rmlReceivedData(RDMacro *rml) } -int MainObject::LogMachineIndex(int log_mach,bool *all) const +int MainObject::LogMachineIndex(int log_mach) const { + if(log_mach==0) { + return 0; + } if((log_mach<=RD_RDVAIRPLAY_LOG_BASE)|| (log_mach>RD_RDVAIRPLAY_LOG_BASE+RD_RDVAIRPLAY_LOG_QUAN)) { return -1; } - if(all!=NULL) { - *all=log_mach-RD_RDVAIRPLAY_LOG_BASE==0; - } return log_mach-RD_RDVAIRPLAY_LOG_BASE-1; } diff --git a/rdvairplayd/rdvairplayd.h b/rdvairplayd/rdvairplayd.h index 1abe4bda..95f3613b 100644 --- a/rdvairplayd/rdvairplayd.h +++ b/rdvairplayd/rdvairplayd.h @@ -47,7 +47,7 @@ class MainObject : public QObject void SetAutoMode(int index); void SetLiveAssistMode(int index); void SetManualMode(int index); - int LogMachineIndex(int log_mach,bool *all=NULL) const; + int LogMachineIndex(int log_mach) const; RDLogPlay *air_logs[RD_RDVAIRPLAY_LOG_QUAN]; QString air_start_lognames[RD_RDVAIRPLAY_LOG_QUAN]; int air_start_lines[RD_RDVAIRPLAY_LOG_QUAN];