2025-04-26 Fred Gleason <fredg@paravelsystems.com>

* Cleaned up compiler warnings in 'rdairplay/'.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2025-04-26 17:08:58 -04:00
parent 868e0fb559
commit 0a1844d19e
10 changed files with 50 additions and 61 deletions

View File

@ -24988,3 +24988,5 @@
* Cleaned up compiler warnings in 'importers/'. * Cleaned up compiler warnings in 'importers/'.
2025-04-26 Fred Gleason <fredg@paravelsystems.com> 2025-04-26 Fred Gleason <fredg@paravelsystems.com>
* Cleaned up compiler warnings in 'rdadmin/'. * Cleaned up compiler warnings in 'rdadmin/'.
2025-04-26 Fred Gleason <fredg@paravelsystems.com>
* Cleaned up compiler warnings in 'rdairplay/'.

View File

@ -2,7 +2,7 @@
// //
// The button log widget for RDAirPlay // The button log widget for RDAirPlay
// //
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as // it under the terms of the GNU General Public License version 2 as
@ -72,24 +72,14 @@ ButtonLog::ButtonLog(RDLogPlay *log,int id,RDAirPlayConf *conf,bool allow_pause,
QSignalMapper *mapper=new QSignalMapper(this); QSignalMapper *mapper=new QSignalMapper(this);
connect(mapper,SIGNAL(mapped(int)), connect(mapper,SIGNAL(mapped(int)),
this,SLOT(startButton(int))); this,SLOT(startButton(int)));
for(int i=0;i<BUTTON_PLAY_BUTTONS;i++) { for(int i=0;i<BUTTON_TOTAL_BUTTONS;i++) {
log_line_box[i]=new LogLineBox(conf,this); log_line_box[i]=new LogLineBox(conf,this);
if(i<BUTTON_PLAY_BUTTONS) {
log_line_box[i]->setMode(LogLineBox::Full); log_line_box[i]->setMode(LogLineBox::Full);
log_line_box[i]->setAcceptDrops(rda->station()->enableDragdrop());
log_line_box[i]->setAllowDrags(rda->station()->enableDragdrop());
connect(log_line_box[i],SIGNAL(doubleClicked(int)),
this,SLOT(boxDoubleClickedData(int)));
connect(log_line_box[i],SIGNAL(cartDropped(int,RDLogLine *)),
this,SLOT(cartDroppedData(int,RDLogLine *)));
log_start_button[i]=new StartButton(allow_pause,this);
mapper->setMapping(log_start_button[i],i);
connect(log_start_button[i],SIGNAL(clicked()),
mapper,SLOT(map()));
} }
else {
for(int i=BUTTON_PLAY_BUTTONS;i<BUTTON_TOTAL_BUTTONS;i++) {
log_line_box[i]=new LogLineBox(conf,this);
log_line_box[i]->setMode(LogLineBox::Half); log_line_box[i]->setMode(LogLineBox::Half);
}
log_line_box[i]->setAcceptDrops(rda->station()->enableDragdrop()); log_line_box[i]->setAcceptDrops(rda->station()->enableDragdrop());
log_line_box[i]->setAllowDrags(rda->station()->enableDragdrop()); log_line_box[i]->setAllowDrags(rda->station()->enableDragdrop());
connect(log_line_box[i],SIGNAL(doubleClicked(int)), connect(log_line_box[i],SIGNAL(doubleClicked(int)),
@ -716,8 +706,7 @@ void ButtonLog::UpdateButtons()
} }
} }
else { else {
log_start_button[i]-> log_start_button[i]->setMode(StartButton::Disabled,RDCart::All);
setMode(StartButton::Disabled,logline->cartType());
} }
} }
} }

View File

@ -2,7 +2,7 @@
// //
// On Air Playout Utility for Rivendell. // On Air Playout Utility for Rivendell.
// //
// (C) Copyright 2002-2022 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as // it under the terms of the GNU General Public License version 2 as
@ -835,7 +835,7 @@ void LogLineBox::mouseMoveEvent(QMouseEvent *e)
line_group_label->palette(). line_group_label->palette().
color(QPalette::Foreground)); color(QPalette::Foreground));
drag->setMimeData(cd); drag->setMimeData(cd);
drag->setPixmap(*(line_icon_label->pixmap())); drag->setPixmap(line_icon_label->pixmap((Qt::ReturnByValueConstant)0));
drag->exec(); drag->exec();
} }
} }

View File

