mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-17 16:11:12 +02:00
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:
@@ -21999,3 +21999,6 @@
|
|||||||
* Added 'Label' fields to the 'Input Port' and 'Output Port'
|
* Added 'Label' fields to the 'Input Port' and 'Output Port'
|
||||||
sections of the 'Edit Audio Ports' dialog in rdadmin(1).
|
sections of the 'Edit Audio Ports' dialog in rdadmin(1).
|
||||||
* Added code to rdairplay(1) to use port labels on audio meters.
|
* Added code to rdairplay(1) to use port labels on audio meters.
|
||||||
|
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.
|
||||||
|
@@ -239,12 +239,13 @@ void RDLogPlay::setLogName(QString name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RDLogPlay::setChannels(int cards[2],int ports[2],
|
void RDLogPlay::setChannels(int cards[2],int ports[2],QString labels[2],
|
||||||
const QString start_rml[2],const QString stop_rml[2])
|
const QString start_rml[2],const QString stop_rml[2])
|
||||||
{
|
{
|
||||||
for(int i=0;i<2;i++) {
|
for(int i=0;i<2;i++) {
|
||||||
play_card[i]=cards[i];
|
play_card[i]=cards[i];
|
||||||
play_port[i]=ports[i];
|
play_port[i]=ports[i];
|
||||||
|
play_label[i]=labels[i];
|
||||||
play_start_rml[i]=start_rml[i];
|
play_start_rml[i]=start_rml[i];
|
||||||
play_stop_rml[i]=stop_rml[i];
|
play_stop_rml[i]=stop_rml[i];
|
||||||
play_cae->requestTimescale(play_card[i]);
|
play_cae->requestTimescale(play_card[i]);
|
||||||
@@ -2633,10 +2634,11 @@ QString RDLogPlay::GetPortName(int card,int port)
|
|||||||
for(int i=0;i<2;i++) {
|
for(int i=0;i<2;i++) {
|
||||||
for(int j=0;j<2;j++) {
|
for(int j=0;j<2;j++) {
|
||||||
if((play_card[i]==card)&&(play_port[i]==port)) {
|
if((play_card[i]==card)&&(play_port[i]==port)) {
|
||||||
return QString().sprintf("%d",i+1);
|
return play_label[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -61,7 +61,7 @@ class RDLogPlay : public RDLogModel
|
|||||||
RDAirPlayConf::OpMode mode() const;
|
RDAirPlayConf::OpMode mode() const;
|
||||||
void setOpMode(RDAirPlayConf::OpMode mode);
|
void setOpMode(RDAirPlayConf::OpMode mode);
|
||||||
void setLogName(QString name);
|
void setLogName(QString name);
|
||||||
void setChannels(int cards[2],int ports[2],
|
void setChannels(int cards[2],int ports[2],QString labels[2],
|
||||||
const QString start_rml[2],const QString stop_rml[2]);
|
const QString start_rml[2],const QString stop_rml[2]);
|
||||||
void setSegueLength(int len);
|
void setSegueLength(int len);
|
||||||
void setNowCart(unsigned cartnum);
|
void setNowCart(unsigned cartnum);
|
||||||
@@ -228,6 +228,7 @@ class RDLogPlay : public RDLogModel
|
|||||||
int play_grace_line;
|
int play_grace_line;
|
||||||
int play_card[2];
|
int play_card[2];
|
||||||
int play_port[2];
|
int play_port[2];
|
||||||
|
QString play_label[2];
|
||||||
QString play_start_rml[2];
|
QString play_start_rml[2];
|
||||||
QString play_stop_rml[2];
|
QString play_stop_rml[2];
|
||||||
bool play_timescaling_available;
|
bool play_timescaling_available;
|
||||||
|
@@ -333,9 +333,11 @@ 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];
|
||||||
for(int i=0;i<3;i++) {
|
for(int i=0;i<3;i++) {
|
||||||
air_meter_card[i]=rda->airplayConf()->card((RDAirPlayConf::Channel)i);
|
air_meter_card[i]=rda->airplayConf()->card((RDAirPlayConf::Channel)i);
|
||||||
air_meter_port[i]=rda->airplayConf()->port((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);
|
||||||
@@ -347,23 +349,25 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
|
|||||||
cards[1]=cards[0];
|
cards[1]=cards[0];
|
||||||
ports[1]=ports[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++) {
|
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);
|
||||||
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);
|
||||||
}
|
}
|
||||||
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++) {
|
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);
|
||||||
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);
|
||||||
}
|
}
|
||||||
air_log[2]->setChannels(cards,ports,start_rmls,stop_rmls);
|
air_log[2]->setChannels(cards,ports,labels,start_rmls,stop_rmls);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Cart Picker
|
// Cart Picker
|
||||||
|
@@ -32,12 +32,6 @@ StartButton::StartButton(bool allow_pause,QWidget *parent)
|
|||||||
|
|
||||||
setFocusPolicy(Qt::NoFocus);
|
setFocusPolicy(Qt::NoFocus);
|
||||||
|
|
||||||
//
|
|
||||||
// Create Font
|
|
||||||
//
|
|
||||||
start_port_font=QFont(font().family(),20,QFont::Bold);
|
|
||||||
start_port_font.setPixelSize(20);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Create Palettes
|
// Create Palettes
|
||||||
//
|
//
|
||||||
@@ -195,27 +189,27 @@ 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((geometry().width()-p->fontMetrics().width(start_title))/2,
|
p->drawText((w-p->fontMetrics().width(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()) {
|
||||||
if(start_time_mode==RDAirPlayConf::TwentyFourHour) {
|
if(start_time_mode==RDAirPlayConf::TwentyFourHour) {
|
||||||
p->drawText((geometry().width()-p->
|
p->drawText((w-p->
|
||||||
fontMetrics().width(start_time.toString("hh:mm:ss")))/2,
|
fontMetrics().width(start_time.toString("hh:mm:ss")))/2,
|
||||||
40,start_time.toString("hh:mm:ss"));
|
40,start_time.toString("hh:mm:ss"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p->drawText((geometry().width()-p->
|
p->drawText((w-p->
|
||||||
fontMetrics().width(start_time.toString("h:mm:ss ap")))/2,
|
fontMetrics().width(start_time.toString("h:mm:ss ap")))/2,
|
||||||
40,start_time.toString("h:mm:ss ap"));
|
40,start_time.toString("h:mm:ss ap"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p->drawText((geometry().width()-p->fontMetrics().width("--:--:--"))/2,
|
p->drawText((w-p->fontMetrics().width("--:--:--"))/2,
|
||||||
40,"--:--:--");
|
40,"--:--:--");
|
||||||
}
|
}
|
||||||
p->setFont(start_port_font);
|
p->setFont(bigLabelFont());
|
||||||
p->drawText(15,70,start_port);
|
p->drawText((w-p->fontMetrics().width(start_port))/2,70,start_port);
|
||||||
}
|
}
|
||||||
p->end();
|
p->end();
|
||||||
delete p;
|
delete p;
|
||||||
|
@@ -42,9 +42,6 @@ class StartButton : public RDPushButton
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
StartButton::Mode start_mode;
|
StartButton::Mode start_mode;
|
||||||
QFont start_label_font;
|
|
||||||
QFont start_counter_font;
|
|
||||||
QFont start_port_font;
|
|
||||||
QString start_title;
|
QString start_title;
|
||||||
QString start_port;
|
QString start_port;
|
||||||
QPalette start_stop_color;
|
QPalette start_stop_color;
|
||||||
|
@@ -55,6 +55,8 @@ MainObject::MainObject(QObject *parent)
|
|||||||
{
|
{
|
||||||
QString err_msg;
|
QString err_msg;
|
||||||
RDApplication::ErrorType err_type=RDApplication::ErrorOk;
|
RDApplication::ErrorType err_type=RDApplication::ErrorOk;
|
||||||
|
QString sql;
|
||||||
|
RDSqlQuery *q;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Startup DateTime
|
// Startup DateTime
|
||||||
@@ -101,8 +103,6 @@ MainObject::MainObject(QObject *parent)
|
|||||||
connect(rda,SIGNAL(userChanged()),this,SLOT(userData()));
|
connect(rda,SIGNAL(userChanged()),this,SLOT(userData()));
|
||||||
connect(rda->ripc(),SIGNAL(rmlReceived(RDMacro *)),
|
connect(rda->ripc(),SIGNAL(rmlReceived(RDMacro *)),
|
||||||
this,SLOT(rmlReceivedData(RDMacro *)));
|
this,SLOT(rmlReceivedData(RDMacro *)));
|
||||||
// connect(rda->ripc(),SIGNAL(gpiStateChanged(int,int,bool)),
|
|
||||||
// this,SLOT(gpiStateChangedData(int,int,bool)));
|
|
||||||
rda->ripc()->
|
rda->ripc()->
|
||||||
connectHost("localhost",RIPCD_TCP_PORT,rda->config()->password());
|
connectHost("localhost",RIPCD_TCP_PORT,rda->config()->password());
|
||||||
|
|
||||||
@@ -141,18 +141,32 @@ MainObject::MainObject(QObject *parent)
|
|||||||
ports[0]=-1;
|
ports[0]=-1;
|
||||||
ports[1]=-1;
|
ports[1]=-1;
|
||||||
}
|
}
|
||||||
|
QString labels[2];
|
||||||
|
for(int i=0;i<2;i++) {
|
||||||
|
if((cards[0]>=0)&&(ports[i]>=0)) {
|
||||||
|
sql=QString("select ")+
|
||||||
|
"`LABEL` "+ // 00
|
||||||
|
"from `AUDIO_OUTPUTS` where "+
|
||||||
|
"`STATION_NAME`='"+RDEscapeString(rda->station()->name())+"' && "+
|
||||||
|
QString().sprintf("`CARD`=%d &&",cards[i])+
|
||||||
|
QString().sprintf("`PORT`=%d",ports[i]);
|
||||||
|
q=new RDSqlQuery(sql);
|
||||||
|
if(q->first()) {
|
||||||
|
labels[i]=q->value(0).toString();
|
||||||
|
}
|
||||||
|
delete q;
|
||||||
|
}
|
||||||
|
}
|
||||||
QString start_rml[2]={"",""};
|
QString start_rml[2]={"",""};
|
||||||
start_rml[0]=rda->airplayConf()->virtualStartRml(i+RD_RDVAIRPLAY_LOG_BASE);
|
start_rml[0]=rda->airplayConf()->virtualStartRml(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||||
start_rml[1]=rda->airplayConf()->virtualStartRml(i+RD_RDVAIRPLAY_LOG_BASE);
|
start_rml[1]=rda->airplayConf()->virtualStartRml(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||||
QString stop_rml[2]={"",""};
|
QString stop_rml[2]={"",""};
|
||||||
stop_rml[0]=rda->airplayConf()->virtualStopRml(i+RD_RDVAIRPLAY_LOG_BASE);
|
stop_rml[0]=rda->airplayConf()->virtualStopRml(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||||
stop_rml[1]=rda->airplayConf()->virtualStopRml(i+RD_RDVAIRPLAY_LOG_BASE);
|
stop_rml[1]=rda->airplayConf()->virtualStopRml(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||||
air_logs[i]->setChannels(cards,ports,start_rml,stop_rml);
|
air_logs[i]->setChannels(cards,ports,labels,start_rml,stop_rml);
|
||||||
air_logs[i]->
|
air_logs[i]->
|
||||||
setOpMode(rda->airplayConf()->opMode(i+RD_RDVAIRPLAY_LOG_BASE));
|
setOpMode(rda->airplayConf()->opMode(i+RD_RDVAIRPLAY_LOG_BASE));
|
||||||
}
|
}
|
||||||
// connect(air_logs[0],SIGNAL(transportChanged()),
|
|
||||||
// this,SLOT(transportChangedData()));
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Exit Timer
|
// Exit Timer
|
||||||
@@ -171,12 +185,7 @@ void MainObject::ripcConnectedData(bool state)
|
|||||||
QString sql;
|
QString sql;
|
||||||
RDSqlQuery *q;
|
RDSqlQuery *q;
|
||||||
RDMacro rml;
|
RDMacro rml;
|
||||||
/*
|
|
||||||
rml.setRole(RDMacro::Cmd);
|
|
||||||
addr.setAddress("127.0.0.1");
|
|
||||||
rml.setAddress(addr);
|
|
||||||
rml.setEchoRequested(false);
|
|
||||||
*/
|
|
||||||
//
|
//
|
||||||
// Get Onair Flag State
|
// Get Onair Flag State
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user