mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-07-04 06:29:08 +02:00
2021-12-21 Fred Gleason <fredg@paravelsystems.com>
* Moved the PANEL_MAX_OUTPUTS define in 'lib/rdsound_panel.h' to RD_SOUNDPANEL_MAX_OUTPUTS in 'lib/rd.h'. * Added a 'RDPortNames' class. * Added a 'RDCoreApplication::portNames()' method. * Refactored rdairplay(1) to use 'RDPortNames'. * Refactored rdpanel(1) to use 'RDPortNames'. * Removed the 'RDAirPlayConf::portName()' method. * Removed the 'RDAirPlayConf::soundPanelChannelName()' method. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
5a42be85cc
commit
0188da4c62
@ -22822,3 +22822,12 @@
|
|||||||
* Fixed a bug that broke the 'make py-rpm' target.
|
* Fixed a bug that broke the 'make py-rpm' target.
|
||||||
* Reset the version of the 'rivwebpyapi' PyPI package to
|
* Reset the version of the 'rivwebpyapi' PyPI package to
|
||||||
4.0.0b3.
|
4.0.0b3.
|
||||||
|
2021-12-21 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Moved the PANEL_MAX_OUTPUTS define in 'lib/rdsound_panel.h' to
|
||||||
|
RD_SOUNDPANEL_MAX_OUTPUTS in 'lib/rd.h'.
|
||||||
|
* Added a 'RDPortNames' class.
|
||||||
|
* Added a 'RDCoreApplication::portNames()' method.
|
||||||
|
* Refactored rdairplay(1) to use 'RDPortNames'.
|
||||||
|
* Refactored rdpanel(1) to use 'RDPortNames'.
|
||||||
|
* Removed the 'RDAirPlayConf::portName()' method.
|
||||||
|
* Removed the 'RDAirPlayConf::soundPanelChannelName()' method.
|
||||||
|
@ -213,6 +213,7 @@ dist_librd_la_SOURCES = dbversion.h\
|
|||||||
rdpodcast.cpp rdpodcast.h\
|
rdpodcast.cpp rdpodcast.h\
|
||||||
rdpodcastfilter.cpp rdpodcastfilter.h\
|
rdpodcastfilter.cpp rdpodcastfilter.h\
|
||||||
rdpodcastlistmodel.cpp rdpodcastlistmodel.h\
|
rdpodcastlistmodel.cpp rdpodcastlistmodel.h\
|
||||||
|
rdportnames.cpp rdportnames.h\
|
||||||
rdprocess.cpp rdprocess.h\
|
rdprocess.cpp rdprocess.h\
|
||||||
rdprofile.cpp rdprofile.h\
|
rdprofile.cpp rdprofile.h\
|
||||||
rdpushbutton.cpp rdpushbutton.h\
|
rdpushbutton.cpp rdpushbutton.h\
|
||||||
|
@ -163,6 +163,7 @@ SOURCES += rdplay_deck.cpp
|
|||||||
SOURCES += rdplaymeter.cpp
|
SOURCES += rdplaymeter.cpp
|
||||||
SOURCES += rdpodcastfilter.cpp
|
SOURCES += rdpodcastfilter.cpp
|
||||||
SOURCES += rdpodcastlistmodel.cpp
|
SOURCES += rdpodcastlistmodel.cpp
|
||||||
|
SOURCES += rdportnames.cpp
|
||||||
SOURCES += rdprocess.cpp
|
SOURCES += rdprocess.cpp
|
||||||
SOURCES += rdprofile.cpp
|
SOURCES += rdprofile.cpp
|
||||||
SOURCES += rdpushbutton.cpp
|
SOURCES += rdpushbutton.cpp
|
||||||
@ -350,6 +351,7 @@ HEADERS += rdplay_deck.h
|
|||||||
HEADERS += rdplaymeter.h
|
HEADERS += rdplaymeter.h
|
||||||
HEADERS += rdpodcastfilter.h
|
HEADERS += rdpodcastfilter.h
|
||||||
HEADERS += rdpodcastlistmodel.h
|
HEADERS += rdpodcastlistmodel.h
|
||||||
|
HEADERS += rdportnames.h
|
||||||
HEADERS += rdprocess.h
|
HEADERS += rdprocess.h
|
||||||
HEADERS += rdprofile.h
|
HEADERS += rdprofile.h
|
||||||
HEADERS += rdpushbutton.h
|
HEADERS += rdpushbutton.h
|
||||||
|
6
lib/rd.h
6
lib/rd.h
@ -174,6 +174,11 @@
|
|||||||
*/
|
*/
|
||||||
#define MAX_PANELS 50
|
#define MAX_PANELS 50
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Maximum possible SoundPanel play-out ports
|
||||||
|
*/
|
||||||
|
#define RD_SOUNDPANEL_MAX_OUTPUTS 5
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Maximum Cart Number
|
* Maximum Cart Number
|
||||||
*/
|
*/
|
||||||
@ -668,5 +673,4 @@
|
|||||||
#define RD_OFFSET_TENTHS_FORMAT "mm:ss.z"
|
#define RD_OFFSET_TENTHS_FORMAT "mm:ss.z"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // RD_H
|
#endif // RD_H
|
||||||
|
@ -83,30 +83,6 @@ void RDAirPlayConf::setPort(RDAirPlayConf::Channel chan,int port) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString RDAirPlayConf::portLabel(RDAirPlayConf::Channel chan) const
|
|
||||||
{
|
|
||||||
QString ret="??";
|
|
||||||
QString sql;
|
|
||||||
RDSqlQuery *q=NULL;
|
|
||||||
|
|
||||||
sql=QString("select ")+
|
|
||||||
"`AUDIO_OUTPUTS`.`LABEL` "+ // 00
|
|
||||||
"from `RDAIRPLAY_CHANNELS` left join `AUDIO_OUTPUTS` "+
|
|
||||||
"on `RDAIRPLAY_CHANNELS`.`PORT`=`AUDIO_OUTPUTS`.`PORT_NUMBER` where "+
|
|
||||||
"`AUDIO_OUTPUTS`.`STATION_NAME`='"+RDEscapeString(air_station)+"' && "+
|
|
||||||
"`AUDIO_OUTPUTS`.`CARD_NUMBER`=`RDAIRPLAY_CHANNELS`.`CARD` && "+
|
|
||||||
"`AUDIO_OUTPUTS`.`PORT_NUMBER`=`RDAIRPLAY_CHANNELS`.`PORT` && "+
|
|
||||||
QString::asprintf("`RDAIRPLAY_CHANNELS`.`INSTANCE`=%u",chan);
|
|
||||||
q=new RDSqlQuery(sql);
|
|
||||||
if(q->first()) {
|
|
||||||
ret=q->value(0).toString();
|
|
||||||
}
|
|
||||||
delete q;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QString RDAirPlayConf::startRml(RDAirPlayConf::Channel chan) const
|
QString RDAirPlayConf::startRml(RDAirPlayConf::Channel chan) const
|
||||||
{
|
{
|
||||||
return GetChannelValue("START_RML",chan).toString();
|
return GetChannelValue("START_RML",chan).toString();
|
||||||
@ -1069,13 +1045,6 @@ QString RDAirPlayConf::channelText(RDAirPlayConf::Channel chan)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString RDAirPlayConf::soundPanelChannelName(int mport)
|
|
||||||
{
|
|
||||||
return portLabel(RDAirPlayConf::soundPanelChannel(mport));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
RDAirPlayConf::Channel RDAirPlayConf::soundPanelChannel(int mport)
|
RDAirPlayConf::Channel RDAirPlayConf::soundPanelChannel(int mport)
|
||||||
{
|
{
|
||||||
switch(mport-1) {
|
switch(mport-1) {
|
||||||
|
@ -52,7 +52,6 @@ class RDAirPlayConf
|
|||||||
void setCard(Channel chan,int card) const;
|
void setCard(Channel chan,int card) const;
|
||||||
int port(Channel chan) const;
|
int port(Channel chan) const;
|
||||||
void setPort(Channel chan,int port) const;
|
void setPort(Channel chan,int port) const;
|
||||||
QString portLabel(Channel chan) const;
|
|
||||||
QString startRml(Channel chan) const;
|
QString startRml(Channel chan) const;
|
||||||
void setStartRml(Channel chan,QString str) const;
|
void setStartRml(Channel chan,QString str) const;
|
||||||
QString stopRml(Channel chan) const;
|
QString stopRml(Channel chan) const;
|
||||||
@ -162,7 +161,6 @@ class RDAirPlayConf
|
|||||||
void setLogNowCart(int lognum,unsigned cartnum) const;
|
void setLogNowCart(int lognum,unsigned cartnum) const;
|
||||||
unsigned logNextCart(int lognum) const;
|
unsigned logNextCart(int lognum) const;
|
||||||
void setLogNextCart(int lognum,unsigned cartnum) const;
|
void setLogNextCart(int lognum,unsigned cartnum) const;
|
||||||
QString soundPanelChannelName(int mport);
|
|
||||||
static Channel soundPanelChannel(int mport);
|
static Channel soundPanelChannel(int mport);
|
||||||
static QString channelText(RDAirPlayConf::Channel chan);
|
static QString channelText(RDAirPlayConf::Channel chan);
|
||||||
static QString logModeText(RDAirPlayConf::OpMode mode);
|
static QString logModeText(RDAirPlayConf::OpMode mode);
|
||||||
|
@ -66,6 +66,7 @@ RDCoreApplication::RDCoreApplication(const QString &module_name,
|
|||||||
app_library_conf=NULL;
|
app_library_conf=NULL;
|
||||||
app_logedit_conf=NULL;
|
app_logedit_conf=NULL;
|
||||||
app_panel_conf=NULL;
|
app_panel_conf=NULL;
|
||||||
|
app_port_names=NULL;
|
||||||
app_ripc=NULL;
|
app_ripc=NULL;
|
||||||
app_station=NULL;
|
app_station=NULL;
|
||||||
app_system=NULL;
|
app_system=NULL;
|
||||||
@ -104,6 +105,9 @@ RDCoreApplication::~RDCoreApplication()
|
|||||||
if(app_panel_conf!=NULL) {
|
if(app_panel_conf!=NULL) {
|
||||||
delete app_panel_conf;
|
delete app_panel_conf;
|
||||||
}
|
}
|
||||||
|
if(app_port_names!=NULL) {
|
||||||
|
delete app_port_names;
|
||||||
|
}
|
||||||
if(app_user!=NULL) {
|
if(app_user!=NULL) {
|
||||||
delete app_user;
|
delete app_user;
|
||||||
}
|
}
|
||||||
@ -214,6 +218,7 @@ bool RDCoreApplication::open(QString *err_msg,RDCoreApplication::ErrorType *err_
|
|||||||
app_logedit_conf=new RDLogeditConf(app_config->stationName());
|
app_logedit_conf=new RDLogeditConf(app_config->stationName());
|
||||||
app_airplay_conf=new RDAirPlayConf(app_config->stationName(),"RDAIRPLAY");
|
app_airplay_conf=new RDAirPlayConf(app_config->stationName(),"RDAIRPLAY");
|
||||||
app_panel_conf=new RDAirPlayConf(app_config->stationName(),"RDPANEL");
|
app_panel_conf=new RDAirPlayConf(app_config->stationName(),"RDPANEL");
|
||||||
|
app_port_names=new RDPortNames(app_config->stationName());
|
||||||
app_user=new RDUser();
|
app_user=new RDUser();
|
||||||
app_cae=new RDCae(app_station,app_config,this);
|
app_cae=new RDCae(app_station,app_config,this);
|
||||||
app_ripc=new RDRipc(app_station,app_config,this);
|
app_ripc=new RDRipc(app_station,app_config,this);
|
||||||
@ -294,6 +299,12 @@ RDAirPlayConf *RDCoreApplication::panelConf()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
RDPortNames *RDCoreApplication::portNames()
|
||||||
|
{
|
||||||
|
return app_port_names;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
RDRipc *RDCoreApplication::ripc()
|
RDRipc *RDCoreApplication::ripc()
|
||||||
{
|
{
|
||||||
return app_ripc;
|
return app_ripc;
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include <rddbheartbeat.h>
|
#include <rddbheartbeat.h>
|
||||||
#include <rdlibrary_conf.h>
|
#include <rdlibrary_conf.h>
|
||||||
#include <rdlogedit_conf.h>
|
#include <rdlogedit_conf.h>
|
||||||
|
#include <rdportnames.h>
|
||||||
#include <rdripc.h>
|
#include <rdripc.h>
|
||||||
#include <rdrssschemas.h>
|
#include <rdrssschemas.h>
|
||||||
#include <rdstation.h>
|
#include <rdstation.h>
|
||||||
@ -65,6 +66,7 @@ class RDCoreApplication : public QObject
|
|||||||
RDLibraryConf *libraryConf();
|
RDLibraryConf *libraryConf();
|
||||||
RDLogeditConf *logeditConf();
|
RDLogeditConf *logeditConf();
|
||||||
RDAirPlayConf *panelConf();
|
RDAirPlayConf *panelConf();
|
||||||
|
RDPortNames *portNames();
|
||||||
RDRipc *ripc();
|
RDRipc *ripc();
|
||||||
RDRssSchemas *rssSchemas();
|
RDRssSchemas *rssSchemas();
|
||||||
RDStation *station();
|
RDStation *station();
|
||||||
@ -101,6 +103,7 @@ class RDCoreApplication : public QObject
|
|||||||
RDConfig *app_config;
|
RDConfig *app_config;
|
||||||
RDLibraryConf *app_library_conf;
|
RDLibraryConf *app_library_conf;
|
||||||
RDLogeditConf *app_logedit_conf;
|
RDLogeditConf *app_logedit_conf;
|
||||||
|
RDPortNames *app_port_names;
|
||||||
RDRipc *app_ripc;
|
RDRipc *app_ripc;
|
||||||
RDRssSchemas *app_schemas;
|
RDRssSchemas *app_schemas;
|
||||||
RDStation *app_station;
|
RDStation *app_station;
|
||||||
|
62
lib/rdportnames.cpp
Normal file
62
lib/rdportnames.cpp
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
// rdportnames.cpp
|
||||||
|
//
|
||||||
|
// Get audio port names
|
||||||
|
//
|
||||||
|
// (C) Copyright 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
|
||||||
|
// published by the Free Software Foundation.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public
|
||||||
|
// License along with this program; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "rdescape_string.h"
|
||||||
|
#include "rdportnames.h"
|
||||||
|
|
||||||
|
RDPortNames::RDPortNames(const QString &station_name)
|
||||||
|
{
|
||||||
|
d_station_name=station_name;
|
||||||
|
|
||||||
|
QString sql;
|
||||||
|
RDSqlQuery *q=NULL;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Load Channel Labels
|
||||||
|
//
|
||||||
|
sql=QString("select ")+
|
||||||
|
"`LABEL`,"+ // 00
|
||||||
|
"`CARD_NUMBER`,"+ // 01
|
||||||
|
"`PORT_NUMBER` "+ // 02
|
||||||
|
"from `AUDIO_OUTPUTS` where "+
|
||||||
|
"`STATION_NAME`='"+RDEscapeString(d_station_name)+"' "+
|
||||||
|
"order by `CARD_NUMBER`,`PORT_NUMBER`";
|
||||||
|
q=new RDSqlQuery(sql);
|
||||||
|
while(q->next()) {
|
||||||
|
d_port_names[q->value(1).toInt()][q->value(2).toInt()]=
|
||||||
|
q->value(0).toString();
|
||||||
|
}
|
||||||
|
delete q;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString RDPortNames::stationName() const
|
||||||
|
{
|
||||||
|
return d_station_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString RDPortNames::portName(int card,int port) const
|
||||||
|
{
|
||||||
|
if((card<0)||(port<0)) {
|
||||||
|
return QString("----");
|
||||||
|
}
|
||||||
|
return d_port_names[card][port];
|
||||||
|
}
|
41
lib/rdportnames.h
Normal file
41
lib/rdportnames.h
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
// rdportnames.h
|
||||||
|
//
|
||||||
|
// Get audio port names
|
||||||
|
//
|
||||||
|
// (C) Copyright 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
|
||||||
|
// published by the Free Software Foundation.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public
|
||||||
|
// License along with this program; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef RDPORTNAMES_H
|
||||||
|
#define RDPORTNAMES_H
|
||||||
|
|
||||||
|
#include <rd.h>
|
||||||
|
#include <rdairplay_conf.h>
|
||||||
|
#include <rddb.h>
|
||||||
|
|
||||||
|
class RDPortNames
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
RDPortNames(const QString &station_name);
|
||||||
|
QString stationName() const;
|
||||||
|
QString portName(int card,int port) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString d_port_names[RD_MAX_CARDS][RD_MAX_PORTS];
|
||||||
|
QString d_station_name;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // RDPORTNAMES_H
|
@ -67,12 +67,12 @@ RDSoundPanel::RDSoundPanel(int station_panels,int user_panels,bool flash,
|
|||||||
panel_flash_state=false;
|
panel_flash_state=false;
|
||||||
panel_config_panels=false;
|
panel_config_panels=false;
|
||||||
panel_pause_enabled=false;
|
panel_pause_enabled=false;
|
||||||
for(unsigned i=0;i<PANEL_MAX_OUTPUTS;i++) {
|
for(unsigned i=0;i<RD_SOUNDPANEL_MAX_OUTPUTS;i++) {
|
||||||
panel_card[i]=-1;
|
panel_card[i]=-1;
|
||||||
panel_port[i]=-1;
|
panel_port[i]=-1;
|
||||||
}
|
}
|
||||||
panel_cart_dialog=cart_dialog;
|
panel_cart_dialog=cart_dialog;
|
||||||
for(int i=0;i<PANEL_MAX_OUTPUTS;i++) {
|
for(int i=0;i<RD_SOUNDPANEL_MAX_OUTPUTS;i++) {
|
||||||
panel_timescaling_supported[i]=false;
|
panel_timescaling_supported[i]=false;
|
||||||
}
|
}
|
||||||
panel_onair_flag=false;
|
panel_onair_flag=false;
|
||||||
@ -818,7 +818,7 @@ void RDSoundPanel::hookEndData(int id)
|
|||||||
|
|
||||||
void RDSoundPanel::timescalingSupportedData(int card,bool state)
|
void RDSoundPanel::timescalingSupportedData(int card,bool state)
|
||||||
{
|
{
|
||||||
for(unsigned i=0;i<PANEL_MAX_OUTPUTS;i++) {
|
for(unsigned i=0;i<RD_SOUNDPANEL_MAX_OUTPUTS;i++) {
|
||||||
if(card==panel_card[i]) {
|
if(card==panel_card[i]) {
|
||||||
panel_timescaling_supported[i]=state;
|
panel_timescaling_supported[i]=state;
|
||||||
}
|
}
|
||||||
@ -1017,7 +1017,7 @@ bool RDSoundPanel::PlayAudio(RDPanelButton *button,RDCart *cart,bool hookmode,in
|
|||||||
cart->number()));
|
cart->number()));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(mport<=0 || mport>PANEL_MAX_OUTPUTS) {
|
if(mport<=0 || mport>RD_SOUNDPANEL_MAX_OUTPUTS) {
|
||||||
button->setOutput(GetFreeOutput());
|
button->setOutput(GetFreeOutput());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1475,7 +1475,7 @@ int RDSoundPanel::GetFreeOutput()
|
|||||||
{
|
{
|
||||||
bool active=false;
|
bool active=false;
|
||||||
|
|
||||||
for(int i=0;i<PANEL_MAX_OUTPUTS;i++) {
|
for(int i=0;i<RD_SOUNDPANEL_MAX_OUTPUTS;i++) {
|
||||||
active=false;
|
active=false;
|
||||||
for(int j=0;j<RD_MAX_STREAMS;j++) {
|
for(int j=0;j<RD_MAX_STREAMS;j++) {
|
||||||
if((panel_active_buttons[j]!=NULL)&&
|
if((panel_active_buttons[j]!=NULL)&&
|
||||||
@ -1487,7 +1487,7 @@ int RDSoundPanel::GetFreeOutput()
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return PANEL_MAX_OUTPUTS-1;
|
return RD_SOUNDPANEL_MAX_OUTPUTS-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,10 +23,9 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <qdatetime.h>
|
#include <QDateTime>
|
||||||
#include <qlabel.h>
|
#include <QLabel>
|
||||||
#include <qsignalmapper.h>
|
#include <QSignalMapper>
|
||||||
|
|
||||||
|
|
||||||
#include <rdbutton_dialog.h>
|
#include <rdbutton_dialog.h>
|
||||||
#include <rdbutton_panel.h>
|
#include <rdbutton_panel.h>
|
||||||
@ -43,7 +42,6 @@
|
|||||||
//
|
//
|
||||||
#define PANEL_BUTTON_SIZE_X 88
|
#define PANEL_BUTTON_SIZE_X 88
|
||||||
#define PANEL_BUTTON_SIZE_Y 80
|
#define PANEL_BUTTON_SIZE_Y 80
|
||||||
#define PANEL_MAX_OUTPUTS 5
|
|
||||||
#define PANEL_SCAN_INTERVAL 10000
|
#define PANEL_SCAN_INTERVAL 10000
|
||||||
|
|
||||||
class RDSoundPanel : public RDWidget
|
class RDSoundPanel : public RDWidget
|
||||||
@ -170,19 +168,19 @@ class RDSoundPanel : public RDWidget
|
|||||||
bool panel_setup_mode;
|
bool panel_setup_mode;
|
||||||
bool panel_reset_mode;
|
bool panel_reset_mode;
|
||||||
QWidget *panel_parent;
|
QWidget *panel_parent;
|
||||||
int panel_card[PANEL_MAX_OUTPUTS];
|
int panel_card[RD_SOUNDPANEL_MAX_OUTPUTS];
|
||||||
int panel_port[PANEL_MAX_OUTPUTS];
|
int panel_port[RD_SOUNDPANEL_MAX_OUTPUTS];
|
||||||
int panel_cue_card;
|
int panel_cue_card;
|
||||||
int panel_cue_port;
|
int panel_cue_port;
|
||||||
QString panel_output_text[PANEL_MAX_OUTPUTS];
|
QString panel_output_text[RD_SOUNDPANEL_MAX_OUTPUTS];
|
||||||
QString panel_start_rml[PANEL_MAX_OUTPUTS];
|
QString panel_start_rml[RD_SOUNDPANEL_MAX_OUTPUTS];
|
||||||
QString panel_stop_rml[PANEL_MAX_OUTPUTS];
|
QString panel_stop_rml[RD_SOUNDPANEL_MAX_OUTPUTS];
|
||||||
RDPanelButton *panel_active_buttons[RD_MAX_STREAMS];
|
RDPanelButton *panel_active_buttons[RD_MAX_STREAMS];
|
||||||
bool panel_flash;
|
bool panel_flash;
|
||||||
int panel_flash_count;
|
int panel_flash_count;
|
||||||
bool panel_flash_state;
|
bool panel_flash_state;
|
||||||
QString panel_logfile;
|
QString panel_logfile;
|
||||||
bool panel_timescaling_supported[PANEL_MAX_OUTPUTS];
|
bool panel_timescaling_supported[RD_SOUNDPANEL_MAX_OUTPUTS];
|
||||||
bool panel_config_panels;
|
bool panel_config_panels;
|
||||||
RDEventPlayer *panel_event_player;
|
RDEventPlayer *panel_event_player;
|
||||||
QString panel_svcname;
|
QString panel_svcname;
|
||||||
|
@ -189,46 +189,8 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
|||||||
connect(rda->ripc(),SIGNAL(onairFlagChanged(bool)),
|
connect(rda->ripc(),SIGNAL(onairFlagChanged(bool)),
|
||||||
air_top_strip,SLOT(setOnairFlag(bool)));
|
air_top_strip,SLOT(setOnairFlag(bool)));
|
||||||
|
|
||||||
//
|
LoadMeters();
|
||||||
// Meter Strip
|
|
||||||
//
|
|
||||||
QList<int> strip_cards;
|
|
||||||
QList<int> strip_ports;
|
|
||||||
QStringList strip_labels;
|
|
||||||
QList<int> strip_index;
|
|
||||||
bool strip_changed=true;
|
|
||||||
for(unsigned i=0;i<RDAirPlayConf::LastChannel;i++) {
|
|
||||||
RDAirPlayConf::Channel chan=(RDAirPlayConf::Channel)i;
|
|
||||||
if(((rda->airplayConf()->card(chan)>=0)&&
|
|
||||||
(rda->airplayConf()->port(chan)>=0))&&
|
|
||||||
((!strip_cards.contains(rda->airplayConf()->card(chan)))||
|
|
||||||
(!strip_ports.contains(rda->airplayConf()->port(chan))))) {
|
|
||||||
strip_cards.push_back(rda->airplayConf()->card(chan));
|
|
||||||
strip_ports.push_back(rda->airplayConf()->port(chan));
|
|
||||||
strip_labels.push_back(rda->airplayConf()->portLabel(chan));
|
|
||||||
strip_index.push_back(strip_index.size());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while(strip_changed) {
|
|
||||||
strip_changed=false;
|
|
||||||
for(int i=0;i<(strip_index.size()-1);i++) {
|
|
||||||
if(strip_labels.at(strip_index.at(i))>
|
|
||||||
strip_labels.at(strip_index.at(i+1))) {
|
|
||||||
int index=strip_index.at(i);
|
|
||||||
strip_index[i]=strip_index.at(i+1);
|
|
||||||
strip_index[i+1]=index;
|
|
||||||
strip_changed=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
air_meter_strip=new RDMeterStrip(this);
|
|
||||||
for(int i=0;i<strip_cards.size();i++) {
|
|
||||||
air_top_strip->meterWidget()->
|
|
||||||
addOutputMeter(strip_cards.at(strip_index.at(i)),
|
|
||||||
strip_ports.at(strip_index.at(i)),
|
|
||||||
strip_labels.at(strip_index.at(i)));
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Load GPIO Channel Configuration
|
// Load GPIO Channel Configuration
|
||||||
//
|
//
|
||||||
@ -335,27 +297,26 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
|||||||
air_cue_card=rda->airplayConf()->card(RDAirPlayConf::CueChannel);
|
air_cue_card=rda->airplayConf()->card(RDAirPlayConf::CueChannel);
|
||||||
air_cue_port=rda->airplayConf()->port(RDAirPlayConf::CueChannel);
|
air_cue_port=rda->airplayConf()->port(RDAirPlayConf::CueChannel);
|
||||||
QString labels[3];
|
QString labels[3];
|
||||||
for(int i=0;i<3;i++) {
|
for(int i=0;i<2;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);
|
cards[i]=rda->airplayConf()->card((RDAirPlayConf::Channel)i);
|
||||||
ports[i]=rda->airplayConf()->port((RDAirPlayConf::Channel)i);
|
ports[i]=rda->airplayConf()->port((RDAirPlayConf::Channel)i);
|
||||||
start_rmls[i]=rda->airplayConf()->startRml((RDAirPlayConf::Channel)i);
|
start_rmls[i]=rda->airplayConf()->startRml((RDAirPlayConf::Channel)i);
|
||||||
stop_rmls[i]=rda->airplayConf()->stopRml((RDAirPlayConf::Channel)i);
|
stop_rmls[i]=rda->airplayConf()->stopRml((RDAirPlayConf::Channel)i);
|
||||||
|
if((cards[i]>=0)&&(ports[i]>=0)) {
|
||||||
|
labels[i]=rda->portNames()->portName(cards[i],ports[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if((air_meter_card[1]<0)||(air_meter_port[1]<0)) { // Fixup disabled main log port 2 playout
|
if((cards[1]<0)||(ports[1]<0)) { // Fixup disabled main log port 2 playout
|
||||||
air_meter_card[1]=air_meter_card[0];
|
|
||||||
air_meter_port[1]=air_meter_port[0];
|
|
||||||
cards[1]=cards[0];
|
cards[1]=cards[0];
|
||||||
ports[1]=ports[0];
|
ports[1]=ports[0];
|
||||||
|
labels[1]=labels[0];
|
||||||
}
|
}
|
||||||
air_log[0]->setChannels(cards,ports,start_rmls,stop_rmls,labels);
|
air_log[0]->setChannels(cards,ports,labels,start_rmls,stop_rmls);
|
||||||
|
|
||||||
for(int i=0;i<2;i++) {
|
for(int i=0;i<2;i++) {
|
||||||
cards[i]=rda->airplayConf()->card(RDAirPlayConf::AuxLog1Channel);
|
cards[i]=rda->airplayConf()->card(RDAirPlayConf::AuxLog1Channel);
|
||||||
ports[i]=rda->airplayConf()->port(RDAirPlayConf::AuxLog1Channel);
|
ports[i]=rda->airplayConf()->port(RDAirPlayConf::AuxLog1Channel);
|
||||||
labels[i]=rda->airplayConf()->portLabel(RDAirPlayConf::AuxLog1Channel);
|
labels[i]=rda->portNames()->portName(cards[i],ports[i]);
|
||||||
start_rmls[i]=rda->airplayConf()->startRml(RDAirPlayConf::AuxLog1Channel);
|
start_rmls[i]=rda->airplayConf()->startRml(RDAirPlayConf::AuxLog1Channel);
|
||||||
stop_rmls[i]=rda->airplayConf()->stopRml(RDAirPlayConf::AuxLog1Channel);
|
stop_rmls[i]=rda->airplayConf()->stopRml(RDAirPlayConf::AuxLog1Channel);
|
||||||
}
|
}
|
||||||
@ -364,7 +325,7 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
|||||||
for(int i=0;i<2;i++) {
|
for(int i=0;i<2;i++) {
|
||||||
cards[i]=rda->airplayConf()->card(RDAirPlayConf::AuxLog2Channel);
|
cards[i]=rda->airplayConf()->card(RDAirPlayConf::AuxLog2Channel);
|
||||||
ports[i]=rda->airplayConf()->port(RDAirPlayConf::AuxLog2Channel);
|
ports[i]=rda->airplayConf()->port(RDAirPlayConf::AuxLog2Channel);
|
||||||
ports[i]=rda->airplayConf()->port(RDAirPlayConf::AuxLog2Channel);
|
labels[i]=rda->portNames()->portName(cards[i],ports[i]);
|
||||||
start_rmls[i]=rda->airplayConf()->startRml(RDAirPlayConf::AuxLog2Channel);
|
start_rmls[i]=rda->airplayConf()->startRml(RDAirPlayConf::AuxLog2Channel);
|
||||||
stop_rmls[i]=rda->airplayConf()->stopRml(RDAirPlayConf::AuxLog2Channel);
|
stop_rmls[i]=rda->airplayConf()->stopRml(RDAirPlayConf::AuxLog2Channel);
|
||||||
}
|
}
|
||||||
@ -538,31 +499,21 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
|||||||
rda->airplayConf()->
|
rda->airplayConf()->
|
||||||
stopRml(RDAirPlayConf::SoundPanel5Channel));
|
stopRml(RDAirPlayConf::SoundPanel5Channel));
|
||||||
int next_output=0;
|
int next_output=0;
|
||||||
int channum[2];
|
|
||||||
bool assigned=false;
|
bool assigned=false;
|
||||||
if((air_log[0]->card(0)==air_log[0]->card(RDAirPlayConf::MainLog2Channel))&&
|
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;
|
next_output=2;
|
||||||
channum[0]=1;
|
|
||||||
channum[1]=1;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
next_output=3;
|
next_output=3;
|
||||||
channum[0]=1;
|
|
||||||
channum[1]=2;
|
|
||||||
}
|
}
|
||||||
for(int i=0;i<PANEL_MAX_OUTPUTS;i++) {
|
for(int i=0;i<RD_SOUNDPANEL_MAX_OUTPUTS;i++) {
|
||||||
air_panel->soundPanelWidget()->
|
|
||||||
setOutputText(i,rda->airplayConf()->soundPanelChannelName(next_output++));
|
|
||||||
assigned=false;
|
assigned=false;
|
||||||
for(int j=0;j<2;j++) {
|
for(int j=0;j<2;j++) {
|
||||||
if((air_panel->soundPanelWidget()->
|
if((air_panel->soundPanelWidget()->
|
||||||
card((RDAirPlayConf::Channel)i)==air_log[0]->card(j))&&
|
card((RDAirPlayConf::Channel)i)==air_log[0]->card(j))&&
|
||||||
(air_panel->soundPanelWidget()->
|
(air_panel->soundPanelWidget()->
|
||||||
port((RDAirPlayConf::Channel)i)==air_log[0]->port(j))) {
|
port((RDAirPlayConf::Channel)i)==air_log[0]->port(j))) {
|
||||||
air_panel->soundPanelWidget()->
|
|
||||||
setOutputText(i,rda->airplayConf()->
|
|
||||||
soundPanelChannelName(channum[j]));
|
|
||||||
next_output--;
|
next_output--;
|
||||||
assigned=true;
|
assigned=true;
|
||||||
j=2;
|
j=2;
|
||||||
@ -575,14 +526,18 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
|||||||
air_panel->soundPanelWidget()->card(j))&&
|
air_panel->soundPanelWidget()->card(j))&&
|
||||||
(air_panel->soundPanelWidget()->
|
(air_panel->soundPanelWidget()->
|
||||||
port((RDAirPlayConf::Channel)i)==air_panel->soundPanelWidget()->port(j))) {
|
port((RDAirPlayConf::Channel)i)==air_panel->soundPanelWidget()->port(j))) {
|
||||||
air_panel->soundPanelWidget()->
|
|
||||||
setOutputText(i,air_panel->soundPanelWidget()->outputText(j));
|
|
||||||
next_output--;
|
next_output--;
|
||||||
j=PANEL_MAX_OUTPUTS;
|
j=RD_SOUNDPANEL_MAX_OUTPUTS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for(int i=0;i<RD_SOUNDPANEL_MAX_OUTPUTS;i++) {
|
||||||
|
air_panel->soundPanelWidget()->
|
||||||
|
setOutputText(i,rda->portNames()->
|
||||||
|
portName(air_panel->soundPanelWidget()->card(i),
|
||||||
|
air_panel->soundPanelWidget()->port(i)));
|
||||||
|
}
|
||||||
|
|
||||||
air_panel->soundPanelWidget()->setSvcName(rda->airplayConf()->defaultSvc());
|
air_panel->soundPanelWidget()->setSvcName(rda->airplayConf()->defaultSvc());
|
||||||
connect(rda->ripc(),SIGNAL(userChanged()),
|
connect(rda->ripc(),SIGNAL(userChanged()),
|
||||||
@ -2277,21 +2232,6 @@ int main(int argc,char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString logfile;
|
|
||||||
|
|
||||||
|
|
||||||
bool MainWidget::FirstPort(int index)
|
|
||||||
{
|
|
||||||
for(int i=0;i<index;i++) {
|
|
||||||
if((air_meter_card[index]==air_meter_card[i])&&
|
|
||||||
(air_meter_port[index]==air_meter_port[i])) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool MainWidget::AssertChannelLock(int dir,int card,int port)
|
bool MainWidget::AssertChannelLock(int dir,int card,int port)
|
||||||
{
|
{
|
||||||
return AssertChannelLock(dir,AudioChannel(card,port));
|
return AssertChannelLock(dir,AudioChannel(card,port));
|
||||||
@ -2359,3 +2299,59 @@ void MainWidget::ShowTracker(bool state)
|
|||||||
air_tracker->hide();
|
air_tracker->hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWidget::LoadMeters()
|
||||||
|
{
|
||||||
|
QString sql;
|
||||||
|
RDSqlQuery *q=NULL;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Add Meters
|
||||||
|
//
|
||||||
|
QList<int> strip_cards;
|
||||||
|
QList<int> strip_ports;
|
||||||
|
QStringList strip_labels;
|
||||||
|
QList<int> strip_index;
|
||||||
|
bool strip_changed=true;
|
||||||
|
sql=QString("select ")+
|
||||||
|
"`CARD`,"+ // 00
|
||||||
|
"`PORT` "+ // 01
|
||||||
|
"from `RDAIRPLAY_CHANNELS` where "+
|
||||||
|
"`STATION_NAME`='"+RDEscapeString(rda->station()->name())+"' && "+
|
||||||
|
QString::asprintf("`INSTANCE`<%u",RDAirPlayConf::LastChannel);
|
||||||
|
q=new RDSqlQuery(sql);
|
||||||
|
while(q->next()) {
|
||||||
|
if(((q->value(0).toInt()>=0)&&(q->value(1).toInt()>=0))&&
|
||||||
|
((!strip_cards.contains(q->value(0).toInt()))||
|
||||||
|
(!strip_ports.contains(q->value(1).toInt())))) {
|
||||||
|
strip_cards.push_back(q->value(0).toInt());
|
||||||
|
strip_ports.push_back(q->value(1).toInt());
|
||||||
|
strip_labels.
|
||||||
|
push_back(rda->portNames()->
|
||||||
|
portName(q->value(0).toInt(),q->value(1).toInt()));
|
||||||
|
strip_index.push_back(strip_index.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete q;
|
||||||
|
|
||||||
|
while(strip_changed) {
|
||||||
|
strip_changed=false;
|
||||||
|
for(int i=0;i<(strip_index.size()-1);i++) {
|
||||||
|
if(strip_labels.at(strip_index.at(i))>
|
||||||
|
strip_labels.at(strip_index.at(i+1))) {
|
||||||
|
int index=strip_index.at(i);
|
||||||
|
strip_index[i]=strip_index.at(i+1);
|
||||||
|
strip_index[i+1]=index;
|
||||||
|
strip_changed=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
air_meter_strip=new RDMeterStrip(this);
|
||||||
|
for(int i=0;i<strip_cards.size();i++) {
|
||||||
|
air_top_strip->meterWidget()->
|
||||||
|
addOutputMeter(strip_cards.at(strip_index.at(i)),
|
||||||
|
strip_ports.at(strip_index.at(i)),
|
||||||
|
strip_labels.at(strip_index.at(i)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -98,13 +98,13 @@ class MainWidget : public RDMainWindow
|
|||||||
void SetAutoMode(int mach);
|
void SetAutoMode(int mach);
|
||||||
void SetLiveAssistMode(int mach);
|
void SetLiveAssistMode(int mach);
|
||||||
void SetActionMode(StartButton::Mode mode);
|
void SetActionMode(StartButton::Mode mode);
|
||||||
bool FirstPort(int index);
|
|
||||||
bool GetPanel(QString str,RDAirPlayConf::PanelType *type,int *panel);
|
bool GetPanel(QString str,RDAirPlayConf::PanelType *type,int *panel);
|
||||||
QFont MessageFont(QString str);
|
QFont MessageFont(QString str);
|
||||||
bool AssertChannelLock(int dir,int card,int port);
|
bool AssertChannelLock(int dir,int card,int port);
|
||||||
bool AssertChannelLock(int dir,int achan);
|
bool AssertChannelLock(int dir,int achan);
|
||||||
int AudioChannel(int card,int port) const;
|
int AudioChannel(int card,int port) const;
|
||||||
void ShowTracker(bool state);
|
void ShowTracker(bool state);
|
||||||
|
void LoadMeters();
|
||||||
RDAirPlayConf::Channel PanelChannel(int mport) const;
|
RDAirPlayConf::Channel PanelChannel(int mport) const;
|
||||||
RDLogPlay *air_log[RDAIRPLAY_LOG_QUANTITY];
|
RDLogPlay *air_log[RDAIRPLAY_LOG_QUANTITY];
|
||||||
SoundPanel *air_panel;
|
SoundPanel *air_panel;
|
||||||
@ -139,8 +139,6 @@ class MainWidget : public RDMainWindow
|
|||||||
QString air_add_group;
|
QString air_add_group;
|
||||||
QString air_add_schedcode;
|
QString air_add_schedcode;
|
||||||
int air_source_id;
|
int air_source_id;
|
||||||
int air_meter_card[3];
|
|
||||||
int air_meter_port[3];
|
|
||||||
int air_cue_card;
|
int air_cue_card;
|
||||||
int air_cue_port;
|
int air_cue_port;
|
||||||
RDLogLine::TransType air_default_trans_type;
|
RDLogLine::TransType air_default_trans_type;
|
||||||
|
@ -189,9 +189,11 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
|||||||
// Set Fader Display Numbers
|
// Set Fader Display Numbers
|
||||||
//
|
//
|
||||||
int next_output=1;
|
int next_output=1;
|
||||||
for(int i=0;i<PANEL_MAX_OUTPUTS;i++) {
|
for(int i=0;i<RD_SOUNDPANEL_MAX_OUTPUTS;i++) {
|
||||||
bool unique=true;
|
bool unique=true;
|
||||||
int output=next_output;
|
int output=next_output;
|
||||||
|
QString label=
|
||||||
|
rda->portNames()->portName(panel_panel->card(i),panel_panel->port(i));
|
||||||
for(int j=0;j<i;j++) {
|
for(int j=0;j<i;j++) {
|
||||||
if((panel_panel->card(i)==panel_panel->card(j))&&
|
if((panel_panel->card(i)==panel_panel->card(j))&&
|
||||||
(panel_panel->port(i)==panel_panel->port(j))) {
|
(panel_panel->port(i)==panel_panel->port(j))) {
|
||||||
@ -202,8 +204,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
|||||||
if(unique) {
|
if(unique) {
|
||||||
next_output++;
|
next_output++;
|
||||||
}
|
}
|
||||||
panel_panel->
|
panel_panel->setOutputText(i,label);
|
||||||
setOutputText(i,rda->panelConf()->soundPanelChannelName(output));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -299,7 +300,7 @@ void MainWidget::meterData()
|
|||||||
double ratio[2]={0.0,0.0};
|
double ratio[2]={0.0,0.0};
|
||||||
short level[2];
|
short level[2];
|
||||||
|
|
||||||
for(int i=0;i<PANEL_MAX_OUTPUTS;i++) {
|
for(int i=0;i<RD_SOUNDPANEL_MAX_OUTPUTS;i++) {
|
||||||
if(meter_data_valid[i]) {
|
if(meter_data_valid[i]) {
|
||||||
rda->cae()->
|
rda->cae()->
|
||||||
outputMeterUpdate(panel_panel->card(i),panel_panel->port(i),level);
|
outputMeterUpdate(panel_panel->card(i),panel_panel->port(i),level);
|
||||||
|
@ -62,7 +62,7 @@ class MainWidget : public RDMainWindow
|
|||||||
RDStereoMeter *panel_stereo_meter;
|
RDStereoMeter *panel_stereo_meter;
|
||||||
RDSoundPanel *panel_panel;
|
RDSoundPanel *panel_panel;
|
||||||
RDEventPlayer *panel_player;
|
RDEventPlayer *panel_player;
|
||||||
bool meter_data_valid[PANEL_MAX_OUTPUTS];
|
bool meter_data_valid[RD_SOUNDPANEL_MAX_OUTPUTS];
|
||||||
QString panel_filter;
|
QString panel_filter;
|
||||||
QString panel_group;
|
QString panel_group;
|
||||||
QString panel_schedcode;
|
QString panel_schedcode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user