@ -2,7 +2,7 @@
// //
// Message Widget for RDAirPlay Rivendell // Message Widget for RDAirPlay Rivendell
// //
// (C) Copyright 2024 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2024-2025 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as // it under the terms of the GNU General Public License version 2 as
@ -168,7 +168,7 @@ void MessageWidget::resizeEvent(QResizeEvent *e)
QFont MessageWidget::MessageFont(QString str) const QFont MessageWidget::MessageFont(QString str) const
{ {
for(int i=(MESSAGE_FONT_QUANTITY-1);i>=0;i--) { for(int i=(MESSAGE_FONT_QUANTITY-1);i>=0;i--) {
if(d_message_metrics[i]->width(str)<MESSAGE_WIDGET_WIDTH) { if(d_message_metrics[i]->horizontalAdvance(str)<MESSAGE_WIDGET_WIDTH) {
return d_message_fonts[i]; return d_message_fonts[i];
} }
} }

View File

@ -2,7 +2,7 @@
// //
// The mode display widget for RDAirPlay in Rivendell // The mode display widget for RDAirPlay in Rivendell
// //
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as // it under the terms of the GNU General Public License version 2 as
@ -101,10 +101,10 @@ void ModeDisplay::WriteMap()
p->setPen(QColor(Qt::color1)); p->setPen(QColor(Qt::color1));
p->setFont(subLabelFont()); p->setFont(subLabelFont());
p->drawText((sizeHint().width()-2-p->fontMetrics(). p->drawText((sizeHint().width()-2-p->fontMetrics().
width(tr("Operating Mode")))/2, horizontalAdvance(tr("Operating Mode")))/2,
22,tr("Operating Mode")); 22,tr("Operating Mode"));
p->setFont(bannerFont()); p->setFont(bannerFont());
p->drawText((sizeHint().width()-2-p->fontMetrics().width(tr("LiveAssist")))/2, p->drawText((sizeHint().width()-2-p->fontMetrics().horizontalAdvance(tr("LiveAssist")))/2,
48,tr("LiveAssist")); 48,tr("LiveAssist"));
setPalette(live_assist_color); setPalette(live_assist_color);
break; break;
@ -115,10 +115,10 @@ void ModeDisplay::WriteMap()
p->setPen(QColor(Qt::color1)); p->setPen(QColor(Qt::color1));
p->setFont(subLabelFont()); p->setFont(subLabelFont());
p->drawText((sizeHint().width()-2-p->fontMetrics(). p->drawText((sizeHint().width()-2-p->fontMetrics().
width(tr("Operating Mode")))/2, horizontalAdvance(tr("Operating Mode")))/2,
22,tr("Operating Mode")); 22,tr("Operating Mode"));
p->setFont(bannerFont()); p->setFont(bannerFont());
p->drawText((sizeHint().width()-2-p->fontMetrics().width(tr("Automatic")))/2, p->drawText((sizeHint().width()-2-p->fontMetrics().horizontalAdvance(tr("Automatic")))/2,
48,tr("Automatic")); 48,tr("Automatic"));
setPalette(auto_color); setPalette(auto_color);
break; break;
@ -129,10 +129,10 @@ void ModeDisplay::WriteMap()
p->setPen(QColor(Qt::color1)); p->setPen(QColor(Qt::color1));
p->setFont(subLabelFont()); p->setFont(subLabelFont());
p->drawText((sizeHint().width()-2-p->fontMetrics(). p->drawText((sizeHint().width()-2-p->fontMetrics().
width(tr("Operating Mode")))/2, horizontalAdvance(tr("Operating Mode")))/2,
22,tr("Operating Mode")); 22,tr("Operating Mode"));
p->setFont(bannerFont()); p->setFont(bannerFont());
p->drawText((sizeHint().width()-2-p->fontMetrics().width(tr("Manual")))/2, p->drawText((sizeHint().width()-2-p->fontMetrics().horizontalAdvance(tr("Manual")))/2,
48,tr("Manual")); 48,tr("Manual"));
setPalette(manual_color); setPalette(manual_color);
break; break;
@ -149,10 +149,10 @@ void ModeDisplay::WriteMap()
p->setPen(QColor(Qt::color1)); p->setPen(QColor(Qt::color1));
p->setFont(subLabelFont()); p->setFont(subLabelFont());
p->drawText((sizeHint().width()-2-p->fontMetrics(). p->drawText((sizeHint().width()-2-p->fontMetrics().
width(tr("Operating Mode")))/2, horizontalAdvance(tr("Operating Mode")))/2,
12,tr("Operating Mode")); 12,tr("Operating Mode"));
p->setFont(bannerFont()); p->setFont(bannerFont());
p->drawText((sizeHint().width()-2-p->fontMetrics().width(tr("LiveAssist")))/2, p->drawText((sizeHint().width()-2-p->fontMetrics().horizontalAdvance(tr("LiveAssist")))/2,
38,tr("LiveAssist")); 38,tr("LiveAssist"));
setPalette(live_assist_color); setPalette(live_assist_color);
break; break;
@ -163,10 +163,10 @@ void ModeDisplay::WriteMap()
p->setPen(QColor(Qt::color1)); p->setPen(QColor(Qt::color1));
p->setFont(subLabelFont()); p->setFont(subLabelFont());
p->drawText((sizeHint().width()-2-p->fontMetrics(). p->drawText((sizeHint().width()-2-p->fontMetrics().
width(tr("Operating Mode")))/2, horizontalAdvance(tr("Operating Mode")))/2,
12,tr("Operating Mode")); 12,tr("Operating Mode"));
p->setFont(bannerFont()); p->setFont(bannerFont());
p->drawText((sizeHint().width()-2-p->fontMetrics().width(tr("Automatic")))/2, p->drawText((sizeHint().width()-2-p->fontMetrics().horizontalAdvance(tr("Automatic")))/2,
39,tr("Automatic")); 39,tr("Automatic"));
setPalette(auto_color); setPalette(auto_color);
break; break;
@ -177,10 +177,10 @@ void ModeDisplay::WriteMap()
p->setPen(QColor(Qt::color1)); p->setPen(QColor(Qt::color1));
p->setFont(subLabelFont()); p->setFont(subLabelFont());
p->drawText((sizeHint().width()-2-p->fontMetrics(). p->drawText((sizeHint().width()-2-p->fontMetrics().
width(tr("Operating Mode")))/2, horizontalAdvance(tr("Operating Mode")))/2,
12,tr("Operating Mode")); 12,tr("Operating Mode"));
p->setFont(bannerFont()); p->setFont(bannerFont());
p->drawText((sizeHint().width()-2-p->fontMetrics().width(tr("Manual")))/2, p->drawText((sizeHint().width()-2-p->fontMetrics().horizontalAdvance(tr("Manual")))/2,
38,tr("Manual")); 38,tr("Manual"));
setPalette(manual_color); setPalette(manual_color);
break; break;
@ -192,7 +192,7 @@ void ModeDisplay::WriteMap()
str=tr("A1")+": "+RDAirPlayConf::logModeText(mode_mode[1]); str=tr("A1")+": "+RDAirPlayConf::logModeText(mode_mode[1]);
p->drawText(10,sizeHint().height()-2-5,str); p->drawText(10,sizeHint().height()-2-5,str);
str=tr("A2")+": "+RDAirPlayConf::logModeText(mode_mode[2]); str=tr("A2")+": "+RDAirPlayConf::logModeText(mode_mode[2]);
p->drawText(sizeHint().width()-p->fontMetrics().width(str)-10,sizeHint().height()-2-5,str); p->drawText(sizeHint().width()-p->fontMetrics().horizontalAdvance(str)-10,sizeHint().height()-2-5,str);
} }
p->end(); p->end();
delete p; delete p;

