2021-06-14 Fred Gleason <fredg@paravelsystems.com>

* Made the sound panel resizeable in rdairplay(1).
	* Make the sound panel resizeable in rdpanel(1).

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2021-06-14 20:00:53 -04:00
parent fb671f430d
commit a0023dbc1e
11 changed files with 126 additions and 92 deletions

View File

@ -21890,3 +21890,6 @@
2021-06-14 Fred Gleason <fredg@paravelsystems.com>
* Removed commented-out code from the 'ListLog' widget in
rdairplay(1).
2021-06-14 Fred Gleason <fredg@paravelsystems.com>
* Made the sound panel resizeable in rdairplay(1).
* Make the sound panel resizeable in rdpanel(1).

View File

@ -2,7 +2,7 @@
//
// The sound panel widget for RDAirPlay
//
// (C) Copyright 2002-2003,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
//
// 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

View File

@ -2,7 +2,7 @@
//
// The sound panel widget for RDAirPlay
//
// (C) Copyright 2002-2003,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
//
// 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
@ -21,9 +21,9 @@
#ifndef RDBUTTON_PANEL_H
#define RDBUTTON_PANEL_H
#include <qwidget.h>
#include <qdatetime.h>
#include <qlabel.h>
#include <QDateTime>
#include <QLabel>
#include <QWidget>
#include <rdairplay_conf.h>
#include <rdstation.h>
@ -34,8 +34,8 @@
//
// Widget Settings
//
#define PANEL_MAX_BUTTON_COLUMNS 20
#define PANEL_MAX_BUTTON_ROWS 20
#define PANEL_MAX_BUTTON_COLUMNS 40
#define PANEL_MAX_BUTTON_ROWS 23
#define PANEL_BUTTON_SIZE_X 88
#define PANEL_BUTTON_SIZE_Y 80

View File

