From a597db41d11ac8e57972454ead29f75350d72a09 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Wed, 7 Jul 2021 14:14:59 -0400 Subject: [PATCH] 2021-07-07 Fred Gleason * Fixed a regression in sound panels that broke timer countdowns during play-out. Signed-off-by: Fred Gleason --- lib/rdpanel_button.cpp | 22 +++++++++++----------- lib/rdpanel_button.h | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/rdpanel_button.cpp b/lib/rdpanel_button.cpp index b633a830..79f9280f 100644 --- a/lib/rdpanel_button.cpp +++ b/lib/rdpanel_button.cpp @@ -60,7 +60,7 @@ void RDPanelButton::clear() button_active_length=0; button_length[0]=0; button_length[1]=0; - button_secs=-1; + button_msecs=-1; button_flashing=false; button_flash_state=false; button_state=false; @@ -151,7 +151,7 @@ void RDPanelButton::setColor(QColor color) button_flashing=true; } } - WriteKeycap(button_secs); + WriteKeycap(button_msecs); } @@ -319,15 +319,15 @@ int RDPanelButton::duckVolume() const void RDPanelButton::tickClock() { - int secs; + int msecs; QTime current_time= QTime::currentTime().addMSecs(button_station->timeOffset()); if((button_start_time.isNull())||(current_time>button_end_time)|| - ((secs=current_time.secsTo(button_end_time))==button_secs)) { + ((msecs=current_time.msecsTo(button_end_time))==button_msecs)) { return; - } - button_secs=secs; - WriteKeycap(secs); + } + button_msecs=msecs; + WriteKeycap(msecs); } @@ -338,7 +338,7 @@ void RDPanelButton::flashButton(bool state) } button_flash_state=state; if(button_flashing&&button_state) { - WriteKeycap(button_secs); + WriteKeycap(button_msecs); } } @@ -422,7 +422,7 @@ void RDPanelButton::dropEvent(QDropEvent *e) } -void RDPanelButton::WriteKeycap(int secs) +void RDPanelButton::WriteKeycap(int msecs) { QString text=button_text; QPixmap *pix=new QPixmap(size().width()-2,size().height()-2); @@ -464,7 +464,7 @@ void RDPanelButton::WriteKeycap(int secs) // Time Field & Output Text // if(!button_text.isEmpty()) { - if(secs<0) { + if(msecs<0) { p->setFont(smallTimerFont()); if(button_pause_when_finished) { p->drawText(RDPANEL_BUTTON_MARGIN,size().height()-2-RDPANEL_BUTTON_MARGIN,"Finished"); @@ -484,7 +484,7 @@ void RDPanelButton::WriteKeycap(int secs) } } else { - QString lenstr=RDGetTimeLength(1000*(1+secs),true,false); + QString lenstr=RDGetTimeLength(1000+msecs,true,false); p->drawText(size().width()-p->fontMetrics().width(lenstr)- RDPANEL_BUTTON_MARGIN-2, size().height()-2-RDPANEL_BUTTON_MARGIN, diff --git a/lib/rdpanel_button.h b/lib/rdpanel_button.h index 4977f805..3f16fd3e 100644 --- a/lib/rdpanel_button.h +++ b/lib/rdpanel_button.h @@ -107,7 +107,7 @@ class RDPanelButton : public RDPushButton QTime button_end_time; int button_length[2]; int button_active_length; - int button_secs; + int button_msecs; RDStation *button_station; RDPlayDeck *button_play_deck; int button_output;