View File

@ -2,7 +2,7 @@
// //
// The post counter widget for Rivendell // The post counter widget for Rivendell
// //
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as // it under the terms of the GNU General Public License version 2 as
@ -169,10 +169,10 @@ void PostCounter::UpdateDisplay()
p->setPen(QColor(text_color)); p->setPen(QColor(text_color));
p->setFont(subLabelFont()); p->setFont(subLabelFont());
p->drawText((size().width()-2-p-> p->drawText((size().width()-2-p->
fontMetrics().width(point))/2,32,point); fontMetrics().horizontalAdvance(point))/2,32,point);
p->setFont(bannerFont()); p->setFont(bannerFont());
p->drawText((size().width()-2-p-> p->drawText((size().width()-2-p->
fontMetrics().width(state))/2,58,state); fontMetrics().horizontalAdvance(state))/2,58,state);
p->end(); p->end();
delete p; delete p;
setIcon(pix); setIcon(pix);

View File

@ -2,7 +2,7 @@
// //
// The On Air Playout Utility for Rivendell. // The On Air Playout Utility for Rivendell.
// //
// (C) Copyright 2002-2024 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as // it under the terms of the GNU General Public License version 2 as
@ -1854,14 +1854,12 @@ void MainWidget::resizeEvent(QResizeEvent *e)
void MainWidget::wheelEvent(QWheelEvent *e) void MainWidget::wheelEvent(QWheelEvent *e)
{ {
if((air_panel!=NULL)&&(e->orientation()==Qt::Vertical)) { if(e->angleDelta().y()>0) {
if(e->delta()>0) {
air_panel->soundPanelWidget()->panelDown(); air_panel->soundPanelWidget()->panelDown();
} }
if(e->delta()<0) { if(e->angleDelta().y()<0) {
air_panel->soundPanelWidget()->panelUp(); air_panel->soundPanelWidget()->panelUp();
} }
}
e->accept(); e->accept();
} }

