2021-07-07 Fred Gleason <fredg@paravelsystems.com>

* Fixed a regression in sound panels that broke timer countdowns
	during play-out.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2021-07-07 14:14:59 -04:00
parent 0630d4b6a3
commit a597db41d1
2 changed files with 12 additions and 12 deletions

View File

@ -60,7 +60,7 @@ void RDPanelButton::clear()
button_active_length=0; button_active_length=0;
button_length[0]=0; button_length[0]=0;
button_length[1]=0; button_length[1]=0;
button_secs=-1; button_msecs=-1;
button_flashing=false; button_flashing=false;
button_flash_state=false; button_flash_state=false;
button_state=false; button_state=false;
@ -151,7 +151,7 @@ void RDPanelButton::setColor(QColor color)
button_flashing=true; button_flashing=true;
} }
} }
WriteKeycap(button_secs); WriteKeycap(button_msecs);
} }
@ -319,15 +319,15 @@ int RDPanelButton::duckVolume() const
void RDPanelButton::tickClock() void RDPanelButton::tickClock()
{ {
int secs; int msecs;
QTime current_time= QTime current_time=
QTime::currentTime().addMSecs(button_station->timeOffset()); QTime::currentTime().addMSecs(button_station->timeOffset());
if((button_start_time.isNull())||(current_time>button_end_time)|| 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; return;
} }
button_secs=secs; button_msecs=msecs;
WriteKeycap(secs); WriteKeycap(msecs);
} }
@ -338,7 +338,7 @@ void RDPanelButton::flashButton(bool state)
} }
button_flash_state=state; button_flash_state=state;
if(button_flashing&&button_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; QString text=button_text;
QPixmap *pix=new QPixmap(size().width()-2,size().height()-2); QPixmap *pix=new QPixmap(size().width()-2,size().height()-2);
@ -464,7 +464,7 @@ void RDPanelButton::WriteKeycap(int secs)
// Time Field & Output Text // Time Field & Output Text
// //
if(!button_text.isEmpty()) { if(!button_text.isEmpty()) {
if(secs<0) { if(msecs<0) {
p->setFont(smallTimerFont()); p->setFont(smallTimerFont());
if(button_pause_when_finished) { if(button_pause_when_finished) {
p->drawText(RDPANEL_BUTTON_MARGIN,size().height()-2-RDPANEL_BUTTON_MARGIN,"Finished"); p->drawText(RDPANEL_BUTTON_MARGIN,size().height()-2-RDPANEL_BUTTON_MARGIN,"Finished");
@ -484,7 +484,7 @@ void RDPanelButton::WriteKeycap(int secs)
} }
} }
else { else {
QString lenstr=RDGetTimeLength(1000*(1+secs),true,false); QString lenstr=RDGetTimeLength(1000+msecs,true,false);
p->drawText(size().width()-p->fontMetrics().width(lenstr)- p->drawText(size().width()-p->fontMetrics().width(lenstr)-
RDPANEL_BUTTON_MARGIN-2, RDPANEL_BUTTON_MARGIN-2,
size().height()-2-RDPANEL_BUTTON_MARGIN, size().height()-2-RDPANEL_BUTTON_MARGIN,

View File

@ -107,7 +107,7 @@ class RDPanelButton : public RDPushButton
QTime button_end_time; QTime button_end_time;
int button_length[2]; int button_length[2];
int button_active_length; int button_active_length;
int button_secs; int button_msecs;
RDStation *button_station; RDStation *button_station;
RDPlayDeck *button_play_deck; RDPlayDeck *button_play_deck;
int button_output; int button_output;