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

* Modified the buttons in the Button Log widget in rdairplay(1) to
	display channel labels when playing.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2021-07-03 12:36:17 -04:00
parent 21d35faa50
commit aa5238acf2
7 changed files with 42 additions and 32 deletions

View File

@@ -333,9 +333,11 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
//
air_cue_card=rda->airplayConf()->card(RDAirPlayConf::CueChannel);
air_cue_port=rda->airplayConf()->port(RDAirPlayConf::CueChannel);
QString labels[3];
for(int i=0;i<3;i++) {
air_meter_card[i]=rda->airplayConf()->card((RDAirPlayConf::Channel)i);
air_meter_port[i]=rda->airplayConf()->port((RDAirPlayConf::Channel)i);
labels[i]=rda->airplayConf()->portLabel((RDAirPlayConf::Channel)i);
cards[i]=rda->airplayConf()->card((RDAirPlayConf::Channel)i);
ports[i]=rda->airplayConf()->port((RDAirPlayConf::Channel)i);
start_rmls[i]=rda->airplayConf()->startRml((RDAirPlayConf::Channel)i);
@@ -347,23 +349,25 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
cards[1]=cards[0];
ports[1]=ports[0];
}
air_log[0]->setChannels(cards,ports,start_rmls,stop_rmls);
air_log[0]->setChannels(cards,ports,start_rmls,stop_rmls,labels);
for(int i=0;i<2;i++) {
cards[i]=rda->airplayConf()->card(RDAirPlayConf::AuxLog1Channel);
ports[i]=rda->airplayConf()->port(RDAirPlayConf::AuxLog1Channel);
labels[i]=rda->airplayConf()->portLabel(RDAirPlayConf::AuxLog1Channel);
start_rmls[i]=rda->airplayConf()->startRml(RDAirPlayConf::AuxLog1Channel);
stop_rmls[i]=rda->airplayConf()->stopRml(RDAirPlayConf::AuxLog1Channel);
}
air_log[1]->setChannels(cards,ports,start_rmls,stop_rmls);
air_log[1]->setChannels(cards,ports,labels,start_rmls,stop_rmls);
for(int i=0;i<2;i++) {
cards[i]=rda->airplayConf()->card(RDAirPlayConf::AuxLog2Channel);
ports[i]=rda->airplayConf()->port(RDAirPlayConf::AuxLog2Channel);
ports[i]=rda->airplayConf()->port(RDAirPlayConf::AuxLog2Channel);
start_rmls[i]=rda->airplayConf()->startRml(RDAirPlayConf::AuxLog2Channel);
stop_rmls[i]=rda->airplayConf()->stopRml(RDAirPlayConf::AuxLog2Channel);
}
air_log[2]->setChannels(cards,ports,start_rmls,stop_rmls);
air_log[2]->setChannels(cards,ports,labels,start_rmls,stop_rmls);
//
// Cart Picker

View File

@@ -32,12 +32,6 @@ StartButton::StartButton(bool allow_pause,QWidget *parent)
setFocusPolicy(Qt::NoFocus);
//
// Create Font
//
start_port_font=QFont(font().family(),20,QFont::Bold);
start_port_font.setPixelSize(20);
//
// Create Palettes
//
@@ -195,27 +189,27 @@ void StartButton::paintEvent(QPaintEvent *e)
if(start_mode!=StartButton::Disabled) {
p->setPen(QColor(Qt::color1));
p->setFont(labelFont());
p->drawText((geometry().width()-p->fontMetrics().width(start_title))/2,
p->drawText((w-p->fontMetrics().width(start_title))/2,
22,start_title);
p->drawLine(10,24,70,24);
if(!start_time.isNull()) {
if(start_time_mode==RDAirPlayConf::TwentyFourHour) {
p->drawText((geometry().width()-p->
p->drawText((w-p->
fontMetrics().width(start_time.toString("hh:mm:ss")))/2,
40,start_time.toString("hh:mm:ss"));
}
else {
p->drawText((geometry().width()-p->
p->drawText((w-p->
fontMetrics().width(start_time.toString("h:mm:ss ap")))/2,
40,start_time.toString("h:mm:ss ap"));
}
}
else {
p->drawText((geometry().width()-p->fontMetrics().width("--:--:--"))/2,
p->drawText((w-p->fontMetrics().width("--:--:--"))/2,
40,"--:--:--");
}
p->setFont(start_port_font);
p->drawText(15,70,start_port);
p->setFont(bigLabelFont());
p->drawText((w-p->fontMetrics().width(start_port))/2,70,start_port);
}
p->end();
delete p;

View File

@@ -42,9 +42,6 @@ class StartButton : public RDPushButton
private:
StartButton::Mode start_mode;
QFont start_label_font;
QFont start_counter_font;
QFont start_port_font;
QString start_title;
QString start_port;
QPalette start_stop_color;