@ -29,16 +29,15 @@
#include "rdmacro.h"
#include "rdsound_panel.h"
RDSoundPanel::RDSoundPanel(int cols,int rows,int station_panels,
int user_panels,bool flash,const QString &caption,
const QString &label_template,bool extended,
RDEventPlayer *player,RDCartDialog *cart_dialog,
QWidget *parent)
RDSoundPanel::RDSoundPanel(int station_panels,int user_panels,bool flash,
const QString &caption,const QString &label_template,
bool extended,RDEventPlayer *player,
RDCartDialog *cart_dialog,QWidget *parent)
: RDWidget(parent)
{
panel_playmode_box=NULL;
panel_button_columns=cols;
panel_button_rows=rows;
panel_button_columns=PANEL_MAX_BUTTON_COLUMNS;
panel_button_rows=PANEL_MAX_BUTTON_ROWS;
panel_cue_port=-1;
panel_caption=caption;
if(extended) {
@ -92,10 +91,6 @@ RDSoundPanel::RDSoundPanel(int cols,int rows,int station_panels,
panel_selector_box=new RDComboBox(this);
panel_selector_box->setFont(buttonFont());
panel_selector_box->addIgnoredKey(Qt::Key_Space);
panel_selector_box->
setGeometry((15+PANEL_BUTTON_SIZE_X)*(panel_button_columns-5),
(15+PANEL_BUTTON_SIZE_Y)*panel_button_rows,
2*PANEL_BUTTON_SIZE_X+15,50);
connect(panel_selector_box,SIGNAL(activated(int)),
this,SLOT(panelActivatedData(int)));
connect(panel_selector_box,SIGNAL(setupClicked()),
@ -122,10 +117,6 @@ RDSoundPanel::RDSoundPanel(int cols,int rows,int station_panels,
//
panel_playmode_box=new QComboBox(this);
panel_playmode_box->setFont(buttonFont());
panel_playmode_box->
setGeometry((15+PANEL_BUTTON_SIZE_X)*(panel_button_columns-3)-5,
(15+PANEL_BUTTON_SIZE_Y)*panel_button_rows,
PANEL_BUTTON_SIZE_X+10,50);
connect(panel_playmode_box,SIGNAL(activated(int)),
this,SLOT(playmodeActivatedData(int)));
panel_playmode_box->insertItem(panel_playmode_box->count(),tr("Play All"));
@ -135,10 +126,6 @@ RDSoundPanel::RDSoundPanel(int cols,int rows,int station_panels,
// Reset Button
//
panel_reset_button=new RDPushButton(this);
panel_reset_button->
setGeometry((15+PANEL_BUTTON_SIZE_X)*(panel_button_columns-2),
(15+PANEL_BUTTON_SIZE_Y)*panel_button_rows,
PANEL_BUTTON_SIZE_X,50);
panel_reset_button->setFont(buttonFont());
panel_reset_button->setText(tr("Reset"));
panel_reset_button->setFlashColor(QColor(RDPANEL_RESET_FLASH_COLOR));
@ -149,10 +136,6 @@ RDSoundPanel::RDSoundPanel(int cols,int rows,int station_panels,
// All Button
//
panel_all_button=new RDPushButton(this);
panel_all_button->
setGeometry((15+PANEL_BUTTON_SIZE_X)*(panel_button_columns-1),
(15+PANEL_BUTTON_SIZE_Y)*panel_button_rows,
PANEL_BUTTON_SIZE_X,50);
panel_all_button->setFont(buttonFont());
panel_all_button->setText(tr("All"));
panel_all_button->setFlashColor(QColor(RDPANEL_RESET_FLASH_COLOR));
@ -164,10 +147,6 @@ RDSoundPanel::RDSoundPanel(int cols,int rows,int station_panels,
// Setup Button
//
panel_setup_button=new RDPushButton(this);
panel_setup_button->
setGeometry((15+PANEL_BUTTON_SIZE_X)*(panel_button_columns-1),
(15+PANEL_BUTTON_SIZE_Y)*panel_button_rows,
PANEL_BUTTON_SIZE_X,50);
panel_setup_button->setFont(buttonFont());
panel_setup_button->setText(tr("Setup"));
panel_setup_button->setFlashColor(QColor(RDPANEL_SETUP_FLASH_COLOR));
@ -592,6 +571,8 @@ void RDSoundPanel::changeUser()
}
delete q;
panel_selector_box->setCurrentIndex(current_item);
UpdateButtonViewport();
}
@ -642,6 +623,8 @@ void RDSoundPanel::panelActivatedData(int n)
panel_number=n-panel_station_panels;
}
panel_buttons[PanelOffset(panel_type,panel_number)]->show();
UpdateButtonViewport();
}
@ -894,6 +877,25 @@ void RDSoundPanel::scanPanelData()
}
void RDSoundPanel::resizeEvent(QResizeEvent *e)
{
int w=size().width();
int h=size().height();
UpdateButtonViewport();
panel_selector_box->setGeometry(0,h-50,2*PANEL_BUTTON_SIZE_X+10,50);
panel_playmode_box->setGeometry(2*PANEL_BUTTON_SIZE_X+15,h-50,
PANEL_BUTTON_SIZE_X+10,50);
panel_reset_button->setGeometry(w-2*PANEL_BUTTON_SIZE_X-20,h-50,
PANEL_BUTTON_SIZE_X,50);
panel_all_button->setGeometry(w-PANEL_BUTTON_SIZE_X-15,h-50,
PANEL_BUTTON_SIZE_X,50);
panel_setup_button->setGeometry(w-PANEL_BUTTON_SIZE_X-15,h-50,
PANEL_BUTTON_SIZE_X,50);
}
void RDSoundPanel::wheelEvent(QWheelEvent *e)
{
if(e->orientation()==Qt::Vertical) {
@ -908,6 +910,19 @@ void RDSoundPanel::wheelEvent(QWheelEvent *e)
}
void RDSoundPanel::UpdateButtonViewport()
{
QRect viewport(0,0,size().width()-10,size().height()-60);
RDButtonPanel *panel=panel_buttons[PanelOffset(panel_type,panel_number)];
for(int i=0;i<panel_button_rows;i++) {
for(int j=0;j<panel_button_columns;j++) {
RDPanelButton *button=panel->panelButton(i,j);
button->setVisible(viewport.contains(button->geometry()));
}
}
}
void RDSoundPanel::PlayButton(RDAirPlayConf::PanelType type,int panel,
int row,int col,RDLogLine::StartSource src,bool hookmode,
int mport,bool pause_when_finished)
@ -1337,6 +1352,8 @@ void RDSoundPanel::LoadPanel(RDAirPlayConf::PanelType type,int panel)
}
}
delete q;
UpdateButtonViewport();
}

View File

@ -2,7 +2,7 @@
//
// The sound panel widget
//
// (C) Copyright 2002-2019 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
//
// 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
@ -50,7 +50,7 @@ class RDSoundPanel : public RDWidget
{
Q_OBJECT
public:
RDSoundPanel(int cols,int rows,int station_panels,int user_panels,bool flash,
RDSoundPanel(int station_panels,int user_panels,bool flash,
const QString &caption,const QString &label_template,
bool extended,RDEventPlayer *player,RDCartDialog *cart_dialog,
QWidget *parent=0);
@ -117,9 +117,11 @@ class RDSoundPanel : public RDWidget
void scanPanelData();
protected:
void resizeEvent(QResizeEvent *e);
void wheelEvent(QWheelEvent *e);
private:
void UpdateButtonViewport();
void PlayButton(RDAirPlayConf::PanelType type,int panel,int row,int col,
RDLogLine::StartSource src,bool hookmode,int mport=-1,
bool pause_when_finished=false);

View File

@ -959,7 +959,7 @@ void ListLog::resizeEvent(QResizeEvent *e)
list_modify_button->setGeometry(170,size().height()-55,80,50);
list_scroll_button->setGeometry(250,size().height()-55,80,50);
list_refresh_button->setGeometry(330,size().height()-55,80,50);
list_load_button->setGeometry(size().width()-90,size().height()-55,80,50);
list_load_button->setGeometry(410,size().height()-55,80,50);
}
if(rda->airplayConf()->hourSelectorEnabled()) {

View File

@ -262,9 +262,9 @@ void MainWidget::RunLocalMacros(RDMacro *rml)
return;
}
if((rml->arg(1).toInt()<=0)||
(rml->arg(1).toInt()>AIR_PANEL_BUTTON_COLUMNS)||
(rml->arg(1).toInt()>PANEL_MAX_BUTTON_COLUMNS)||
(rml->arg(2).toInt()<=0)||
(rml->arg(2).toInt()>AIR_PANEL_BUTTON_ROWS)) {
(rml->arg(2).toInt()>PANEL_MAX_BUTTON_ROWS)) {
if(rml->echoRequested()) {
rml->acknowledge(false);
rda->ripc()->sendRml(rml);
@ -302,9 +302,9 @@ void MainWidget::RunLocalMacros(RDMacro *rml)
return;
}
if((rml->arg(1).toInt()<=0)||
(rml->arg(1).toInt()>AIR_PANEL_BUTTON_COLUMNS)||
(rml->arg(1).toInt()>PANEL_MAX_BUTTON_COLUMNS)||
(rml->arg(2).toInt()<=0)||
(rml->arg(2).toInt()>AIR_PANEL_BUTTON_ROWS)||
(rml->arg(2).toInt()>PANEL_MAX_BUTTON_ROWS)||
(rml->arg(3).toUInt()>RD_MAX_CART_NUMBER)) {
if(rml->echoRequested()) {
rml->acknowledge(false);
@ -478,9 +478,9 @@ void MainWidget::RunLocalMacros(RDMacro *rml)
return;
}
if((rml->arg(1).toInt()<0)||
(rml->arg(1).toInt()>AIR_PANEL_BUTTON_COLUMNS)||
(rml->arg(1).toInt()>PANEL_MAX_BUTTON_COLUMNS)||
(rml->arg(2).toInt()<0)||
(rml->arg(2).toInt()>AIR_PANEL_BUTTON_ROWS)) {
(rml->arg(2).toInt()>PANEL_MAX_BUTTON_ROWS)) {
if(rml->echoRequested()) {
rml->acknowledge(false);
rda->ripc()->sendRml(rml);
@ -618,9 +618,9 @@ void MainWidget::RunLocalMacros(RDMacro *rml)
return;
}
if((rml->arg(1).toInt()<0)||
(rml->arg(1).toInt()>AIR_PANEL_BUTTON_COLUMNS)||
(rml->arg(1).toInt()>PANEL_MAX_BUTTON_COLUMNS)||
(rml->arg(2).toInt()<0)||
(rml->arg(2).toInt()>AIR_PANEL_BUTTON_ROWS)) {
(rml->arg(2).toInt()>PANEL_MAX_BUTTON_ROWS)) {
if(rml->echoRequested()) {
rml->acknowledge(false);
rda->ripc()->sendRml(rml);
@ -687,9 +687,9 @@ void MainWidget::RunLocalMacros(RDMacro *rml)
return;
}
if((rml->arg(1).toInt()<0)||
(rml->arg(1).toInt()>AIR_PANEL_BUTTON_COLUMNS)||
(rml->arg(1).toInt()>PANEL_MAX_BUTTON_COLUMNS)||
(rml->arg(2).toInt()<0)||
(rml->arg(2).toInt()>AIR_PANEL_BUTTON_ROWS)) {
(rml->arg(2).toInt()>PANEL_MAX_BUTTON_ROWS)) {
if(rml->echoRequested()) {
rml->acknowledge(false);
rda->ripc()->sendRml(rml);
@ -726,9 +726,9 @@ void MainWidget::RunLocalMacros(RDMacro *rml)
return;
}
if((rml->arg(1).toInt()<0)||
(rml->arg(1).toInt()>AIR_PANEL_BUTTON_COLUMNS)||
(rml->arg(1).toInt()>PANEL_MAX_BUTTON_COLUMNS)||
(rml->arg(2).toInt()<0)||
(rml->arg(2).toInt()>AIR_PANEL_BUTTON_ROWS)) {
(rml->arg(2).toInt()>PANEL_MAX_BUTTON_ROWS)) {
if(rml->echoRequested()) {
rml->acknowledge(false);
rda->ripc()->sendRml(rml);

View File

@ -118,7 +118,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
// Fix the Window Size
//
setMinimumSize(sizeHint());
// setMaximumSize(sizeHint());
//
// Initialize the Random Number Generator
@ -187,11 +186,14 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
air_stop_gpo_lines[i]=rda->airplayConf()->stopGpoLine(chan)-1;
air_channel_gpio_types[i]=rda->airplayConf()->gpioType(chan);
air_audio_channels[i]=
AudioChannel(rda->airplayConf()->card(chan),rda->airplayConf()->port(chan));
AudioChannel(rda->airplayConf()->card(chan),
rda->airplayConf()->port(chan));
if((rda->airplayConf()->card(chan)>=0)&&(rda->airplayConf()->port(chan)>=0)) {
if((rda->airplayConf()->card(chan)>=0)&&
(rda->airplayConf()->port(chan)>=0)) {
int achan=
AudioChannel(rda->airplayConf()->card(chan),rda->airplayConf()->port(chan));
AudioChannel(rda->airplayConf()->card(chan),
rda->airplayConf()->port(chan));
if(air_channel_timers[0][achan]==NULL) {
air_channel_timers[0][achan]=new QTimer(this);
air_channel_timers[0][achan]->setSingleShot(true);
@ -231,7 +233,8 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
//
// RIPC Connection
//
connect(rda->ripc(),SIGNAL(connected(bool)),this,SLOT(ripcConnectedData(bool)));
connect(rda->ripc(),SIGNAL(connected(bool)),
this,SLOT(ripcConnectedData(bool)));
connect(rda,SIGNAL(userChanged()),this,SLOT(userData()));
connect(rda->ripc(),SIGNAL(rmlReceived(RDMacro *)),
this,SLOT(rmlReceivedData(RDMacro *)));
@ -387,10 +390,10 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
//
// Create Palettes
//
auto_color=
QPalette(QColor(BUTTON_MODE_AUTO_COLOR),palette().color(QPalette::Background));
manual_color=
QPalette(QColor(BUTTON_MODE_MANUAL_COLOR),palette().color(QPalette::Background));
auto_color=QPalette(QColor(BUTTON_MODE_AUTO_COLOR),
palette().color(QPalette::Background));
manual_color=QPalette(QColor(BUTTON_MODE_MANUAL_COLOR),
palette().color(QPalette::Background));
active_color=palette();
active_color.setColor(QPalette::Active,QPalette::ButtonText,
BUTTON_LOG_ACTIVE_TEXT_COLOR);
@ -458,16 +461,17 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
rda->airplayConf()->panels(RDAirPlayConf::UserPanel)){
int card=-1;
air_panel=
new RDSoundPanel(AIR_PANEL_BUTTON_COLUMNS,AIR_PANEL_BUTTON_ROWS,
rda->airplayConf()->panels(RDAirPlayConf::StationPanel),
new RDSoundPanel(rda->airplayConf()->panels(RDAirPlayConf::StationPanel),
rda->airplayConf()->panels(RDAirPlayConf::UserPanel),
rda->airplayConf()->flashPanel(),
"RDAirPlay",
rda->airplayConf()->buttonLabelTemplate(),false,
air_event_player,air_cart_dialog,this);
air_panel->setPauseEnabled(rda->airplayConf()->panelPauseEnabled());
air_panel->setCard(0,rda->airplayConf()->card(RDAirPlayConf::SoundPanel1Channel));
air_panel->setPort(0,rda->airplayConf()->port(RDAirPlayConf::SoundPanel1Channel));
air_panel->setCard(0,rda->airplayConf()->
card(RDAirPlayConf::SoundPanel1Channel));
air_panel->setPort(0,rda->airplayConf()->
port(RDAirPlayConf::SoundPanel1Channel));
air_panel->setFocusPolicy(Qt::NoFocus);
if((card=rda->airplayConf()->card(RDAirPlayConf::SoundPanel2Channel))<0) {
air_panel->setCard(1,air_panel->card(RDAirPlayConf::MainLog1Channel));
@ -475,7 +479,8 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
}
else {
air_panel->setCard(1,card);
air_panel->setPort(1,rda->airplayConf()->port(RDAirPlayConf::SoundPanel2Channel));
air_panel->setPort(1,rda->airplayConf()->
port(RDAirPlayConf::SoundPanel2Channel));
}
if((card=rda->airplayConf()->card(RDAirPlayConf::SoundPanel3Channel))<0) {
air_panel->setCard(2,air_panel->card(RDAirPlayConf::MainLog2Channel));
@ -483,7 +488,8 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
}
else {
air_panel->setCard(2,card);
air_panel->setPort(2,rda->airplayConf()->port(RDAirPlayConf::SoundPanel3Channel));
air_panel->setPort(2,rda->airplayConf()->
port(RDAirPlayConf::SoundPanel3Channel));
}
if((card=rda->airplayConf()->card(RDAirPlayConf::SoundPanel4Channel))<0) {
air_panel->setCard(3,air_panel->card(RDAirPlayConf::SoundPanel1Channel));
@ -491,7 +497,8 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
}
else {
air_panel->setCard(3,card);
air_panel->setPort(3,rda->airplayConf()->port(RDAirPlayConf::SoundPanel4Channel));
air_panel->setPort(3,rda->airplayConf()->
port(RDAirPlayConf::SoundPanel4Channel));
}
if((card=rda->airplayConf()->card(RDAirPlayConf::SoundPanel5Channel))<0) {
air_panel->setCard(4,air_panel->card(RDAirPlayConf::CueChannel));
@ -504,24 +511,29 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
}
air_panel->setRmls(0,rda->airplayConf()->
startRml(RDAirPlayConf::SoundPanel1Channel),
rda->airplayConf()->stopRml(RDAirPlayConf::SoundPanel1Channel));
rda->airplayConf()->
stopRml(RDAirPlayConf::SoundPanel1Channel));
air_panel->setRmls(1,rda->airplayConf()->
startRml(RDAirPlayConf::SoundPanel2Channel),
rda->airplayConf()->stopRml(RDAirPlayConf::SoundPanel2Channel));
rda->airplayConf()->
stopRml(RDAirPlayConf::SoundPanel2Channel));
air_panel->setRmls(2,rda->airplayConf()->
startRml(RDAirPlayConf::SoundPanel3Channel),
rda->airplayConf()->stopRml(RDAirPlayConf::SoundPanel3Channel));
rda->airplayConf()->
stopRml(RDAirPlayConf::SoundPanel3Channel));
air_panel->setRmls(3,rda->airplayConf()->
startRml(RDAirPlayConf::SoundPanel4Channel),
rda->airplayConf()->stopRml(RDAirPlayConf::SoundPanel4Channel));
rda->airplayConf()->
stopRml(RDAirPlayConf::SoundPanel4Channel));
air_panel->setRmls(4,rda->airplayConf()->
startRml(RDAirPlayConf::SoundPanel5Channel),
rda->airplayConf()->stopRml(RDAirPlayConf::SoundPanel5Channel));
rda->airplayConf()->
stopRml(RDAirPlayConf::SoundPanel5Channel));
int next_output=0;
int channum[2];
bool assigned=false;
if((air_log[0]->card(0)==air_log[0]->card(RDAirPlayConf::MainLog2Channel))&&
(air_log[0]->port(0)==air_log[0]->port(RDAirPlayConf::MainLog2Channel))) {
(air_log[0]->port(0)==air_log[0]->port(RDAirPlayConf::MainLog2Channel))) {
next_output=2;
channum[0]=1;
channum[1]=1;
@ -545,7 +557,8 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
}
if(!assigned) {
for(int j=0;j<i;j++) {
if((i!=j)&&(air_panel->card((RDAirPlayConf::Channel)i)==air_panel->card(j))&&
if((i!=j)&&(air_panel->card((RDAirPlayConf::Channel)i)==
air_panel->card(j))&&
(air_panel->port((RDAirPlayConf::Channel)i)==air_panel->port(j))) {
air_panel->setOutputText(i,air_panel->outputText(j));
next_output--;
@ -1989,15 +2002,13 @@ void MainWidget::resizeEvent(QResizeEvent *e)
//
// Sound Panel
//
air_panel->setGeometry(510,140,air_panel->sizeHint().width(),
air_panel->sizeHint().height());
air_panel->setGeometry(510,140,w-510,h-215);
//
// Full Log Widgets
//
for(int i=0;i<RDAIRPLAY_LOG_QUANTITY;i++) {
air_log_list[i]->setGeometry(510,140,w-530,h-210);
// air_log_list[i]->setGeometry(510,140,air_log_list[i]->sizeHint().width(),
// air_log_list[i]->sizeHint().height());
}

View File

@ -46,8 +46,6 @@
#define AIR_TOTAL_BUTTONS 7
#define AIR_LOG_PORTS 2
#define AIR_PANEL_PORTS 1
#define AIR_PANEL_BUTTON_ROWS 5
#define AIR_PANEL_BUTTON_COLUMNS 5
#define AIR_TOTAL_PORTS 3
#define AIR_MESSAGE_FONT_QUANTITY 8
#define AIR_CHANNEL_LOCKOUT_INTERVAL 1000
@ -167,7 +165,6 @@ class MainWidget : public RDWidget
QDateTime air_startup_datetime;
QPixmap *air_refresh_pixmap;
QString air_editor_cmd;
// QSplashScreen *air_splash_screen;
int keystrokecount;
bool AltKeyHit ;
bool CtrlKeyHit;

View File

@ -50,7 +50,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
//
#ifndef RESIZABLE
setMinimumSize(sizeHint());
setMaximumSize(sizeHint());
// setMaximumSize(sizeHint());
#endif // RESIZABLE
//
@ -132,15 +132,12 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
rda->panelConf()->panels(RDAirPlayConf::UserPanel)){
int card=-1;
panel_panel=
new RDSoundPanel(RDPANEL_PANEL_BUTTON_COLUMNS,RDPANEL_PANEL_BUTTON_ROWS,
rda->panelConf()->panels(RDAirPlayConf::StationPanel),
new RDSoundPanel(rda->panelConf()->panels(RDAirPlayConf::StationPanel),
rda->panelConf()->panels(RDAirPlayConf::UserPanel),
rda->panelConf()->flashPanel(),
"RDPanel",
rda->panelConf()->buttonLabelTemplate(),true,
panel_player,panel_cart_dialog,this);
panel_panel->setGeometry(10,10,panel_panel->sizeHint().width(),
panel_panel->sizeHint().height());
panel_panel->setPauseEnabled(rda->panelConf()->panelPauseEnabled());
panel_panel->setCard(0,rda->panelConf()->card(RDAirPlayConf::SoundPanel1Channel));
panel_panel->setPort(0,rda->panelConf()->port(RDAirPlayConf::SoundPanel1Channel));
@ -239,11 +236,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
// Audio Meter
//
panel_stereo_meter=new RDStereoMeter(this);
panel_stereo_meter->
setGeometry(20,
sizeHint().height()-panel_stereo_meter->sizeHint().height()-7,
panel_stereo_meter->sizeHint().width(),
panel_stereo_meter->sizeHint().height());
panel_stereo_meter->setMode(RDSegMeter::Peak);
panel_stereo_meter->setFocusPolicy(Qt::NoFocus);
@ -251,7 +243,6 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
// Empty Cart
//
panel_empty_cart=new RDEmptyCart(this);
panel_empty_cart->setGeometry(373,sizeHint().height()-52,32,32);
if(!rda->station()->enableDragdrop()) {
panel_empty_cart->hide();
}
@ -325,6 +316,18 @@ void MainWidget::masterTimerData()
}
void MainWidget::resizeEvent(QResizeEvent *e)
{
panel_panel->setGeometry(10,10,size().width()-10,size().height()-25);
panel_empty_cart->setGeometry(323,size().height()-56,32,32);
panel_stereo_meter->
setGeometry(375,
size().height()-panel_stereo_meter->sizeHint().height()-7,
panel_stereo_meter->sizeHint().width(),
panel_stereo_meter->sizeHint().height());
}
void MainWidget::wheelEvent(QWheelEvent *e)
{
if(e->orientation()==Qt::Vertical) {

View File

@ -31,8 +31,8 @@
//
#define MASTER_TIMER_INTERVAL 100
#define METER_INTERVAL 50
#define RDPANEL_PANEL_BUTTON_ROWS 7
#define RDPANEL_PANEL_BUTTON_COLUMNS 9
//#define RDPANEL_PANEL_BUTTON_ROWS 7
//#define RDPANEL_PANEL_BUTTON_COLUMNS 9
#define RDPANEL_USAGE "\n"
class MainWidget : public RDWidget
@ -51,6 +51,7 @@ class MainWidget : public RDWidget
void rmlReceivedData(RDMacro *rml);
protected:
void resizeEvent(QResizeEvent *e);
void wheelEvent(QWheelEvent *e);
void closeEvent(QCloseEvent *e);