View File

@ -2,7 +2,7 @@
// //
// The Start Button for RDAirPlay Rivendell // The Start Button for RDAirPlay Rivendell
// //
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as // it under the terms of the GNU General Public License version 2 as
@ -178,19 +178,19 @@ void StartButton::paintEvent(QPaintEvent *e)
if(start_mode!=StartButton::Disabled) { if(start_mode!=StartButton::Disabled) {
p->setPen(QColor(Qt::color1)); p->setPen(QColor(Qt::color1));
p->setFont(labelFont()); p->setFont(labelFont());
p->drawText((w-p->fontMetrics().width(start_title))/2, p->drawText((w-p->fontMetrics().horizontalAdvance(start_title))/2,
22,start_title); 22,start_title);
p->drawLine(10,24,70,24); p->drawLine(10,24,70,24);
if(!start_time.isNull()) { if(!start_time.isNull()) {
p->drawText((w-p->fontMetrics().width(rda->timeString(start_time)))/2,40, p->drawText((w-p->fontMetrics().horizontalAdvance(rda->timeString(start_time)))/2,40,
rda->timeString(start_time)); rda->timeString(start_time));
} }
else { else {
p->drawText((w-p->fontMetrics().width("--:--:--"))/2, p->drawText((w-p->fontMetrics().horizontalAdvance("--:--:--"))/2,
40,"--:--:--"); 40,"--:--:--");
} }
p->setFont(bigLabelFont()); p->setFont(bigLabelFont());
p->drawText((w-p->fontMetrics().width(start_port))/2,70,start_port); p->drawText((w-p->fontMetrics().horizontalAdvance(start_port))/2,70,start_port);
} }
p->end(); p->end();
delete p; delete p;

View File

@ -2,7 +2,7 @@
// //
// The stop counter widget for Rivendell // The stop counter widget for Rivendell
// //
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as // it under the terms of the GNU General Public License version 2 as
@ -123,7 +123,7 @@ void StopCounter::UpdateTime()
QPalette::Background)); QPalette::Background));
p->setPen(QColor(text_color)); p->setPen(QColor(text_color));
p->setFont(subLabelFont()); p->setFont(subLabelFont());
p->drawText((sizeHint().width()-2-p->fontMetrics().width(stop_text))/2,32, p->drawText((sizeHint().width()-2-p->fontMetrics().horizontalAdvance(stop_text))/2,32,
stop_text); stop_text);
p->setFont(bannerFont()); p->setFont(bannerFont());
if (msecs < 0){ if (msecs < 0){
@ -137,12 +137,12 @@ void StopCounter::UpdateTime()
if(stop_running) { if(stop_running) {
// text=rda->timeString(QTime(0,0,1).addMSecs(msecs)); // text=rda->timeString(QTime(0,0,1).addMSecs(msecs));
text=QTime(0,0,1).addMSecs(msecs).toString("hh:mm:ss"); text=QTime(0,0,1).addMSecs(msecs).toString("hh:mm:ss");
p->drawText((sizeHint().width()-2-p->fontMetrics().width(text))/2,59, p->drawText((sizeHint().width()-2-p->fontMetrics().horizontalAdvance(text))/2,59,
text); text);
} }
else { else {
p->drawText((sizeHint().width()-2-p-> p->drawText((sizeHint().width()-2-p->
fontMetrics().width(tr("Stopped")))/2,59, fontMetrics().horizontalAdvance(tr("Stopped")))/2,59,
tr("Stopped")); tr("Stopped"));
} }
p->end(); p->end();

View File

@ -2,7 +2,7 @@
// //
// A wall-clock widget with date. // A wall-clock widget with date.
// //
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2002-2025 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as // it under the terms of the GNU General Public License version 2 as
@ -113,9 +113,9 @@ void WallClock::tickClock()
p.setPen(QColor(text_color)); p.setPen(QColor(text_color));
} }
p.setFont(subLabelFont()); p.setFont(subLabelFont());
p.drawText((size().width()-2-p.fontMetrics().width(date))/2,22,date); p.drawText((size().width()-2-p.fontMetrics().horizontalAdvance(date))/2,22,date);
p.setFont(bannerFont()); p.setFont(bannerFont());
p.drawText((size().width()-2-p.fontMetrics().width(accum))/2,48,accum); p.drawText((size().width()-2-p.fontMetrics().horizontalAdvance(accum))/2,48,accum);
p.end(); p.end();
setIcon(*pix); setIcon(*pix);
} }