mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-06-05 14:42:35 +02:00
Merged 'headless'
This commit is contained in:
commit
9e34d2fcb2
1
.gitignore
vendored
1
.gitignore
vendored
@ -78,6 +78,7 @@ rdpanel/rdpanel
|
||||
rdrepld/rdrepld
|
||||
rdrepld-suse
|
||||
rdselect/rdselect
|
||||
rdvairplayd/rdvairplayd
|
||||
ripcd/ripcd
|
||||
rivendell
|
||||
rivendell-suse
|
||||
|
45
ChangeLog
45
ChangeLog
@ -16811,3 +16811,48 @@
|
||||
to be applied to both the parent log link and the first imported
|
||||
event when the 'PRE-IMPORT CARTS' list was empty and no Timed Start
|
||||
was enabled.
|
||||
2018-05-09 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added rdvairplay(1).
|
||||
2018-05-09 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added a 'LOG_MACHINES' table to the database.
|
||||
* Incremented the database version to 278.
|
||||
2018-05-16 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added virtual logs to the 'Start/Stop Settings' section of
|
||||
the 'Configure RDAirPlay' dialog in rdadmin(1).
|
||||
2018-05-16 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added virtual log entries to the 'RDAIRPLAY_CHANNELS' table.
|
||||
* Incremented the database version to 279.
|
||||
* Added 'RDAirPlayConf::virtualCard()', 'RDAirPlay::setVirtualCard()',
|
||||
'RDAirPlayConf::virtualPort()', 'RDAirPlay::setVirtualPort()',
|
||||
'RDAirPlayConf::virtualStartRml()',
|
||||
'RDAirPlayConf::setVirtualStartRml()',
|
||||
'RDAirPlayConf::virtualStopRml()',
|
||||
'RDAirPlayConf::setVirtualStopRml()' methods.
|
||||
* Added a 'Virtual Log Outputs' subsection to the
|
||||
'Channel Assignments' section of the 'Configure RDAirPlay' dialog
|
||||
in rdadmin(1).
|
||||
2018-05-17 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added virtual log entries to the 'LOG_MODES' table.
|
||||
* Incremented the database version to 280.
|
||||
* Added a control for setting vLog start modes to the 'Log Mode
|
||||
Control' section of the 'Configure RDAirPlay' dialog in rdadmin(1).
|
||||
2018-05-17 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a bug in rdvairplay(1) that broke log chain-to events.
|
||||
* Enabled RLMs in rdvairplay(1).
|
||||
* Modified the 'rlm_test' RLM to support vLogs.
|
||||
2018-05-17 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added an 'RLM_VLOG_QUANTITY' define to 'rlm.h'.
|
||||
* Updated 'RLM_VERSION' to 18 in 'rlm.h'.
|
||||
* Updated the 'rlm_icecast2' plug-in to support vlogs.
|
||||
2018-05-17 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added a 'RDAIRPLAY.VIRTUAL_EXIT_CODE' field to the database.
|
||||
* Incremented the database version to 281.
|
||||
* Added 'RDAirPlayConf::virtualExitCode()' and
|
||||
'RDAirPlayConf::setVirtualExitCode()' methods.
|
||||
* Implemented Start/Stop settings for vlogs.
|
||||
2018-05-17 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added rdvairplay(1) to the 'rivendell' service.
|
||||
2018-05-17 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added rdvairplay(1) to the 'rivendell' package.
|
||||
2018-05-18 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Renamed rdvairplay(1) to rdvairplayd(8).
|
||||
|
@ -4,7 +4,7 @@
|
||||
##
|
||||
## Use automake to process this into a Makefile.in
|
||||
##
|
||||
## (C) Copyright 2002-2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
## (C) Copyright 2002-2018 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
|
||||
@ -56,6 +56,7 @@ SUBDIRS = icons\
|
||||
rdpanel\
|
||||
rdrepld\
|
||||
rdselect\
|
||||
rdvairplayd\
|
||||
ripcd\
|
||||
tests\
|
||||
utils\
|
||||
|
@ -1 +1 @@
|
||||
2.19.2int01
|
||||
2.19.2vlog00
|
@ -60,6 +60,26 @@ FormatString=%t
|
||||
MasterLog=Yes
|
||||
Aux1Log=Yes
|
||||
Aux2Log=Yes
|
||||
VLog101=No
|
||||
VLog102=No
|
||||
VLog103=No
|
||||
VLog104=No
|
||||
VLog105=No
|
||||
VLog106=No
|
||||
VLog107=No
|
||||
VLog108=No
|
||||
VLog109=No
|
||||
VLog110=No
|
||||
VLog111=No
|
||||
VLog112=No
|
||||
VLog113=No
|
||||
VLog114=No
|
||||
VLog115=No
|
||||
VLog116=No
|
||||
VLog117=No
|
||||
VLog118=No
|
||||
VLog119=No
|
||||
VLog120=No
|
||||
|
||||
|
||||
; Additional Icecast2 mountpoints can be configured by adding new sections...
|
||||
@ -73,3 +93,23 @@ Aux2Log=Yes
|
||||
;MasterLog=Yes
|
||||
;Aux1Log=No
|
||||
;Aux2Log=Onair
|
||||
;VLog101=No
|
||||
;VLog102=No
|
||||
;VLog103=No
|
||||
;VLog104=No
|
||||
;VLog105=No
|
||||
;VLog106=No
|
||||
;VLog107=No
|
||||
;VLog108=No
|
||||
;VLog109=No
|
||||
;VLog110=No
|
||||
;VLog111=No
|
||||
;VLog112=No
|
||||
;VLog113=No
|
||||
;VLog114=No
|
||||
;VLog115=No
|
||||
;VLog116=No
|
||||
;VLog117=No
|
||||
;VLog118=No
|
||||
;VLog119=No
|
||||
;VLog120=No
|
||||
|
@ -3,7 +3,7 @@ dnl
|
||||
dnl Autoconf configuration for Rivendell.
|
||||
dnl Use autoconf to process this into a configure script
|
||||
dnl
|
||||
dnl (C) Copyright 2002-2007,2014 Fred Gleason <fredg@paravelsystems.com>
|
||||
dnl (C) Copyright 2002-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
dnl
|
||||
dnl This program is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License version 2 as
|
||||
@ -563,6 +563,7 @@ AC_CONFIG_FILES([rivendell.spec \
|
||||
rdselect/Makefile \
|
||||
rdmonitor/Makefile \
|
||||
rdrepld/Makefile \
|
||||
rdvairplayd/Makefile \
|
||||
tests/Makefile \
|
||||
importers/Makefile \
|
||||
ios/Makefile \
|
||||
|
@ -48,6 +48,7 @@ EXTRA_DIST = audio_perms.txt\
|
||||
jack_clients.txt\
|
||||
livewire_gpio_slots.txt\
|
||||
log_format.txt\
|
||||
log_machines.txt\
|
||||
log_modes.txt\
|
||||
logs.txt\
|
||||
nownext_plugins.txt\
|
||||
|
26
docs/tables/log_machines.txt
Normal file
26
docs/tables/log_machines.txt
Normal file
@ -0,0 +1,26 @@
|
||||
LOG_MACHINES Table Layout for Rivendell
|
||||
|
||||
The RDAIRPLAY_CHANNELS table holds configuration data for the RDAirPlay
|
||||
channels assignments and related information.
|
||||
|
||||
FIELD NAME TYPE REMARKS
|
||||
------------------------------------------------------------------------------
|
||||
ID int(10) unsigned * Primary key, Auto Increment
|
||||
STATION_NAME char(64) From STATIONS.NAME
|
||||
MACHINE int(11) 1 = RDAirPlay Main Log
|
||||
2 = RDAirPlay Aux Log 1
|
||||
3 = RDAirPlay Aux Log 2
|
||||
101..124 = RDVAirPlay Log Machines
|
||||
START_MODE int(11)
|
||||
AUTO_RESTART enum('N','Y')
|
||||
LOG_NAME char(64)
|
||||
CURRENT_LOG char(64)
|
||||
RUNNING enum('N','Y')
|
||||
LOG_ID int(11)
|
||||
LOG_LINE int(11)
|
||||
NOW_CART int(10) unsigned
|
||||
NEXT_CART int(10) unsigned
|
||||
UDP_ADDR char(255)
|
||||
UDP_PORT int(10) unsigned
|
||||
UDP_STRING char(255)
|
||||
LOG_RML char(255)
|
@ -28,19 +28,8 @@ BUTTON_LABEL_TEMPLATE char(32)
|
||||
PAUSE_ENABLED enum('N','Y')
|
||||
DEFAULT_SERVICE char(10) From SERVICES.NAME
|
||||
HOUR_SELECTOR_ENABLED enum('N','Y')
|
||||
UDP_ADDR0 char(255)
|
||||
UDP_PORT0 int(10) unsigned
|
||||
UDP_STRING0 char(255)
|
||||
LOG_RML0 char(255)
|
||||
UDP_ADDR1 char(255)
|
||||
UDP_PORT1 int(10) unsigned
|
||||
UDP_STRING1 char(255)
|
||||
LOG_RML1 char(255)
|
||||
UDP_ADDR2 char(255)
|
||||
UDP_PORT2 int(10) unsigned
|
||||
UDP_STRING2 char(255)
|
||||
LOG_RML2 char(255)
|
||||
EXIT_CODE int(11) 0=clean, 1=dirty
|
||||
VIRTUAL_EXIT_CODE int(11) 0=clean, 1=dirty
|
||||
EXIT_PASSWORD char(41)
|
||||
SKIN_PATH char(255)
|
||||
SHOW_COUNTERS enum('N','Y')
|
||||
@ -49,33 +38,3 @@ TITLE_TEMPLATE char(64)
|
||||
ARTIST_TEMPLATE char(64)
|
||||
OUTCUE_TEMPLATE char(64)
|
||||
DESCRIPTION_TEMPLATE char(64)
|
||||
LOG0_START_MODE int(11) 0=start empty, 1=load last,
|
||||
2=load specified
|
||||
LOG0_AUTO_RESTART enum('N','Y')
|
||||
LOG0_LOG_NAME char(64) From LOGS.NAME
|
||||
LOG0_CURRENT_LOG char(64) From LOGS.NAME
|
||||
LOG0_RUNNING enum('N','Y')
|
||||
LOG0_LOG_ID int(11)
|
||||
LOG0_LOG_LINE int(11)
|
||||
LOG0_NOW_CART int(10) unsigned
|
||||
LOG0_NEXT_CART int(10) unsigned
|
||||
LOG1_START_MODE int(11) 0=start empty, 1=load last,
|
||||
2=load specified
|
||||
LOG1_AUTO_RESTART enum('N','Y')
|
||||
LOG1_LOG_NAME char(64) From LOGS.NAME
|
||||
LOG1_CURRENT_LOG char(64) From LOGS.NAME
|
||||
LOG1_RUNNING enum('N','Y')
|
||||
LOG1_LOG_ID int(11)
|
||||
LOG1_LOG_LINE int(11)
|
||||
LOG1_NOW_CART int(10) unsigned
|
||||
LOG1_NEXT_CART int(10) unsigned
|
||||
LOG2_START_MODE int(11) 0=start empty, 1=load last,
|
||||
2=load specified
|
||||
LOG2_AUTO_RESTART enum('N','Y')
|
||||
LOG2_LOG_NAME char(64) From LOGS.NAME
|
||||
LOG2_CURRENT_LOG char(64) From LOGS.NAME
|
||||
LOG2_RUNNING enum('N','Y')
|
||||
LOG2_LOG_ID int(11)
|
||||
LOG2_LOG_LINE int(11)
|
||||
LOG2_NOW_CART int(10) unsigned
|
||||
LOG2_NEXT_CART int(10) unsigned
|
||||
|
@ -24,7 +24,7 @@
|
||||
/*
|
||||
* Current Database Version
|
||||
*/
|
||||
#define RD_VERSION_DATABASE 277
|
||||
#define RD_VERSION_DATABASE 281
|
||||
|
||||
|
||||
#endif // DBVERSION_H
|
||||
|
6
lib/rd.h
6
lib/rd.h
@ -582,5 +582,11 @@
|
||||
*/
|
||||
#define RD_NOTIFICATION_PORT 20539
|
||||
|
||||
/*
|
||||
* RDVAirPlay Values
|
||||
*/
|
||||
#define RD_RDVAIRPLAY_LOG_BASE 100
|
||||
#define RD_RDVAIRPLAY_LOG_QUAN 20
|
||||
|
||||
|
||||
#endif // RD_H
|
||||
|
@ -112,6 +112,114 @@ void RDAirPlayConf::setStopRml(RDAirPlayConf::Channel chan,QString str) const
|
||||
}
|
||||
|
||||
|
||||
int RDAirPlayConf::virtualCard(int mach) const
|
||||
{
|
||||
int ret=-1;
|
||||
QString sql=QString("select CARD from RDAIRPLAY_CHANNELS where ")+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("INSTANCE=%d",mach);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=q->value(0).toInt();
|
||||
}
|
||||
delete q;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setVirtualCard(int mach,int card) const
|
||||
{
|
||||
QString sql=QString("update RDAIRPLAY_CHANNELS set ")+
|
||||
QString().sprintf("CARD=%d where ",card)+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("INSTANCE=%d",mach);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
int RDAirPlayConf::virtualPort(int mach) const
|
||||
{
|
||||
int ret=-1;
|
||||
QString sql=QString("select PORT from RDAIRPLAY_CHANNELS where ")+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("INSTANCE=%d",mach);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=q->value(0).toInt();
|
||||
}
|
||||
delete q;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setVirtualPort(int mach,int port) const
|
||||
{
|
||||
QString sql=QString("update RDAIRPLAY_CHANNELS set ")+
|
||||
QString().sprintf("PORT=%d where ",port)+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("INSTANCE=%d",mach);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
QString RDAirPlayConf::virtualStartRml(int mach) const
|
||||
{
|
||||
QString ret;
|
||||
QString sql=QString("select START_RML from RDAIRPLAY_CHANNELS where ")+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("INSTANCE=%d",mach);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=q->value(0).toString();
|
||||
}
|
||||
delete q;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setVirtualStartRml(int mach,QString str) const
|
||||
{
|
||||
QString sql=QString("update RDAIRPLAY_CHANNELS set ")+
|
||||
"START_RML=\""+RDEscapeString(str)+"\" where "+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("INSTANCE=%d",mach);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
QString RDAirPlayConf::virtualStopRml(int mach) const
|
||||
{
|
||||
QString ret;
|
||||
QString sql=QString("select STOP_RML from RDAIRPLAY_CHANNELS where ")+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("INSTANCE=%d",mach);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=q->value(0).toString();
|
||||
}
|
||||
delete q;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setVirtualStopRml(int mach,QString str) const
|
||||
{
|
||||
QString sql=QString("update RDAIRPLAY_CHANNELS set ")+
|
||||
"STOP_RML=\""+RDEscapeString(str)+"\" where "+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("INSTANCE=%d",mach);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
RDAirPlayConf::GpioType RDAirPlayConf::gpioType(RDAirPlayConf::Channel chan)
|
||||
const
|
||||
{
|
||||
@ -533,55 +641,108 @@ void RDAirPlayConf::setDescriptionTemplate(const QString &str)
|
||||
QHostAddress RDAirPlayConf::udpAddress(int logno) const
|
||||
{
|
||||
QHostAddress addr;
|
||||
QString str(RDGetSqlValue(air_tablename,"ID",air_id,
|
||||
QString().sprintf("UDP_ADDR%d",logno)).toString());
|
||||
addr.setAddress(str);
|
||||
QString sql=QString("select UDP_ADDR ")+
|
||||
"from LOG_MACHINES where STATION_NAME=\""+
|
||||
RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("MACHINE=%d",logno);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
addr.setAddress(q->value(0).toString());
|
||||
}
|
||||
delete q;
|
||||
return addr;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setUdpAddress(int logno,QHostAddress addr) const
|
||||
{
|
||||
SetRow(QString().sprintf("UDP_ADDR%d",logno),addr.toString());
|
||||
QString sql=QString("update LOG_MACHINES set ")+
|
||||
"UDP_ADDR=\""+RDEscapeString(addr.toString())+"\" where "+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+
|
||||
QString().sprintf("MACHINE=%d",logno);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
Q_UINT16 RDAirPlayConf::udpPort(int logno) const
|
||||
{
|
||||
return (Q_UINT16)RDGetSqlValue(air_tablename,"ID",air_id,QString().
|
||||
sprintf("UDP_PORT%d",logno)).toInt();
|
||||
Q_UINT16 ret=0;
|
||||
QString sql=QString("select UDP_PORT ")+
|
||||
"from LOG_MACHINES where STATION_NAME=\""+
|
||||
RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("MACHINE=%d",logno);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=q->value(0).toUInt();
|
||||
}
|
||||
delete q;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setUdpPort(int logno,Q_UINT16 port) const
|
||||
{
|
||||
SetRow(QString().sprintf("UDP_PORT%d",logno),(int)port);
|
||||
QString sql=QString("update LOG_MACHINES set ")+
|
||||
QString().sprintf("UDP_PORT=%u ",port)+"where "+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+
|
||||
QString().sprintf("MACHINE=%d",logno);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
QString RDAirPlayConf::udpString(int logno) const
|
||||
{
|
||||
return RDGetSqlValue(air_tablename,"ID",air_id,
|
||||
QString().sprintf("UDP_STRING%d",logno)).toString();
|
||||
QString ret;
|
||||
QString sql=QString("select UDP_STRING ")+
|
||||
"from LOG_MACHINES where STATION_NAME=\""+
|
||||
RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("MACHINE=%d",logno);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=q->value(0).toString();
|
||||
}
|
||||
delete q;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setUdpString(int logno,const QString &str) const
|
||||
{
|
||||
SetRow(QString().sprintf("UDP_STRING%d",logno),str);
|
||||
QString sql=QString("update LOG_MACHINES set ")+
|
||||
"UDP_STRING=\""+RDEscapeString(str)+"\" where "+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+
|
||||
QString().sprintf("MACHINE=%d",logno);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
QString RDAirPlayConf::logRml(int logno) const
|
||||
{
|
||||
return RDGetSqlValue(air_tablename,"ID",air_id,
|
||||
QString().sprintf("LOG_RML%d",logno)).toString();
|
||||
QString ret;
|
||||
QString sql=QString("select LOG_RML ")+
|
||||
"from LOG_MACHINES where STATION_NAME=\""+
|
||||
RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("MACHINE=%d",logno);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=q->value(0).toString();
|
||||
}
|
||||
delete q;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setLogRml(int logno,const QString &str) const
|
||||
{
|
||||
SetRow(QString().sprintf("LOG_RML%d",logno),str);
|
||||
QString sql=QString("update LOG_MACHINES set ")+
|
||||
"LOG_RML=\""+RDEscapeString(str)+"\" where "+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+
|
||||
QString().sprintf("MACHINE=%d",logno);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
@ -598,6 +759,19 @@ void RDAirPlayConf::setExitCode(RDAirPlayConf::ExitCode code) const
|
||||
}
|
||||
|
||||
|
||||
RDAirPlayConf::ExitCode RDAirPlayConf::virtualExitCode() const
|
||||
{
|
||||
return (RDAirPlayConf::ExitCode)
|
||||
RDGetSqlValue(air_tablename,"ID",air_id,"VIRTUAL_EXIT_CODE").toInt();
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setVirtualExitCode(RDAirPlayConf::ExitCode code) const
|
||||
{
|
||||
SetRow("VIRTUAL_EXIT_CODE",(int)code);
|
||||
}
|
||||
|
||||
|
||||
bool RDAirPlayConf::exitPasswordValid(const QString &passwd) const
|
||||
{
|
||||
QString sql;
|
||||
@ -671,121 +845,244 @@ void RDAirPlayConf::setAuditionPreroll(int msecs) const
|
||||
|
||||
RDAirPlayConf::StartMode RDAirPlayConf::startMode(int lognum) const
|
||||
{
|
||||
return (RDAirPlayConf::StartMode)
|
||||
RDGetSqlValue(air_tablename,"ID",
|
||||
air_id,QString().sprintf("LOG%d_START_MODE",lognum)).toInt();
|
||||
RDAirPlayConf::StartMode ret=RDAirPlayConf::StartEmpty;
|
||||
QString sql=QString("select START_MODE ")+
|
||||
"from LOG_MACHINES where STATION_NAME=\""+
|
||||
RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=(RDAirPlayConf::StartMode)q->value(0).toInt();
|
||||
}
|
||||
delete q;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setStartMode(int lognum,RDAirPlayConf::StartMode mode) const
|
||||
{
|
||||
SetRow(QString().sprintf("LOG%d_START_MODE",lognum),(int)mode);
|
||||
QString sql=QString("update LOG_MACHINES set ")+
|
||||
QString().sprintf("START_MODE=%d ",mode)+" where "+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
bool RDAirPlayConf::autoRestart(int lognum) const
|
||||
{
|
||||
return RDBool(RDGetSqlValue(air_tablename,"ID",air_id,
|
||||
QString().sprintf("LOG%d_AUTO_RESTART",lognum)).
|
||||
toString());
|
||||
bool ret=false;
|
||||
QString sql=QString("select AUTO_RESTART ")+
|
||||
"from LOG_MACHINES where STATION_NAME=\""+
|
||||
RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=q->value(0).toString()=="Y";
|
||||
}
|
||||
delete q;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setAutoRestart(int lognum,bool state) const
|
||||
{
|
||||
SetRow(QString().sprintf("LOG%d_AUTO_RESTART",lognum),RDYesNo(state));
|
||||
QString sql=QString("update LOG_MACHINES set ")+
|
||||
"AUTO_RESTART=\""+RDYesNo(state)+"\" where "+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
QString RDAirPlayConf::logName(int lognum) const
|
||||
{
|
||||
return RDGetSqlValue(air_tablename,"ID",air_id,QString().
|
||||
sprintf("LOG%d_LOG_NAME",lognum)).toString();
|
||||
QString ret;
|
||||
QString sql=QString("select LOG_NAME ")+
|
||||
"from LOG_MACHINES where STATION_NAME=\""+
|
||||
RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=q->value(0).toString();
|
||||
}
|
||||
delete q;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setLogName(int lognum,const QString &name) const
|
||||
{
|
||||
SetRow(QString().sprintf("LOG%d_LOG_NAME",lognum),name);
|
||||
QString sql=QString("update LOG_MACHINES set ")+
|
||||
"LOG_NAME=\""+RDEscapeString(name)+"\" where "+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
QString RDAirPlayConf::currentLog(int lognum) const
|
||||
{
|
||||
return RDGetSqlValue(air_tablename,"ID",air_id,QString().
|
||||
sprintf("LOG%d_CURRENT_LOG",lognum)).toString();
|
||||
QString ret;
|
||||
QString sql=QString("select CURRENT_LOG ")+
|
||||
"from LOG_MACHINES where STATION_NAME=\""+
|
||||
RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=q->value(0).toString();
|
||||
}
|
||||
delete q;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setCurrentLog(int lognum,const QString &name) const
|
||||
{
|
||||
SetRow(QString().sprintf("LOG%d_CURRENT_LOG",lognum),name);
|
||||
QString sql=QString("update LOG_MACHINES set ")+
|
||||
"CURRENT_LOG=\""+RDEscapeString(name)+"\" where "+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
bool RDAirPlayConf::logRunning(int lognum) const
|
||||
{
|
||||
return RDBool(RDGetSqlValue(air_tablename,"ID",air_id,
|
||||
QString().sprintf("LOG%d_RUNNING",lognum)).
|
||||
toString());
|
||||
bool ret=false;
|
||||
QString sql=QString("select RUNNING ")+
|
||||
"from LOG_MACHINES where STATION_NAME=\""+
|
||||
RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=q->value(0).toString()=="Y";
|
||||
}
|
||||
delete q;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setLogRunning(int lognum,bool state) const
|
||||
{
|
||||
SetRow(QString().sprintf("LOG%d_RUNNING",lognum),RDYesNo(state));
|
||||
QString sql=QString("update LOG_MACHINES set ")+
|
||||
"RUNNING=\""+RDYesNo(state)+"\" where "+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
int RDAirPlayConf::logId(int lognum) const
|
||||
{
|
||||
return RDGetSqlValue(air_tablename,"ID",air_id,QString().
|
||||
sprintf("LOG%d_LOG_ID",lognum)).toInt();
|
||||
int ret=-1;
|
||||
QString sql=QString("select LOG_ID ")+
|
||||
"from LOG_MACHINES where STATION_NAME=\""+
|
||||
RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=q->value(0).toInt();
|
||||
}
|
||||
delete q;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setLogId(int lognum,int id) const
|
||||
{
|
||||
SetRow(QString().sprintf("LOG%d_LOG_ID",lognum),id);
|
||||
QString sql=QString("update LOG_MACHINES set ")+
|
||||
QString().sprintf("LOG_ID=%d ",id)+" where "+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
int RDAirPlayConf::logCurrentLine(int lognum) const
|
||||
{
|
||||
return RDGetSqlValue(air_tablename,"ID",air_id,QString().
|
||||
sprintf("LOG%d_LOG_LINE",lognum)).toInt();
|
||||
int ret=-1;
|
||||
QString sql=QString("select LOG_LINE ")+
|
||||
"from LOG_MACHINES where STATION_NAME=\""+
|
||||
RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=q->value(0).toInt();
|
||||
}
|
||||
delete q;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setLogCurrentLine(int lognum,int line) const
|
||||
{
|
||||
SetRow(QString().sprintf("LOG%d_LOG_LINE",lognum),line);
|
||||
QString sql=QString("update LOG_MACHINES set ")+
|
||||
QString().sprintf("LOG_LINE=%d ",line)+" where "+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
unsigned RDAirPlayConf::logNowCart(int lognum) const
|
||||
{
|
||||
return RDGetSqlValue(air_tablename,"ID",air_id,QString().
|
||||
sprintf("LOG%d_NOW_CART",lognum)).toUInt();
|
||||
unsigned ret=0;
|
||||
QString sql=QString("select NOW_CART ")+
|
||||
"from LOG_MACHINES where STATION_NAME=\""+
|
||||
RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=q->value(0).toUInt();
|
||||
}
|
||||
delete q;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setLogNowCart(int lognum,unsigned cartnum) const
|
||||
{
|
||||
SetRow(QString().sprintf("LOG%d_NOW_CART",lognum),cartnum);
|
||||
QString sql=QString("update LOG_MACHINES set ")+
|
||||
QString().sprintf("NOW_CART=%u ",cartnum)+" where "+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
unsigned RDAirPlayConf::logNextCart(int lognum) const
|
||||
{
|
||||
return RDGetSqlValue(air_tablename,"ID",air_id,QString().
|
||||
sprintf("LOG%d_NEXT_CART",lognum)).toUInt();
|
||||
unsigned ret=0;
|
||||
QString sql=QString("select NEXT_CART ")+
|
||||
"from LOG_MACHINES where STATION_NAME=\""+
|
||||
RDEscapeString(air_station)+"\" && "+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
ret=q->value(0).toUInt();
|
||||
}
|
||||
delete q;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDAirPlayConf::setLogNextCart(int lognum,unsigned cartnum) const
|
||||
{
|
||||
SetRow(QString().sprintf("LOG%d_NEXT_CART",lognum),cartnum);
|
||||
QString sql=QString("update LOG_MACHINES set ")+
|
||||
QString().sprintf("NEXT_CART=%u ",cartnum)+" where "+
|
||||
"STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+
|
||||
QString().sprintf("MACHINE=%d",lognum);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Abstract RDAirPlay Configuration
|
||||
//
|
||||
// (C) Copyright 2002-2003,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2003,2016-2018 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
|
||||
@ -26,7 +26,6 @@
|
||||
|
||||
#include <rdlog_line.h>
|
||||
|
||||
|
||||
class RDAirPlayConf
|
||||
{
|
||||
public:
|
||||
@ -57,6 +56,14 @@ class RDAirPlayConf
|
||||
void setStartRml(Channel chan,QString str) const;
|
||||
QString stopRml(Channel chan) const;
|
||||
void setStopRml(Channel chan,QString str) const;
|
||||
int virtualCard(int mach) const;
|
||||
void setVirtualCard(int mach,int card) const;
|
||||
int virtualPort(int mach) const;
|
||||
void setVirtualPort(int mach,int port) const;
|
||||
QString virtualStartRml(int mach) const;
|
||||
void setVirtualStartRml(int mach,QString str) const;
|
||||
QString virtualStopRml(int mach) const;
|
||||
void setVirtualStopRml(int mach,QString str) const;
|
||||
RDAirPlayConf::GpioType gpioType(RDAirPlayConf::Channel chan) const;
|
||||
void setGpioType(RDAirPlayConf::Channel chan,RDAirPlayConf::GpioType type)
|
||||
const;
|
||||
@ -132,6 +139,8 @@ class RDAirPlayConf
|
||||
void setLogRml(int logno,const QString &str) const;
|
||||
RDAirPlayConf::ExitCode exitCode() const;
|
||||
void setExitCode(RDAirPlayConf::ExitCode code) const;
|
||||
RDAirPlayConf::ExitCode virtualExitCode() const;
|
||||
void setVirtualExitCode(RDAirPlayConf::ExitCode code) const;
|
||||
bool exitPasswordValid(const QString &passwd) const;
|
||||
void setExitPassword(const QString &passwd) const;
|
||||
QString skinPath() const;
|
||||
|
@ -219,6 +219,12 @@ RDUser *RDApplication::user()
|
||||
}
|
||||
|
||||
|
||||
void RDApplication::log(RDConfig::LogPriority prio,const QString &msg)
|
||||
{
|
||||
app_config->log(app_module_name,prio,msg);
|
||||
}
|
||||
|
||||
|
||||
void RDApplication::userChangedData()
|
||||
{
|
||||
app_user->setName(app_ripc->user());
|
||||
|
@ -55,6 +55,7 @@ class RDApplication : public QObject
|
||||
RDStation *station();
|
||||
RDSystem *system();
|
||||
RDUser *user();
|
||||
void log(RDConfig::LogPriority prio,const QString &msg);
|
||||
|
||||
private slots:
|
||||
void userChangedData();
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include <unistd.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include <qapplication.h>
|
||||
|
||||
#include "rdapplication.h"
|
||||
#include "rdconf.h"
|
||||
#include "rddb.h"
|
||||
@ -32,9 +34,15 @@
|
||||
#include "rdnownext.h"
|
||||
#include "rdsvc.h"
|
||||
|
||||
//
|
||||
// Debug Settings
|
||||
//
|
||||
//#define SHOW_SLOTS
|
||||
//#define SHOW_METER_SLOTS
|
||||
|
||||
RDLogPlay::RDLogPlay(int id,RDEventPlayer *player,QSocketDevice *nn_sock,
|
||||
QString logname,std::vector<RDRLMHost *> *rlm_hosts,
|
||||
QObject *parent)
|
||||
QString logname,std::vector<RDRLMHost *> *rlm_hosts,
|
||||
QObject *parent)
|
||||
: QObject(parent),RDLogEvent(logname)
|
||||
{
|
||||
//
|
||||
@ -125,7 +133,8 @@ RDLogPlay::RDLogPlay(int id,RDEventPlayer *player,QSocketDevice *nn_sock,
|
||||
//
|
||||
play_audition_line=-1;
|
||||
if((rda->station()->cueCard()>=0)&&
|
||||
(rda->station()->cuePort()>=0)) {
|
||||
(rda->station()->cuePort()>=0)&&
|
||||
(qApp->type()!=QApplication::Tty)) {
|
||||
play_audition_player=
|
||||
new RDSimplePlayer(play_cae,rda->ripc(),rda->station()->cueCard(),
|
||||
rda->station()->cuePort(),0,0);
|
||||
|
@ -49,12 +49,6 @@
|
||||
#define LOGPLAY_RESCAN_INTERVAL 5000
|
||||
#define LOGPLAY_RESCAN_SIZE 30
|
||||
|
||||
//
|
||||
// Debug Settings
|
||||
//
|
||||
//#define SHOW_SLOTS
|
||||
//#define SHOW_METER_SLOTS
|
||||
|
||||
class RDLogPlay : public QObject,public RDLogEvent
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -718,6 +718,13 @@ bool RDStation::create(const QString &name,QString *err_msg,
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
for(int i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
sql=QString("insert into RDAIRPLAY_CHANNELS set ")+
|
||||
"STATION_NAME=\""+RDEscapeString(name)+"\","+
|
||||
QString().sprintf("INSTANCE=%u",i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
for(unsigned i=0;i<RD_CUT_EVENT_ID_QUAN;i++) {
|
||||
for(unsigned j=0;j<MAX_DECKS;j++) {
|
||||
sql=QString("insert into DECK_EVENTS set ")+
|
||||
@ -739,6 +746,31 @@ bool RDStation::create(const QString &name,QString *err_msg,
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
for(int i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
sql=QString().sprintf("insert into LOG_MODES set ")+
|
||||
"STATION_NAME=\""+RDEscapeString(name)+"\","+
|
||||
QString().sprintf("MACHINE=%d",i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
//
|
||||
// Log Machine Parameters
|
||||
//
|
||||
for(int i=0;i<3;i++) {
|
||||
sql=QString("insert into LOG_MACHINES set ")+
|
||||
"STATION_NAME=\""+RDEscapeString(name)+"\","+
|
||||
QString().sprintf("MACHINE=%d",i);
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
for(int i=RD_RDVAIRPLAY_LOG_BASE;i<(RD_RDVAIRPLAY_LOG_BASE+RD_RDVAIRPLAY_LOG_QUAN);i++) {
|
||||
sql=QString("insert into LOG_MACHINES set ")+
|
||||
"STATION_NAME=\""+RDEscapeString(name)+"\","+
|
||||
QString().sprintf("MACHINE=%d",i);
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
}
|
||||
else { // Use Template Host
|
||||
sql=QString("select ")+
|
||||
@ -1046,21 +1078,9 @@ bool RDStation::create(const QString &name,QString *err_msg,
|
||||
"ARTIST_TEMPLATE,"+ // 22
|
||||
"OUTCUE_TEMPLATE,"+ // 23
|
||||
"DESCRIPTION_TEMPLATE,"+ // 24
|
||||
"UDP_ADDR0,"+ // 25
|
||||
"UDP_PORT0,"+ // 26
|
||||
"UDP_STRING0,"+ // 27
|
||||
"LOG_RML0,"+ // 28
|
||||
"UDP_ADDR1,"+ // 29
|
||||
"UDP_PORT1,"+ // 30
|
||||
"UDP_STRING1,"+ // 31
|
||||
"LOG_RML1,"+ // 32
|
||||
"UDP_ADDR2,"+ // 33
|
||||
"UDP_PORT2,"+ // 34
|
||||
"UDP_STRING2,"+ // 35
|
||||
"LOG_RML2,"+ // 36
|
||||
"EXIT_PASSWORD,"+ // 37
|
||||
"SKIN_PATH,"+ // 38
|
||||
"SHOW_COUNTERS "+ // 39
|
||||
"EXIT_PASSWORD,"+ // 25
|
||||
"SKIN_PATH,"+ // 26
|
||||
"SHOW_COUNTERS "+ // 27
|
||||
"from RDAIRPLAY where "+
|
||||
"STATION=\""+RDEscapeString(exemplar)+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
@ -1093,21 +1113,9 @@ bool RDStation::create(const QString &name,QString *err_msg,
|
||||
"ARTIST_TEMPLATE=\""+RDEscapeString(q->value(22).toString())+"\","+
|
||||
"OUTCUE_TEMPLATE=\""+RDEscapeString(q->value(23).toString())+"\","+
|
||||
"DESCRIPTION_TEMPLATE=\""+RDEscapeString(q->value(24).toString())+"\","+
|
||||
"UDP_ADDR0=\""+RDEscapeString(q->value(25).toString())+"\","+
|
||||
QString().sprintf("UDP_PORT0=%u,",q->value(26).toUInt())+
|
||||
"UDP_STRING0=\""+RDEscapeString(q->value(27).toString())+"\","+
|
||||
"LOG_RML0=\""+RDEscapeString(q->value(28).toString())+"\","+
|
||||
"UDP_ADDR1=\""+RDEscapeString(q->value(29).toString())+"\","+
|
||||
QString().sprintf("UDP_PORT1=%u,",q->value(30).toUInt())+
|
||||
"UDP_STRING1=\""+RDEscapeString(q->value(31).toString())+"\","+
|
||||
"LOG_RML1=\""+RDEscapeString(q->value(32).toString())+"\","+
|
||||
"UDP_ADDR2=\""+RDEscapeString(q->value(33).toString())+"\","+
|
||||
QString().sprintf("UDP_PORT2=%u,",q->value(34).toUInt())+
|
||||
"UDP_STRING2=\""+RDEscapeString(q->value(35).toString())+"\","+
|
||||
"LOG_RML2=\""+RDEscapeString(q->value(36).toString())+"\","+
|
||||
"EXIT_PASSWORD=\""+RDEscapeString(q->value(37).toString())+"\","+
|
||||
"SKIN_PATH=\""+RDEscapeString(q->value(38).toString())+"\","+
|
||||
"SHOW_COUNTERS=\","+RDEscapeString(q->value(39).toString())+"\","+
|
||||
"EXIT_PASSWORD=\""+RDEscapeString(q->value(25).toString())+"\","+
|
||||
"SKIN_PATH=\""+RDEscapeString(q->value(26).toString())+"\","+
|
||||
"SHOW_COUNTERS=\","+RDEscapeString(q->value(27).toString())+"\","+
|
||||
"STATION=\""+RDEscapeString(name)+"\"";
|
||||
q1=new RDSqlQuery(sql);
|
||||
delete q1;
|
||||
@ -1731,6 +1739,49 @@ bool RDStation::create(const QString &name,QString *err_msg,
|
||||
delete q1;
|
||||
}
|
||||
delete q;
|
||||
|
||||
//
|
||||
// Log Machine Parameters
|
||||
//
|
||||
sql=QString("select ")+
|
||||
"MACHINE,"+ // 00
|
||||
"START_MODE,"+ // 01
|
||||
"AUTO_RESTART,"+ // 02
|
||||
"LOG_NAME,"+ // 03
|
||||
"CURRENT_LOG,"+ // 04
|
||||
"RUNNING,"+ // 05
|
||||
"LOG_ID,"+ // 06
|
||||
"LOG_LINE,"+ // 07
|
||||
"NOW_CART,"+ // 08
|
||||
"NEXT_CART,"+ // 09
|
||||
"UDP_ADDR,"+ // 10
|
||||
"UDP_PORT,"+ // 11
|
||||
"UDP_STRING,"+ // 12
|
||||
"LOG_RML "+ // 13
|
||||
"from LOG_MACHINES where "+
|
||||
"STATION_NAME=\""+RDEscapeString(exemplar)+"\"";
|
||||
q=new RDSqlQuery(sql,false);
|
||||
while(q->next()) {
|
||||
sql=QString("insert into LOG_MACHINES set ")+
|
||||
"STATION_NAME=\""+RDEscapeString(name)+"\","+
|
||||
QString().sprintf("MACHINE=%d,",q->value(0).toInt())+
|
||||
QString().sprintf("START_MODE=%d,",q->value(1).toInt())+
|
||||
"AUTO_RESTART=\""+q->value(2).toString()+"\","+
|
||||
"LOG_NAME=\""+RDEscapeString(q->value(3).toString())+"\","+
|
||||
"CURRENT_LOG=\""+RDEscapeString(q->value(4).toString())+"\","+
|
||||
"RUNNING=\""+q->value(5).toString()+"\","+
|
||||
QString().sprintf("LOG_ID=%d,",q->value(6).toInt())+
|
||||
QString().sprintf("LOG_LINE=%d,",q->value(7).toInt())+
|
||||
QString().sprintf("NOW_CART=%u,",q->value(8).toUInt())+
|
||||
QString().sprintf("NEXT_CART=%u,",q->value(9).toUInt())+
|
||||
"UDP_ADDR=\""+RDEscapeString(q->value(10).toString())+"\","+
|
||||
QString().sprintf("UDP_PORT=%u,",q->value(11).toUInt())+
|
||||
"UDP_STRING=\""+RDEscapeString(q->value(12).toString())+"\","+
|
||||
"LOG_RML=\""+RDEscapeString(q->value(13).toString())+"\"";
|
||||
q1=new RDSqlQuery(sql,false);
|
||||
delete q1;
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -1887,6 +1938,11 @@ void RDStation::remove(const QString &name)
|
||||
"STATION_NAME=\""+RDEscapeString(name)+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
|
||||
sql=QString("delete from LOG_MACHINES where ")+
|
||||
"STATION_NAME=\""+RDEscapeString(name)+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1087,51 +1087,13 @@ bool CreateDb(QString name,QString pwd,RDConfig *config)
|
||||
"ARTIST_TEMPLATE char(64) default '%a',"+
|
||||
"OUTCUE_TEMPLATE char(64) default '%o',"+
|
||||
"DESCRIPTION_TEMPLATE char(64) default '%i',"+
|
||||
"UDP_ADDR0 char(255),"+
|
||||
"UDP_PORT0 int unsigned,"+
|
||||
"UDP_STRING0 char(255),"+
|
||||
"LOG_RML0 char(255),"+
|
||||
"UDP_ADDR1 char(255),"+
|
||||
"UDP_PORT1 int unsigned,"+
|
||||
"UDP_STRING1 char(255),"+
|
||||
"LOG_RML1 char(255),"+
|
||||
"UDP_ADDR2 char(255),"+
|
||||
"UDP_PORT2 int unsigned,"+
|
||||
"UDP_STRING2 char(255),"+
|
||||
"LOG_RML2 char(255),"+
|
||||
"EXIT_CODE int default 0,"+
|
||||
"VIRTUAL_EXIT_CODE int default 0,"+
|
||||
"EXIT_PASSWORD char(41) default \"\","+
|
||||
"SKIN_PATH char(255) default \""+
|
||||
RDEscapeString(RD_DEFAULT_RDAIRPLAY_SKIN)+"\","+
|
||||
"SHOW_COUNTERS enum('N','Y') default 'N',"+
|
||||
"AUDITION_PREROLL int default 10000,"+
|
||||
"LOG0_START_MODE int default 0,"+
|
||||
"LOG0_AUTO_RESTART enum('N','Y') default 'N',"+
|
||||
"LOG0_LOG_NAME char(64),"+
|
||||
"LOG0_CURRENT_LOG char(64),"+
|
||||
"LOG0_RUNNING enum('N','Y') default 'N',"+
|
||||
"LOG0_LOG_ID int default -1,"+
|
||||
"LOG0_LOG_LINE int default -1,"+
|
||||
"LOG0_NOW_CART int unsigned default 0,"+
|
||||
"LOG0_NEXT_CART int unsigned default 0,"+
|
||||
"LOG1_START_MODE int default 0,"+
|
||||
"LOG1_AUTO_RESTART enum('N','Y') default 'N',"+
|
||||
"LOG1_LOG_NAME char(64),"+
|
||||
"LOG1_CURRENT_LOG char(64),"+
|
||||
"LOG1_RUNNING enum('N','Y') default 'N',"+
|
||||
"LOG1_LOG_ID int default -1,"+
|
||||
"LOG1_LOG_LINE int default -1,"+
|
||||
"LOG1_NOW_CART int unsigned default 0,"+
|
||||
"LOG1_NEXT_CART int unsigned default 0,"+
|
||||
"LOG2_START_MODE int default 0,"+
|
||||
"LOG2_AUTO_RESTART enum('N','Y') default 'N',"+
|
||||
"LOG2_LOG_NAME char(64),"+
|
||||
"LOG2_CURRENT_LOG char(64),"+
|
||||
"LOG2_RUNNING enum('N','Y') default 'N',"+
|
||||
"LOG2_LOG_ID int default -1,"+
|
||||
"LOG2_LOG_LINE int default -1,"+
|
||||
"LOG2_NOW_CART int unsigned default 0,"+
|
||||
"LOG2_NEXT_CART int unsigned default 0,"+
|
||||
"index STATION_IDX (STATION))"+
|
||||
config->createTablePostfix();
|
||||
if(!RunQuery(sql)) {
|
||||
@ -2289,6 +2251,32 @@ bool CreateDb(QString name,QString pwd,RDConfig *config)
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// Create LOG_MACHINES table
|
||||
//
|
||||
sql=QString("create table if not exists LOG_MACHINES (")+
|
||||
"ID int auto_increment not null primary key,"+
|
||||
"STATION_NAME char(64) not null,"+
|
||||
"MACHINE int not null,"+
|
||||
"START_MODE int not null default 0,"+
|
||||
"AUTO_RESTART enum('N','Y') not null default 'N',"+
|
||||
"LOG_NAME char(64),"+
|
||||
"CURRENT_LOG char(64),"+
|
||||
"RUNNING enum('N','Y') not null default 'N',"+
|
||||
"LOG_ID int not null default -1,"+
|
||||
"LOG_LINE int not null default -1,"+
|
||||
"NOW_CART int unsigned not null default 0,"+
|
||||
"NEXT_CART int unsigned not null default 0,"+
|
||||
"UDP_ADDR char(255),"+
|
||||
"UDP_PORT int unsigned,"+
|
||||
"UDP_STRING char(255),"+
|
||||
"LOG_RML char(255),"+
|
||||
"index STATION_NAME_IDX(STATION_NAME,MACHINE))"+
|
||||
config->createTablePostfix();
|
||||
if(!RunQuery(sql)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2376,6 +2364,14 @@ bool InitDb(QString name,QString pwd,QString station_name,RDConfig *config)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for(unsigned i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
sql=QString("insert into RDAIRPLAY_CHANNELS set ")+
|
||||
"STATION_NAME=\""+RDEscapeString(station_name)+"\","+
|
||||
QString().sprintf("INSTANCE=%u",i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
if(!RunQuery(sql)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for(unsigned i=0;i<10;i++) {
|
||||
sql=QString("insert into RDPANEL_CHANNELS set ")+
|
||||
"STATION_NAME=\""+RDEscapeString(station_name)+"\","+
|
||||
@ -2392,6 +2388,14 @@ bool InitDb(QString name,QString pwd,QString station_name,RDConfig *config)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for(unsigned i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
sql=QString("insert into LOG_MODES set ")+
|
||||
"STATION_NAME=\""+RDEscapeString(station_name)+"\","+
|
||||
QString().sprintf("MACHINE=%u",i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
if(!RunQuery(sql)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for(unsigned i=0;i<RD_CUT_EVENT_ID_QUAN;i++) {
|
||||
for(unsigned j=0;j<MAX_DECKS;j++) {
|
||||
sql=QString("insert into DECK_EVENTS set ")+
|
||||
@ -8043,6 +8047,175 @@ int UpdateDb(int ver,RDConfig *config)
|
||||
delete q;
|
||||
}
|
||||
|
||||
if(ver<278) {
|
||||
sql=QString("create table if not exists LOG_MACHINES (")+
|
||||
"ID int auto_increment not null primary key,"+
|
||||
"STATION_NAME char(64) not null,"+
|
||||
"MACHINE int not null,"+
|
||||
"START_MODE int not null default 0,"+
|
||||
"AUTO_RESTART enum('N','Y') not null default 'N',"+
|
||||
"LOG_NAME char(64),"+
|
||||
"CURRENT_LOG char(64),"+
|
||||
"RUNNING enum('N','Y') not null default 'N',"+
|
||||
"LOG_ID int not null default -1,"+
|
||||
"LOG_LINE int not null default -1,"+
|
||||
"NOW_CART int unsigned not null default 0,"+
|
||||
"NEXT_CART int unsigned not null default 0,"+
|
||||
"UDP_ADDR char(255),"+
|
||||
"UDP_PORT int unsigned,"+
|
||||
"UDP_STRING char(255),"+
|
||||
"LOG_RML char(255),"+
|
||||
"index STATION_NAME_IDX(STATION_NAME,MACHINE))"+
|
||||
config->createTablePostfix();
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
for(int i=0;i<3;i++) {
|
||||
sql=QString("select ")+
|
||||
"STATION,"+ // 00
|
||||
QString().sprintf("LOG%d_START_MODE,",i)+ // 01
|
||||
QString().sprintf("LOG%d_AUTO_RESTART,",i)+ // 02
|
||||
QString().sprintf("LOG%d_LOG_NAME,",i)+ // 03
|
||||
QString().sprintf("LOG%d_CURRENT_LOG,",i)+ // 04
|
||||
QString().sprintf("LOG%d_RUNNING,",i)+ // 05
|
||||
QString().sprintf("LOG%d_LOG_ID,",i)+ // 06
|
||||
QString().sprintf("LOG%d_LOG_LINE,",i)+ // 07
|
||||
QString().sprintf("LOG%d_NOW_CART,",i)+ // 08
|
||||
QString().sprintf("LOG%d_NEXT_CART,",i)+ // 09
|
||||
QString().sprintf("UDP_ADDR%d,",i)+ // 10
|
||||
QString().sprintf("UDP_PORT%d,",i)+ // 11
|
||||
QString().sprintf("UDP_STRING%d,",i)+ // 12
|
||||
QString().sprintf("LOG_RML%d ",i)+ // 13
|
||||
"from RDAIRPLAY order by STATION";
|
||||
q=new RDSqlQuery(sql,false);
|
||||
while(q->next()) {
|
||||
sql=QString("insert into LOG_MACHINES set ")+
|
||||
"STATION_NAME=\""+RDEscapeString(q->value(0).toString())+"\","+
|
||||
QString().sprintf("MACHINE=%d,",i)+
|
||||
QString().sprintf("START_MODE=%d,",q->value(1).toInt())+
|
||||
"AUTO_RESTART=\""+q->value(2).toString()+"\","+
|
||||
"LOG_NAME=\""+RDEscapeString(q->value(3).toString())+"\","+
|
||||
"CURRENT_LOG=\""+RDEscapeString(q->value(4).toString())+"\","+
|
||||
"RUNNING=\""+q->value(5).toString()+"\","+
|
||||
QString().sprintf("LOG_ID=%d,",q->value(6).toInt())+
|
||||
QString().sprintf("LOG_LINE=%d,",q->value(7).toInt())+
|
||||
QString().sprintf("NOW_CART=%u,",q->value(8).toUInt())+
|
||||
QString().sprintf("NEXT_CART=%u,",q->value(9).toUInt())+
|
||||
"UDP_ADDR=\""+RDEscapeString(q->value(10).toString())+"\","+
|
||||
QString().sprintf("UDP_PORT=%u,",q->value(11).toUInt())+
|
||||
"UDP_STRING=\""+RDEscapeString(q->value(12).toString())+"\","+
|
||||
"LOG_RML=\""+RDEscapeString(q->value(13).toString())+"\"";
|
||||
q1=new RDSqlQuery(sql,false);
|
||||
delete q1;
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
|
||||
sql=QString("select NAME from STATIONS");
|
||||
q=new RDSqlQuery(sql,false);
|
||||
while(q->next()) {
|
||||
for(int i=RD_RDVAIRPLAY_LOG_BASE;i<(RD_RDVAIRPLAY_LOG_BASE+RD_RDVAIRPLAY_LOG_QUAN);i++) {
|
||||
sql=QString("insert into LOG_MACHINES set ")+
|
||||
"STATION_NAME=\""+RDEscapeString(q->value(0).toString())+"\","+
|
||||
QString().sprintf("MACHINE=%d",i);
|
||||
q1=new RDSqlQuery(sql);
|
||||
delete q1;
|
||||
}
|
||||
}
|
||||
delete q;
|
||||
|
||||
for(int i=0;i<3;i++) {
|
||||
sql=QString().sprintf("alter table RDAIRPLAY drop column UDP_ADDR%d",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString().sprintf("alter table RDAIRPLAY drop column UDP_PORT%d",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString().sprintf("alter table RDAIRPLAY drop column UDP_STRING%d",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString().sprintf("alter table RDAIRPLAY drop column LOG_RML%d",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString().sprintf("alter table RDAIRPLAY drop column LOG%d_START_MODE",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString().sprintf("alter table RDAIRPLAY drop column LOG%d_AUTO_RESTART",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString().sprintf("alter table RDAIRPLAY drop column LOG%d_LOG_NAME",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString().sprintf("alter table RDAIRPLAY drop column LOG%d_CURRENT_LOG",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString().sprintf("alter table RDAIRPLAY drop column LOG%d_RUNNING",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString().sprintf("alter table RDAIRPLAY drop column LOG%d_LOG_ID",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString().sprintf("alter table RDAIRPLAY drop column LOG%d_LOG_LINE",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString().sprintf("alter table RDAIRPLAY drop column LOG%d_NOW_CART",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString().sprintf("alter table RDAIRPLAY drop column LOG%d_NEXT_CART",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
}
|
||||
}
|
||||
|
||||
if(ver<279) {
|
||||
sql=QString("select NAME from STATIONS");
|
||||
q=new RDSqlQuery(sql,false);
|
||||
while(q->next()) {
|
||||
for(unsigned i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
sql=QString("insert into RDAIRPLAY_CHANNELS set ")+
|
||||
"STATION_NAME=\""+RDEscapeString(q->value(0).toString())+"\","+
|
||||
QString().sprintf("INSTANCE=%u",i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
q1=new RDSqlQuery(sql,false);
|
||||
delete q1;
|
||||
}
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
|
||||
if(ver<280) {
|
||||
sql=QString("select NAME from STATIONS");
|
||||
q=new RDSqlQuery(sql,false);
|
||||
while(q->next()) {
|
||||
for(unsigned i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
sql=QString("insert into LOG_MODES set ")+
|
||||
"STATION_NAME=\""+RDEscapeString(q->value(0).toString())+"\","+
|
||||
QString().sprintf("MACHINE=%u",i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
q1=new RDSqlQuery(sql,false);
|
||||
delete q1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(ver<281) {
|
||||
sql=QString("alter table RDAIRPLAY add column ")+
|
||||
"VIRTUAL_EXIT_CODE int default 0 after EXIT_CODE";
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Maintainer's Note:
|
||||
//
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Edit an RDAirPlay Configuration
|
||||
//
|
||||
// (C) Copyright 2002-2004,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2004,2016-2018 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
|
||||
@ -52,6 +52,8 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
|
||||
|
||||
air_exitpasswd_changed=false;
|
||||
air_logmachine=0;
|
||||
air_virtual_logmachine=0;
|
||||
air_virtual_logstartmachine=0;
|
||||
|
||||
//
|
||||
// Fix the Window Size
|
||||
@ -213,6 +215,42 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
|
||||
connect(air_card_sel[5],SIGNAL(settingsChanged(int,int,int)),
|
||||
this,SLOT(audioSettingsChangedData(int,int,int)));
|
||||
|
||||
//
|
||||
// Virtual Log Output
|
||||
//
|
||||
label=new QLabel(tr("Virtual Log Outputs"),this);
|
||||
label->setFont(small_font);
|
||||
label->setGeometry(25,309,190,20);
|
||||
air_virtual_machine_box=new QComboBox(this);
|
||||
air_virtual_machine_box->setGeometry(270,309,100,20);
|
||||
for(int i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
air_virtual_machine_box->
|
||||
insertItem(QString().sprintf("vLog %d",i+RD_RDVAIRPLAY_LOG_BASE+1));
|
||||
}
|
||||
connect(air_virtual_machine_box,SIGNAL(activated(int)),
|
||||
this,SLOT(virtualLogActivatedData(int)));
|
||||
label=new QLabel(air_virtual_machine_box,tr("Log Machine")+":",this);
|
||||
label->setFont(small_font);
|
||||
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
label->setGeometry(165,309,100,20);
|
||||
air_virtual_card_sel=new RDCardSelector(this);
|
||||
air_virtual_card_sel->setGeometry(20,332,120,117);
|
||||
air_virtual_start_rml_edit=new QLineEdit(this);
|
||||
air_virtual_start_rml_edit->setGeometry(210,332,95,19);
|
||||
air_virtual_start_rml_edit->setValidator(validator);
|
||||
air_virtual_start_rml_label=
|
||||
new QLabel(air_virtual_start_rml_edit,tr("Start RML:"),this);
|
||||
air_virtual_start_rml_label->setGeometry(140,332,65,19);
|
||||
air_virtual_start_rml_label->setAlignment(AlignVCenter|AlignRight);
|
||||
air_virtual_stop_rml_edit=new QLineEdit(this);
|
||||
air_virtual_stop_rml_edit->setGeometry(210,353,95,19);
|
||||
air_virtual_stop_rml_edit->setValidator(validator);
|
||||
air_virtual_stop_rml_label=
|
||||
new QLabel(air_virtual_start_rml_edit,tr("Stop RML:"),this);
|
||||
air_virtual_stop_rml_label->setGeometry(140,353,65,19);
|
||||
air_virtual_stop_rml_label->setAlignment(AlignVCenter|AlignRight);
|
||||
|
||||
// **** INACTIVE INACTIVE INACTIVE ****
|
||||
//
|
||||
// Audition/Cue Output
|
||||
//
|
||||
@ -240,12 +278,13 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
|
||||
air_start_rml_label[3]->hide();
|
||||
air_stop_rml_edit[3]->hide();
|
||||
air_stop_rml_label[3]->hide();
|
||||
// **** INACTIVE INACTIVE INACTIVE ****
|
||||
|
||||
//
|
||||
// HotKeys Configuration Button
|
||||
//
|
||||
QPushButton *button=new QPushButton(this);
|
||||
button->setGeometry(10,310,180,50);
|
||||
button->setGeometry(10,385,180,50);
|
||||
button->setFont(small_font);
|
||||
button->setText(tr("Configure Hot Keys"));
|
||||
connect(button,SIGNAL(clicked()),this,SLOT(editHotKeys()));
|
||||
@ -254,7 +293,7 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
|
||||
// Now & Next Button
|
||||
//
|
||||
button=new QPushButton(this);
|
||||
button->setGeometry(200,310,180,50);
|
||||
button->setGeometry(200,385,180,50);
|
||||
button->setFont(small_font);
|
||||
button->setText(tr("Configure Now && Next\nParameters"));
|
||||
connect(button,SIGNAL(clicked()),this,SLOT(nownextData()));
|
||||
@ -636,17 +675,17 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
|
||||
//
|
||||
label=new QLabel(tr("Start/Stop Settings"),this);
|
||||
label->setFont(big_font);
|
||||
label->setGeometry(10,381,200,16);
|
||||
label->setGeometry(10,451,200,16);
|
||||
|
||||
//
|
||||
// Exit Password
|
||||
//
|
||||
air_exitpasswd_edit=new QLineEdit(this);
|
||||
air_exitpasswd_edit->setGeometry(100,404,sizeHint().width()-905,20);
|
||||
air_exitpasswd_edit->setGeometry(100,474,sizeHint().width()-905,20);
|
||||
air_exitpasswd_edit->setEchoMode(QLineEdit::Password);
|
||||
air_exitpasswd_edit->setText("******");
|
||||
label=new QLabel(air_exitpasswd_edit,tr("Exit Password:"),this);
|
||||
label->setGeometry(0,404,95,20);
|
||||
label->setGeometry(0,474,95,20);
|
||||
label->setAlignment(AlignRight|AlignVCenter);
|
||||
connect(air_exitpasswd_edit,SIGNAL(textChanged(const QString &)),
|
||||
this,SLOT(exitPasswordChangedData(const QString &)));
|
||||
@ -655,11 +694,14 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
|
||||
// Log Machine Selector
|
||||
//
|
||||
air_logmachine_box=new QComboBox(this);
|
||||
air_logmachine_box->setGeometry(45,429,100,20);
|
||||
air_logmachine_box->setGeometry(45,499,100,20);
|
||||
air_logmachine_box->insertItem(tr("Main Log"));
|
||||
for(unsigned i=1;i<RDAIRPLAY_LOG_QUANTITY;i++) {
|
||||
air_logmachine_box->insertItem(QString().sprintf("Aux %d Log",i));
|
||||
}
|
||||
for(unsigned i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
air_logmachine_box->insertItem(QString().sprintf("vLog %d",i+RD_RDVAIRPLAY_LOG_BASE+1));
|
||||
}
|
||||
connect(air_logmachine_box,SIGNAL(activated(int)),
|
||||
this,SLOT(logActivatedData(int)));
|
||||
|
||||
@ -667,12 +709,12 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
|
||||
// Startup Mode
|
||||
//
|
||||
air_startmode_box=new QComboBox(this);
|
||||
air_startmode_box->setGeometry(100,454,240,20);
|
||||
air_startmode_box->setGeometry(100,524,240,20);
|
||||
air_startmode_box->insertItem(tr("start with empty log"));
|
||||
air_startmode_box->insertItem(tr("load previous log"));
|
||||
air_startmode_box->insertItem(tr("load specified log"));
|
||||
label=new QLabel(air_exitpasswd_edit,tr("At Startup:"),this);
|
||||
label->setGeometry(30,454,65,20);
|
||||
label->setGeometry(30,524,65,20);
|
||||
label->setAlignment(AlignRight|AlignVCenter);
|
||||
connect(air_startmode_box,SIGNAL(activated(int)),
|
||||
this,SLOT(startModeChangedData(int)));
|
||||
@ -681,27 +723,27 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
|
||||
// Auto Restart Checkbox
|
||||
//
|
||||
air_autorestart_box=new QCheckBox(this);
|
||||
air_autorestart_box->setGeometry(105,479,15,15);
|
||||
air_autorestart_box->setGeometry(105,549,15,15);
|
||||
air_autorestart_label=
|
||||
new QLabel(air_autorestart_box,
|
||||
tr("Restart Log After Unclean Shutdown"),this);
|
||||
air_autorestart_label->setGeometry(125,479,250,15);
|
||||
air_autorestart_label->setGeometry(125,549,250,15);
|
||||
air_autorestart_label->setAlignment(AlignLeft|AlignVCenter);
|
||||
|
||||
//
|
||||
// Startup Log
|
||||
//
|
||||
air_startlog_edit=new QLineEdit(this);
|
||||
air_startlog_edit->setGeometry(100,499,240,20);
|
||||
air_startlog_edit->setGeometry(100,569,240,20);
|
||||
air_startlog_label=new QLabel(air_startlog_edit,tr("Log:"),this);
|
||||
air_startlog_label->setGeometry(30,499,65,20);
|
||||
air_startlog_label->setGeometry(30,569,65,20);
|
||||
air_startlog_label->setAlignment(AlignRight|AlignVCenter);
|
||||
|
||||
//
|
||||
// Log Select Button
|
||||
//
|
||||
air_startlog_button=new QPushButton(this);
|
||||
air_startlog_button->setGeometry(350,497,50,24);
|
||||
air_startlog_button->setGeometry(350,567,50,24);
|
||||
air_startlog_button->setFont(small_font);
|
||||
air_startlog_button->setText(tr("&Select"));
|
||||
connect(air_startlog_button,SIGNAL(clicked()),this,SLOT(selectData()));
|
||||
@ -801,6 +843,24 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
|
||||
air_logstartmode_label[1]->setText(tr("Aux 1 Log Startup Mode:"));
|
||||
air_logstartmode_label[2]->setText(tr("Aux 2 Log Startup Mode:"));
|
||||
|
||||
air_virtual_logstartsel_box=new QComboBox(this);
|
||||
air_virtual_logstartsel_box->setGeometry(435,638,120,20);
|
||||
connect(air_virtual_logstartsel_box,SIGNAL(activated(int)),
|
||||
this,SLOT(virtualModeActivatedData(int)));
|
||||
for(int i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
air_virtual_logstartsel_box->
|
||||
insertItem(QString().sprintf("vLog %d",i+RD_RDVAIRPLAY_LOG_BASE+1));
|
||||
}
|
||||
label=new QLabel(":",this);
|
||||
label->setGeometry(555,638,5,20);
|
||||
label->setAlignment(Qt::AlignCenter|Qt::AlignVCenter);
|
||||
air_virtual_logstartmode_box=new QComboBox(this);
|
||||
air_virtual_logstartmode_box->setGeometry(565,638,110,20);
|
||||
air_virtual_logstartmode_box->insertItem(tr("Previous"));
|
||||
air_virtual_logstartmode_box->insertItem(tr("LiveAssist"));
|
||||
air_virtual_logstartmode_box->insertItem(tr("Automatic"));
|
||||
air_virtual_logstartmode_box->insertItem(tr("Manual"));
|
||||
|
||||
//
|
||||
// Ok Button
|
||||
//
|
||||
@ -830,6 +890,10 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
|
||||
air_card_sel[i]->setMaxPorts(j,cae_station->cardOutputs(j));
|
||||
}
|
||||
}
|
||||
air_virtual_card_sel->setMaxCards(cae_station->cards());
|
||||
for(int j=0;j<air_virtual_card_sel->maxCards();j++) {
|
||||
air_virtual_card_sel->setMaxPorts(j,cae_station->cardOutputs(j));
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::information(this,tr("No Audio Configuration Data"),
|
||||
@ -887,16 +951,37 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
|
||||
}
|
||||
air_modecontrol_box->setCurrentItem((int)air_conf->opModeStyle());
|
||||
for(int i=0;i<RDAIRPLAY_LOG_QUANTITY;i++) {
|
||||
air_startmode[i]=air_conf->startMode(i);
|
||||
air_startlog[i]=air_conf->logName(i);
|
||||
air_autorestart[i]=air_conf->autoRestart(i);
|
||||
air_startmodes[i]=air_conf->startMode(i);
|
||||
air_startlogs[i]=air_conf->logName(i);
|
||||
air_autorestarts[i]=air_conf->autoRestart(i);
|
||||
air_logstartmode_box[i]->setCurrentItem(air_conf->logStartMode(i));
|
||||
}
|
||||
air_startmode_box->setCurrentItem((int)air_startmode[air_logmachine]);
|
||||
air_startlog_edit->setText(air_startlog[air_logmachine]);
|
||||
air_autorestart_box->setChecked(air_autorestart[air_logmachine]);
|
||||
for(int i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
air_startmodes[i+RD_RDVAIRPLAY_LOG_BASE]=
|
||||
air_conf->startMode(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
air_startlogs[i+RD_RDVAIRPLAY_LOG_BASE]=
|
||||
air_conf->logName(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
air_autorestarts[i+RD_RDVAIRPLAY_LOG_BASE]=
|
||||
air_conf->autoRestart(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
air_virtual_cards[i]=air_conf->virtualCard(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
air_virtual_ports[i]=air_conf->virtualPort(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
air_virtual_start_rmls[i]=
|
||||
air_conf->virtualStartRml(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
air_virtual_stop_rmls[i]=air_conf->virtualStopRml(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
air_virtual_opmodes[i]=air_conf->opMode(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
air_virtual_logstartmode_box->setCurrentItem((int)air_virtual_opmodes[0]);
|
||||
}
|
||||
air_virtual_card_sel->setCard(air_virtual_cards[air_virtual_logmachine]);
|
||||
air_virtual_card_sel->setPort(air_virtual_ports[air_virtual_logmachine]);
|
||||
air_virtual_start_rml_edit->
|
||||
setText(air_virtual_start_rmls[air_virtual_logmachine]);
|
||||
air_virtual_stop_rml_edit->
|
||||
setText(air_virtual_stop_rmls[air_virtual_logmachine]);
|
||||
air_startmode_box->setCurrentItem((int)air_startmodes[air_logmachine]);
|
||||
air_startlog_edit->setText(air_startlogs[air_logmachine]);
|
||||
air_autorestart_box->setChecked(air_autorestarts[air_logmachine]);
|
||||
air_skin_edit->setText(air_conf->skinPath());
|
||||
startModeChangedData(air_startmode[air_logmachine]);
|
||||
startModeChangedData(air_startmodes[air_logmachine]);
|
||||
|
||||
for(unsigned i=0;i<RDAirPlayConf::LastChannel;i++) {
|
||||
audioSettingsChangedData(i,air_card_sel[i]->card(),air_card_sel[i]->port());
|
||||
@ -911,7 +996,7 @@ EditRDAirPlay::~EditRDAirPlay()
|
||||
|
||||
QSize EditRDAirPlay::sizeHint() const
|
||||
{
|
||||
return QSize(1010,660);
|
||||
return QSize(1010,680);
|
||||
}
|
||||
|
||||
|
||||
@ -968,16 +1053,49 @@ void EditRDAirPlay::exitPasswordChangedData(const QString &str)
|
||||
|
||||
void EditRDAirPlay::logActivatedData(int lognum)
|
||||
{
|
||||
air_startmode[air_logmachine]=
|
||||
air_startmodes[air_logmachine]=
|
||||
(RDAirPlayConf::StartMode)air_startmode_box->currentItem();
|
||||
air_startlog[air_logmachine]=air_startlog_edit->text();
|
||||
air_autorestart[air_logmachine]=air_autorestart_box->isChecked();
|
||||
air_startlogs[air_logmachine]=air_startlog_edit->text();
|
||||
air_autorestarts[air_logmachine]=air_autorestart_box->isChecked();
|
||||
|
||||
air_logmachine=lognum;
|
||||
air_startmode_box->setCurrentItem((int)air_startmode[lognum]);
|
||||
air_startlog_edit->setText(air_startlog[lognum]);
|
||||
air_autorestart_box->setChecked(air_autorestart[lognum]);
|
||||
startModeChangedData((int)air_startmode[lognum]);
|
||||
if(lognum>2) {
|
||||
air_logmachine=lognum+RD_RDVAIRPLAY_LOG_BASE-3;
|
||||
}
|
||||
|
||||
air_startmode_box->setCurrentItem((int)air_startmodes[air_logmachine]);
|
||||
air_startlog_edit->setText(air_startlogs[air_logmachine]);
|
||||
air_autorestart_box->setChecked(air_autorestarts[air_logmachine]);
|
||||
startModeChangedData((int)air_startmodes[air_logmachine]);
|
||||
}
|
||||
|
||||
|
||||
void EditRDAirPlay::virtualLogActivatedData(int vlognum)
|
||||
{
|
||||
air_virtual_cards[air_virtual_logmachine]=air_virtual_card_sel->card();
|
||||
air_virtual_ports[air_virtual_logmachine]=air_virtual_card_sel->port();
|
||||
air_virtual_start_rmls[air_virtual_logmachine]=
|
||||
air_virtual_start_rml_edit->text();
|
||||
air_virtual_stop_rmls[air_virtual_logmachine]=
|
||||
air_virtual_stop_rml_edit->text();
|
||||
|
||||
air_virtual_logmachine=vlognum;
|
||||
air_virtual_card_sel->setCard(air_virtual_cards[air_virtual_logmachine]);
|
||||
air_virtual_card_sel->setPort(air_virtual_ports[air_virtual_logmachine]);
|
||||
air_virtual_start_rml_edit->
|
||||
setText(air_virtual_start_rmls[air_virtual_logmachine]);
|
||||
air_virtual_stop_rml_edit->
|
||||
setText(air_virtual_stop_rmls[air_virtual_logmachine]);
|
||||
}
|
||||
|
||||
|
||||
void EditRDAirPlay::virtualModeActivatedData(int vlognum)
|
||||
{
|
||||
air_virtual_opmodes[air_virtual_logstartmachine]=
|
||||
(RDAirPlayConf::OpMode)air_virtual_logstartmode_box->currentItem();
|
||||
air_virtual_logstartmachine=vlognum;
|
||||
air_virtual_logstartmode_box->
|
||||
setCurrentItem((int)air_virtual_opmodes[air_virtual_logstartmachine]);
|
||||
}
|
||||
|
||||
|
||||
@ -1120,20 +1238,37 @@ void EditRDAirPlay::okData()
|
||||
if(air_exitpasswd_changed) {
|
||||
air_conf->setExitPassword(air_exitpasswd_edit->text());
|
||||
}
|
||||
air_startmode[air_logmachine]=
|
||||
air_startmodes[air_logmachine]=
|
||||
(RDAirPlayConf::StartMode)air_startmode_box->currentItem();
|
||||
air_startlog[air_logmachine]=air_startlog_edit->text();
|
||||
air_autorestart[air_logmachine]=air_autorestart_box->isChecked();
|
||||
air_startlogs[air_logmachine]=air_startlog_edit->text();
|
||||
air_autorestarts[air_logmachine]=air_autorestart_box->isChecked();
|
||||
air_conf->setOpModeStyle((RDAirPlayConf::OpModeStyle)
|
||||
air_modecontrol_box->currentItem());
|
||||
for(int i=0;i<RDAIRPLAY_LOG_QUANTITY;i++) {
|
||||
air_conf->setStartMode(i,air_startmode[i]);
|
||||
air_conf->setLogName(i,air_startlog[i]);
|
||||
air_conf->setAutoRestart(i,air_autorestart[i]);
|
||||
air_conf->setStartMode(i,air_startmodes[i]);
|
||||
air_conf->setLogName(i,air_startlogs[i]);
|
||||
air_conf->setAutoRestart(i,air_autorestarts[i]);
|
||||
air_conf->
|
||||
setLogStartMode(i,(RDAirPlayConf::OpMode)air_logstartmode_box[i]->
|
||||
currentItem());
|
||||
}
|
||||
virtualLogActivatedData(air_virtual_logmachine);
|
||||
for(int i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
air_conf->setStartMode(i+RD_RDVAIRPLAY_LOG_BASE,
|
||||
air_startmodes[i+RD_RDVAIRPLAY_LOG_BASE]);
|
||||
air_conf->setLogName(i+RD_RDVAIRPLAY_LOG_BASE,
|
||||
air_startlogs[i+RD_RDVAIRPLAY_LOG_BASE]);
|
||||
air_conf->setAutoRestart(i+RD_RDVAIRPLAY_LOG_BASE,
|
||||
air_autorestarts[i+RD_RDVAIRPLAY_LOG_BASE]);
|
||||
air_conf->setVirtualCard(i+RD_RDVAIRPLAY_LOG_BASE,air_virtual_cards[i]);
|
||||
air_conf->setVirtualPort(i+RD_RDVAIRPLAY_LOG_BASE,air_virtual_ports[i]);
|
||||
air_conf->
|
||||
setVirtualStartRml(i+RD_RDVAIRPLAY_LOG_BASE,air_virtual_start_rmls[i]);
|
||||
air_conf->
|
||||
setVirtualStopRml(i+RD_RDVAIRPLAY_LOG_BASE,air_virtual_stop_rmls[i]);
|
||||
virtualModeActivatedData(air_virtual_logstartmachine);
|
||||
air_conf->setOpMode(i+RD_RDVAIRPLAY_LOG_BASE,air_virtual_opmodes[i]);
|
||||
}
|
||||
air_conf->setSkinPath(air_skin_edit->text());
|
||||
done(0);
|
||||
}
|
||||
@ -1149,7 +1284,7 @@ void EditRDAirPlay::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
QPainter *p=new QPainter(this);
|
||||
p->setPen(black);
|
||||
p->drawRect(25,415,395,95);
|
||||
p->drawRect(25,485,395,95);
|
||||
p->end();
|
||||
delete p;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Edit an RDAirPlay Configuration
|
||||
//
|
||||
// (C) Copyright 2002-2010,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2010,2016-2018 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
|
||||
@ -56,6 +56,8 @@ class EditRDAirPlay : public QDialog
|
||||
void editGpiosData(int num);
|
||||
void exitPasswordChangedData(const QString &str);
|
||||
void logActivatedData(int lognum);
|
||||
void virtualLogActivatedData(int vlognum);
|
||||
void virtualModeActivatedData(int vlognum);
|
||||
void startModeChangedData(int mode);
|
||||
void selectData();
|
||||
void nownextData();
|
||||
@ -77,8 +79,16 @@ class EditRDAirPlay : public QDialog
|
||||
QLabel *air_stop_rml_label[RDAirPlayConf::LastChannel];
|
||||
QLineEdit *air_stop_rml_edit[RDAirPlayConf::LastChannel];
|
||||
QPushButton *air_channel_button[RDAirPlayConf::LastChannel];
|
||||
// QLabel *air_startup_label;
|
||||
// QComboBox *air_startup_box;
|
||||
QComboBox *air_virtual_machine_box;
|
||||
RDCardSelector *air_virtual_card_sel;
|
||||
QLabel *air_virtual_start_rml_label;
|
||||
QLineEdit *air_virtual_start_rml_edit;
|
||||
QLabel *air_virtual_stop_rml_label;
|
||||
QLineEdit *air_virtual_stop_rml_edit;
|
||||
int air_virtual_cards[RD_RDVAIRPLAY_LOG_QUAN];
|
||||
int air_virtual_ports[RD_RDVAIRPLAY_LOG_QUAN];
|
||||
QString air_virtual_start_rmls[RD_RDVAIRPLAY_LOG_QUAN];
|
||||
QString air_virtual_stop_rmls[RD_RDVAIRPLAY_LOG_QUAN];
|
||||
QLabel *air_segue_label;
|
||||
QLineEdit *air_segue_edit;
|
||||
QLabel *air_trans_label;
|
||||
@ -117,15 +127,16 @@ class EditRDAirPlay : public QDialog
|
||||
QLineEdit *air_exitpasswd_edit;
|
||||
bool air_exitpasswd_changed;
|
||||
int air_logmachine;
|
||||
int air_virtual_logmachine;
|
||||
QComboBox *air_logmachine_box;
|
||||
QComboBox *air_startmode_box;
|
||||
RDAirPlayConf::StartMode air_startmode[RDAIRPLAY_LOG_QUANTITY];
|
||||
QMap<int,RDAirPlayConf::StartMode> air_startmodes;
|
||||
QLineEdit *air_startlog_edit;
|
||||
QLabel *air_startlog_label;
|
||||
QPushButton *air_startlog_button;
|
||||
QString air_startlog[RDAIRPLAY_LOG_QUANTITY];
|
||||
QMap<int,QString> air_startlogs;
|
||||
QCheckBox *air_autorestart_box;
|
||||
bool air_autorestart[RDAIRPLAY_LOG_QUANTITY];
|
||||
QMap<int,bool> air_autorestarts;
|
||||
QLabel *air_autorestart_label;
|
||||
QLineEdit *air_skin_edit;
|
||||
QLineEdit *air_title_template_edit;
|
||||
@ -135,6 +146,10 @@ class EditRDAirPlay : public QDialog
|
||||
QComboBox *air_modecontrol_box;
|
||||
QLabel *air_logstartmode_label[RDAIRPLAY_LOG_QUANTITY];
|
||||
QComboBox *air_logstartmode_box[RDAIRPLAY_LOG_QUANTITY];
|
||||
QComboBox *air_virtual_logstartsel_box;
|
||||
QComboBox *air_virtual_logstartmode_box;
|
||||
int air_virtual_logstartmachine;
|
||||
RDAirPlayConf::OpMode air_virtual_opmodes[RD_RDVAIRPLAY_LOG_QUAN];
|
||||
};
|
||||
|
||||
|
||||
|
@ -2670,6 +2670,14 @@ GPIOs</source>
|
||||
<source>System Panels:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Virtual Log Outputs</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Log Machine</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditRDLibrary</name>
|
||||
|
@ -2643,6 +2643,14 @@ GPIOs</source>
|
||||
<source>System Panels:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Virtual Log Outputs</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Log Machine</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditRDLibrary</name>
|
||||
|
@ -2664,6 +2664,14 @@ GPIOs</source>
|
||||
<source>System Panels:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Virtual Log Outputs</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Log Machine</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditRDLibrary</name>
|
||||
|
@ -2357,6 +2357,14 @@ GPIOs</source>
|
||||
<source>User Panels:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Virtual Log Outputs</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Log Machine</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditRDLibrary</name>
|
||||
|
@ -2639,6 +2639,14 @@ GPIOs</source>
|
||||
<source>System Panels:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Virtual Log Outputs</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Log Machine</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditRDLibrary</name>
|
||||
|
@ -2639,6 +2639,14 @@ GPIOs</source>
|
||||
<source>System Panels:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Virtual Log Outputs</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Log Machine</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditRDLibrary</name>
|
||||
|
@ -2631,6 +2631,14 @@ GPIOs</source>
|
||||
<source>System Panels:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Virtual Log Outputs</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Log Machine</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditRDLibrary</name>
|
||||
|
@ -305,6 +305,15 @@ MainObject::MainObject(QObject *parent)
|
||||
}
|
||||
delete q;
|
||||
|
||||
//
|
||||
// Start Subprocesses
|
||||
//
|
||||
if(fork()==0) {
|
||||
execl(QString(RD_PREFIX)+"/sbin/rdvairplayd","rdvairplayd",(char *)NULL);
|
||||
rda->log(RDConfig::LogWarning,QString("failed to start rdvairplayd(1) [")+
|
||||
strerror(errno)+"]");
|
||||
exit(1);
|
||||
}
|
||||
StartDropboxes();
|
||||
|
||||
//
|
||||
|
49
rdvairplayd/Makefile.am
Normal file
49
rdvairplayd/Makefile.am
Normal file
@ -0,0 +1,49 @@
|
||||
## Makefile.am
|
||||
##
|
||||
## Makefile for rdvairplayd(8)
|
||||
##
|
||||
## (C) Copyright 2018 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.
|
||||
##
|
||||
## Use automake to process this into a Makefile.in
|
||||
|
||||
AM_CPPFLAGS = -Wall -DPREFIX=\"$(prefix)\" -DQTDIR=\"@QT_DIR@\" @QT_CXXFLAGS@ -I$(top_srcdir)/lib
|
||||
LIBS = @QT_LIBS@ -L$(top_srcdir)/lib
|
||||
MOC = @QT_MOC@
|
||||
|
||||
# The dependency for qt's Meta Object Compiler (moc)
|
||||
moc_%.cpp: %.h
|
||||
$(MOC) $< -o $@
|
||||
|
||||
sbin_PROGRAMS = rdvairplayd
|
||||
|
||||
dist_rdvairplayd_SOURCES = local_macros.cpp\
|
||||
rdvairplayd.cpp rdvairplayd.h
|
||||
|
||||
nodist_rdvairplayd_SOURCES = moc_rdvairplayd.cpp
|
||||
|
||||
rdvairplayd_LDADD = @LIB_RDLIBS@ @LIBVORBIS@
|
||||
|
||||
CLEANFILES = *~\
|
||||
*.idb\
|
||||
*ilk\
|
||||
*.obj\
|
||||
*.pdb\
|
||||
*.qm\
|
||||
moc_*
|
||||
|
||||
MAINTAINERCLEANFILES = *~\
|
||||
Makefile.in\
|
||||
moc_*
|
563
rdvairplayd/local_macros.cpp
Normal file
563
rdvairplayd/local_macros.cpp
Normal file
@ -0,0 +1,563 @@
|
||||
// local_macros.cpp
|
||||
//
|
||||
// Local RML Macros for rdvairplayd(8)
|
||||
//
|
||||
// (C) Copyright 2002-2004,2016-2018 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 <stdio.h>
|
||||
|
||||
#include <rdapplication.h>
|
||||
#include <rddb.h>
|
||||
#include <rdescape_string.h>
|
||||
#include <rdmacro.h>
|
||||
|
||||
#include "rdvairplayd.h"
|
||||
|
||||
void MainObject::rmlReceivedData(RDMacro *rml)
|
||||
{
|
||||
QString logname;
|
||||
int fade;
|
||||
RDLogLine *logline=NULL;
|
||||
int index=-1;
|
||||
bool all_logs=false;
|
||||
int start;
|
||||
int end;
|
||||
int next_line;
|
||||
|
||||
if(rml->role()!=RDMacro::Cmd) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch(rml->command()) {
|
||||
case RDMacro::LL: // Load Log
|
||||
if((rml->argQuantity()<1)||(rml->argQuantity()>3)) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if((index=LogMachineIndex(rml->arg(0).toInt()))<0) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(rml->argQuantity()==1) { // Clear Log
|
||||
air_logs[index]->clear();
|
||||
rda->log(RDConfig::LogInfo,QString().sprintf("unloaded log machine %d",
|
||||
rml->arg(0).toInt()));
|
||||
}
|
||||
else { // Load Log
|
||||
logname=rml->arg(1).toString();
|
||||
if(!RDLog::exists(logname)) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
air_logs[index]->setLogName(RDLog::tableName(logname));
|
||||
air_logs[index]->load();
|
||||
rda->log(RDConfig::LogInfo,"loaded log \""+logname+"\" into log machine"+
|
||||
QString().sprintf(" %d",rml->arg(0).toInt()));
|
||||
}
|
||||
if(rml->argQuantity()==3) { // Start Log
|
||||
if(rml->arg(2).toInt()<air_logs[index]->size()) {
|
||||
if(rml->arg(2).toInt()>=0) { // Unconditional start
|
||||
air_logs[index]->play(rml->arg(2).toInt(),RDLogLine::StartMacro);
|
||||
rda->log(RDConfig::LogInfo,QString().
|
||||
sprintf("started log machine %d at line %d",
|
||||
rml->arg(0).toInt(),rml->arg(2).toInt()));
|
||||
}
|
||||
if(rml->arg(2).toInt()==-2) { // Start if trans type allows
|
||||
// Find first non-running event
|
||||
bool found=false;
|
||||
for(int i=0;i<air_logs[index]->size();i++) {
|
||||
if((logline=air_logs[index]->logLine(i))!=NULL) {
|
||||
if(logline->status()==RDLogLine::Scheduled) {
|
||||
found=true;
|
||||
i=air_logs[index]->size();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(found) {
|
||||
switch(logline->transType()) {
|
||||
case RDLogLine::Play:
|
||||
case RDLogLine::Segue:
|
||||
air_logs[index]->play(0,RDLogLine::StartMacro);
|
||||
rda->log(RDConfig::LogInfo,QString().
|
||||
sprintf("started log machine %d at line 0",
|
||||
rml->arg(0).toInt()));
|
||||
break;
|
||||
|
||||
case RDLogLine::Stop:
|
||||
case RDLogLine::NoTrans:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(true);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
break;
|
||||
|
||||
case RDMacro::AL: // Append Log
|
||||
if(rml->argQuantity()!=2) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if((index=LogMachineIndex(rml->arg(0).toInt()))<0) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
logname=rml->arg(1).toString();
|
||||
if(!RDLog::exists(logname)) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
air_logs[index]->append(logname);
|
||||
rda->log(RDConfig::LogInfo,QString("appended log \"")+logname+
|
||||
QString().sprintf("\" into log machine %d",rml->arg(0).toInt()));
|
||||
break;
|
||||
|
||||
case RDMacro::MN: // Make Next
|
||||
if(rml->argQuantity()!=2) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if((index=LogMachineIndex(rml->arg(0).toInt()))<0) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if((rml->arg(1).toInt()<0)||
|
||||
(rml->arg(1).toInt()>=air_logs[index]->size())) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
air_logs[index]->makeNext(rml->arg(1).toInt());
|
||||
rda->log(RDConfig::LogInfo,
|
||||
QString().sprintf("made line %d next in log machine %d",
|
||||
rml->arg(1).toInt(),rml->arg(0).toInt()));
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(true);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
break;
|
||||
|
||||
case RDMacro::PL: // Start
|
||||
if(rml->argQuantity()!=2) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if((index=LogMachineIndex(rml->arg(0).toInt()))<0) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if((rml->arg(1).toInt()<0)||
|
||||
(rml->arg(1).toInt()>=air_logs[index]->size())) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(!air_logs[index]->running()) {
|
||||
if(!air_logs[index]->play(rml->arg(1).toInt(),RDLogLine::StartMacro)) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
rda->log(RDConfig::LogInfo,QString().
|
||||
sprintf("started log machine %d at line %d",
|
||||
rml->arg(0).toInt(),rml->arg(1).toInt()));
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(true);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
break;
|
||||
|
||||
case RDMacro::PM: // Set Mode
|
||||
if((rml->argQuantity()!=1)&&(rml->argQuantity()!=2)) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(rml->argQuantity()==2) {
|
||||
if((index=LogMachineIndex(rml->arg(1).toInt()))<0) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
start=0;
|
||||
end=RD_RDVAIRPLAY_LOG_QUAN;
|
||||
if(index>=0) {
|
||||
start=index;
|
||||
end=index+1;
|
||||
}
|
||||
switch((RDAirPlayConf::OpMode)rml->arg(0).toInt()) {
|
||||
case RDAirPlayConf::LiveAssist:
|
||||
for(int i=start;i<end;i++) {
|
||||
SetLiveAssistMode(i);
|
||||
}
|
||||
break;
|
||||
|
||||
case RDAirPlayConf::Manual:
|
||||
for(int i=start;i<end;i++) {
|
||||
SetManualMode(i);
|
||||
}
|
||||
break;
|
||||
|
||||
case RDAirPlayConf::Auto:
|
||||
for(int i=start;i<end;i++) {
|
||||
SetAutoMode(i);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(true);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
break;
|
||||
|
||||
case RDMacro::PN: // Start Next
|
||||
if((rml->argQuantity()<1)||(rml->argQuantity()>3)) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if((index=LogMachineIndex(rml->arg(0).toInt()))<0) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(rml->argQuantity()>=2) {
|
||||
if((rml->arg(1).toInt()<1)||(rml->arg(1).toInt()>2)) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(rml->argQuantity()==3) {
|
||||
if((rml->arg(2).toInt()<0)||(rml->arg(2).toInt()>1)) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
next_line=air_logs[index]->nextLine();
|
||||
if(air_logs[index]->nextLine()>=0) {
|
||||
if(rml->argQuantity()==1) {
|
||||
air_logs[index]->
|
||||
play(air_logs[index]->nextLine(),RDLogLine::StartMacro);
|
||||
}
|
||||
else {
|
||||
if(rml->argQuantity()==2) {
|
||||
air_logs[index]->play(air_logs[index]->nextLine(),
|
||||
RDLogLine::StartMacro,rml->arg(1).toInt()-1);
|
||||
}
|
||||
else {
|
||||
air_logs[index]->
|
||||
play(air_logs[index]->nextLine(),RDLogLine::StartMacro,
|
||||
rml->arg(1).toInt()-1,rml->arg(2).toInt());
|
||||
}
|
||||
}
|
||||
rda->log(RDConfig::LogInfo,QString().
|
||||
sprintf("started log machine %d at line %d",
|
||||
rml->arg(0).toInt(),next_line));
|
||||
}
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(true);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
break;
|
||||
|
||||
case RDMacro::PS: // Stop
|
||||
if((rml->argQuantity()<1)||(rml->argQuantity()>3)) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
index=LogMachineIndex(rml->arg(0).toInt(),&all_logs);
|
||||
if((index<0)&(!all_logs)) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
fade=0;
|
||||
if(rml->argQuantity()>1) {
|
||||
fade=rml->arg(1).toInt();
|
||||
}
|
||||
if(all_logs) {
|
||||
for(int i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
air_logs[i]->stop(true,0,fade);
|
||||
}
|
||||
rda->log(RDConfig::LogInfo,"stopped all logs");
|
||||
}
|
||||
else {
|
||||
if(rml->argQuantity()==3) {
|
||||
air_logs[index]->stop(false,rml->arg(2).toInt(),fade);
|
||||
}
|
||||
else {
|
||||
air_logs[index]->stop(true,0,fade);
|
||||
}
|
||||
rda->log(RDConfig::LogInfo,QString().sprintf("stopped log machine %d",
|
||||
rml->arg(0).toInt()));
|
||||
break;
|
||||
}
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(true);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
break;
|
||||
|
||||
case RDMacro::MD: // Duck Machine
|
||||
if(rml->argQuantity()<3 || rml->argQuantity()>4) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
index=LogMachineIndex(rml->arg(0).toInt(),&all_logs);
|
||||
if((index<0)&&(!all_logs)) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(all_logs) {
|
||||
for(int i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
air_logs[i]->duckVolume(rml->arg(1).toInt()*100,rml->arg(2).toInt());
|
||||
}
|
||||
rda->log(RDConfig::LogInfo,QString().
|
||||
sprintf("set volumne of all log machines to %d dBFS",
|
||||
rml->arg(1).toInt()));
|
||||
}
|
||||
else {
|
||||
if(rml->argQuantity()==3) {
|
||||
air_logs[index]->
|
||||
duckVolume(rml->arg(1).toInt()*100,rml->arg(2).toInt());
|
||||
}
|
||||
else {
|
||||
air_logs[index]->duckVolume(rml->arg(1).toInt()*100,
|
||||
rml->arg(2).toInt(),rml->arg(3).toInt());
|
||||
}
|
||||
rda->log(RDConfig::LogInfo,QString().
|
||||
sprintf("set volumne of log machine %d to %d dBFS",
|
||||
rml->arg(0).toInt(),
|
||||
rml->arg(1).toInt()));
|
||||
break;
|
||||
}
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(true);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
break;
|
||||
|
||||
case RDMacro::PX: // Add Next
|
||||
if(rml->argQuantity()!=2) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
index=LogMachineIndex(rml->arg(0).toInt());
|
||||
if((index<0)||(rml->arg(1).toUInt()>999999)) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
next_line=air_logs[index]->nextLine();
|
||||
if(air_logs[index]->nextLine()>=0) {
|
||||
air_logs[index]->insert(air_logs[index]->nextLine(),
|
||||
rml->arg(1).toUInt(),RDLogLine::Play);
|
||||
rda->log(RDConfig::LogInfo,QString().
|
||||
sprintf("inserted cart %06u at line %d on log machine %d",
|
||||
rml->arg(1).toUInt(),next_line,rml->arg(0).toInt()));
|
||||
}
|
||||
else {
|
||||
air_logs[index]->insert(air_logs[index]->size(),
|
||||
rml->arg(1).toUInt(),RDLogLine::Play);
|
||||
air_logs[index]->makeNext(air_logs[index]->size()-1);
|
||||
rda->log(RDConfig::LogInfo,QString().
|
||||
sprintf("inserted cart %06u at line %d on log machine %d",
|
||||
rml->arg(1).toUInt(),air_logs[index]->size()-1,
|
||||
rml->arg(0).toInt()));
|
||||
}
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(true);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
break;
|
||||
|
||||
case RDMacro::RL: // Refresh Log
|
||||
if(rml->argQuantity()!=1) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if((index=LogMachineIndex(rml->arg(0).toInt()))<0) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(!air_logs[index]->refresh()) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else {
|
||||
rda->log(RDConfig::LogInfo,QString().sprintf("refreshed log machine %d",
|
||||
rml->arg(0).toInt()));
|
||||
}
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(true);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
break;
|
||||
|
||||
case RDMacro::SN: // Set default Now & Next Cart
|
||||
if(rml->argQuantity()!=3) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if((rml->arg(0).toString().lower()!="now")&&
|
||||
(rml->arg(0).toString().lower()!="next")) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if((index=LogMachineIndex(rml->arg(1).toInt()))<0) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(rml->arg(2).toUInt()>999999) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(rml->arg(0).toString().lower()=="now") {
|
||||
air_logs[index]->setNowCart(rml->arg(2).toUInt());
|
||||
rda->log(RDConfig::LogInfo,QString().
|
||||
sprintf("set default \"now\" cart to %06u on log machine %d",
|
||||
rml->arg(2).toUInt(),rml->arg(1).toInt()));
|
||||
}
|
||||
else {
|
||||
air_logs[index]->setNextCart(rml->arg(2).toUInt());
|
||||
rda->log(RDConfig::LogInfo,QString().
|
||||
sprintf("set default \"next\" cart to %06u on log machine %d",
|
||||
rml->arg(2).toUInt(),rml->arg(1).toInt()));
|
||||
}
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(true);
|
||||
rda->ripc()->sendRml(rml);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int MainObject::LogMachineIndex(int log_mach,bool *all) const
|
||||
{
|
||||
if((log_mach<=RD_RDVAIRPLAY_LOG_BASE)||
|
||||
(log_mach>RD_RDVAIRPLAY_LOG_BASE+RD_RDVAIRPLAY_LOG_QUAN)) {
|
||||
return -1;
|
||||
}
|
||||
if(all!=NULL) {
|
||||
*all=log_mach-RD_RDVAIRPLAY_LOG_BASE==0;
|
||||
}
|
||||
return log_mach-RD_RDVAIRPLAY_LOG_BASE-1;
|
||||
}
|
385
rdvairplayd/rdvairplayd.cpp
Normal file
385
rdvairplayd/rdvairplayd.cpp
Normal file
@ -0,0 +1,385 @@
|
||||
// rdvairplayd.cpp
|
||||
//
|
||||
// Headless log player
|
||||
//
|
||||
// (C) Copyright 2018 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 <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <qapplication.h>
|
||||
|
||||
#include <rdapplication.h>
|
||||
#include <rdcheck_daemons.h>
|
||||
#include <rdconf.h>
|
||||
#include <rddatedecode.h>
|
||||
#include <rddbheartbeat.h>
|
||||
#include <rdescape_string.h>
|
||||
#include <rdmixer.h>
|
||||
#include <rdweb.h>
|
||||
|
||||
#include "rdvairplayd.h"
|
||||
|
||||
bool global_exiting=false;
|
||||
|
||||
void SigHandler(int signo)
|
||||
{
|
||||
switch(signo) {
|
||||
case SIGINT:
|
||||
case SIGTERM:
|
||||
global_exiting=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MainObject::MainObject(QObject *parent)
|
||||
:QObject(parent)
|
||||
{
|
||||
QString err_msg;
|
||||
|
||||
//
|
||||
// Ensure that system daemons are running
|
||||
//
|
||||
RDInitializeDaemons();
|
||||
|
||||
//
|
||||
// Startup DateTime
|
||||
//
|
||||
air_startup_datetime=QDateTime::currentDateTime();
|
||||
|
||||
//
|
||||
// Open the Database
|
||||
//
|
||||
rda=new RDApplication("rdvairplayd","rdvairplayd",RDVAIRPLAYD_USAGE,this);
|
||||
if(!rda->open(&err_msg)) {
|
||||
fprintf(stderr,"rdvairplayd: %s\n",(const char *)err_msg);
|
||||
exit(1);
|
||||
}
|
||||
air_previous_exit_code=rda->airplayConf()->virtualExitCode();
|
||||
rda->airplayConf()->setVirtualExitCode(RDAirPlayConf::ExitDirty);
|
||||
|
||||
//
|
||||
// Read Command Options
|
||||
//
|
||||
for(unsigned i=0;i<rda->cmdSwitch()->keys();i++) {
|
||||
if(!rda->cmdSwitch()->processed(i)) {
|
||||
fprintf(stderr,"rdvairplayd: unknown command option \"%s\"\n",
|
||||
(const char *)rda->cmdSwitch()->key(i));
|
||||
exit(2);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// CAE Connection
|
||||
//
|
||||
rda->cae()->connectHost();
|
||||
|
||||
//
|
||||
// Set Audio Assignments
|
||||
//
|
||||
// air_segue_length=rda->airplayConf()->segueLength()+1;
|
||||
RDSetMixerPorts(rda->config()->stationName(),rda->cae());
|
||||
|
||||
//
|
||||
// RIPC Connection
|
||||
//
|
||||
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 *)));
|
||||
// connect(rda->ripc(),SIGNAL(gpiStateChanged(int,int,bool)),
|
||||
// this,SLOT(gpiStateChangedData(int,int,bool)));
|
||||
rda->ripc()->
|
||||
connectHost("localhost",RIPCD_TCP_PORT,rda->config()->password());
|
||||
|
||||
//
|
||||
// Macro Player
|
||||
//
|
||||
air_event_player=new RDEventPlayer(rda->ripc(),this);
|
||||
|
||||
//
|
||||
// UDP Transmission Socket
|
||||
//
|
||||
air_nownext_socket=new QSocketDevice(QSocketDevice::Datagram);
|
||||
|
||||
//
|
||||
// Log Machines
|
||||
//
|
||||
QSignalMapper *reload_mapper=new QSignalMapper(this);
|
||||
connect(reload_mapper,SIGNAL(mapped(int)),this,SLOT(logReloadedData(int)));
|
||||
QSignalMapper *rename_mapper=new QSignalMapper(this);
|
||||
QString default_svcname=rda->airplayConf()->defaultSvc();
|
||||
for(int i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
air_logs[i]=new RDLogPlay(i+RD_RDVAIRPLAY_LOG_BASE,air_event_player,
|
||||
air_nownext_socket,"",&air_plugin_hosts);
|
||||
air_logs[i]->setDefaultServiceName(default_svcname);
|
||||
//
|
||||
// FIXME: Add the ability to specify default carts for vLogs!
|
||||
//
|
||||
air_logs[i]->setNowCart(rda->airplayConf()->logNowCart(i));
|
||||
air_logs[i]->setNextCart(rda->airplayConf()->logNextCart(i));
|
||||
reload_mapper->setMapping(air_logs[i],i);
|
||||
connect(air_logs[i],SIGNAL(reloaded()),reload_mapper,SLOT(map()));
|
||||
rename_mapper->setMapping(air_logs[i],i);
|
||||
connect(air_logs[i],SIGNAL(renamed()),rename_mapper,SLOT(map()));
|
||||
// connect(air_logs[i],SIGNAL(refreshStatusChanged(bool)),
|
||||
// this,SLOT(refreshStatusChangedData(bool)));
|
||||
// connect(air_logs[i],SIGNAL(channelStarted(int,int,int,int)),
|
||||
// this,SLOT(logChannelStartedData(int,int,int,int)));
|
||||
// connect(air_logs[i],SIGNAL(channelStopped(int,int,int,int)),
|
||||
// this,SLOT(logChannelStoppedData(int,int,int,int)));
|
||||
int cards[2]={0,0};
|
||||
cards[0]=rda->airplayConf()->virtualCard(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
cards[1]=rda->airplayConf()->virtualCard(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
int ports[2]={0,0};
|
||||
ports[0]=rda->airplayConf()->virtualPort(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
ports[1]=rda->airplayConf()->virtualPort(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
QString start_rml[2]={"",""};
|
||||
start_rml[0]=rda->airplayConf()->virtualStartRml(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
start_rml[1]=rda->airplayConf()->virtualStartRml(i+RD_RDVAIRPLAY_LOG_BASE);
|
||||
QString stop_rml[2]={"",""};
|
||||
stop_rml[0]=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]->
|
||||
setOpMode(rda->airplayConf()->opMode(i+RD_RDVAIRPLAY_LOG_BASE));
|
||||
}
|
||||
// connect(air_logs[0],SIGNAL(transportChanged()),
|
||||
// this,SLOT(transportChangedData()));
|
||||
|
||||
//
|
||||
// Load Plugins
|
||||
//
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
|
||||
sql=QString("select ")+
|
||||
"PLUGIN_PATH,"+
|
||||
"PLUGIN_ARG "+
|
||||
"from NOWNEXT_PLUGINS where "+
|
||||
"(STATION_NAME=\""+RDEscapeString(rda->config()->stationName())+"\")&&"+
|
||||
"(LOG_MACHINE=0)";
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
air_plugin_hosts.
|
||||
push_back(new RDRLMHost(q->value(0).toString(),q->value(1).toString(),
|
||||
air_nownext_socket,this));
|
||||
rda->log(RDConfig::LogInfo,QString().
|
||||
sprintf("Loading RLM \"%s\"",
|
||||
(const char *)q->value(0).toString()));
|
||||
if(!air_plugin_hosts.back()->load()) {
|
||||
rda->log(RDConfig::LogWarning,QString().
|
||||
sprintf("Failed to load RLM \"%s\"",
|
||||
(const char *)q->value(0).toString()));
|
||||
}
|
||||
}
|
||||
delete q;
|
||||
|
||||
//
|
||||
// Exit Timer
|
||||
//
|
||||
air_exit_timer=new QTimer(this);
|
||||
connect(air_exit_timer, SIGNAL(timeout()),this,SLOT(exitData()));
|
||||
air_exit_timer->start(100);
|
||||
::signal(SIGINT,SigHandler);
|
||||
::signal(SIGTERM,SigHandler);
|
||||
}
|
||||
|
||||
|
||||
void MainObject::ripcConnectedData(bool state)
|
||||
{
|
||||
QHostAddress addr;
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
RDMacro rml;
|
||||
rml.setRole(RDMacro::Cmd);
|
||||
addr.setAddress("127.0.0.1");
|
||||
rml.setAddress(addr);
|
||||
rml.setEchoRequested(false);
|
||||
|
||||
//
|
||||
// Get Onair Flag State
|
||||
//
|
||||
rda->ripc()->sendOnairFlag();
|
||||
|
||||
//
|
||||
// Load Initial Logs
|
||||
//
|
||||
for(unsigned i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
int mach=i+RD_RDVAIRPLAY_LOG_BASE;
|
||||
switch(rda->airplayConf()->startMode(mach)) {
|
||||
case RDAirPlayConf::StartEmpty:
|
||||
break;
|
||||
|
||||
case RDAirPlayConf::StartPrevious:
|
||||
air_start_lognames[i]=RDDateTimeDecode(rda->airplayConf()->currentLog(mach),
|
||||
air_startup_datetime,rda->station(),rda->config());
|
||||
if(!air_start_lognames[i].isEmpty()) {
|
||||
if(air_previous_exit_code==RDAirPlayConf::ExitDirty) {
|
||||
if((air_start_lines[i]=rda->airplayConf()->logCurrentLine(mach))>=0) {
|
||||
air_start_starts[i]=rda->airplayConf()->autoRestart(mach)&&
|
||||
rda->airplayConf()->logRunning(mach);
|
||||
}
|
||||
}
|
||||
else {
|
||||
air_start_lines[i]=0;
|
||||
air_start_starts[i]=false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case RDAirPlayConf::StartSpecified:
|
||||
air_start_lognames[i]=RDDateTimeDecode(rda->airplayConf()->logName(mach),
|
||||
air_startup_datetime,rda->station(),
|
||||
rda->config());
|
||||
if(!air_start_lognames[i].isEmpty()) {
|
||||
if(air_previous_exit_code==RDAirPlayConf::ExitDirty) {
|
||||
if(air_start_lognames[i]==rda->airplayConf()->currentLog(mach)) {
|
||||
if((air_start_lines[i]=rda->airplayConf()->logCurrentLine(mach))>=0) {
|
||||
air_start_starts[i]=rda->airplayConf()->autoRestart(mach)&&
|
||||
rda->airplayConf()->logRunning(mach);
|
||||
}
|
||||
else {
|
||||
air_start_lines[i]=0;
|
||||
air_start_starts[i]=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if(!air_start_lognames[i].isEmpty()) {
|
||||
sql=QString("select NAME from LOGS where ")+
|
||||
"NAME=\""+RDEscapeString(air_start_lognames[i])+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
rml.setCommand(RDMacro::LL); // Load Log
|
||||
rml.setArgQuantity(2);
|
||||
rml.setArg(0,mach+1);
|
||||
rml.setArg(1,air_start_lognames[i]);
|
||||
rda->ripc()->sendRml(&rml);
|
||||
}
|
||||
else {
|
||||
rda->log(RDConfig::LogWarning,QString().sprintf("vlog %d: ",mach+1)+
|
||||
"log \""+air_start_lognames[i]+"\" doesn't exist");
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainObject::userData()
|
||||
{
|
||||
// printf("User connected!\n");
|
||||
}
|
||||
|
||||
|
||||
void MainObject::logReloadedData(int log)
|
||||
{
|
||||
QHostAddress addr;
|
||||
int mach=log+RD_RDVAIRPLAY_LOG_BASE;
|
||||
|
||||
//
|
||||
// Load Initial Log
|
||||
//
|
||||
if(air_start_lognames[log].isEmpty()) {
|
||||
return;
|
||||
}
|
||||
RDMacro rml;
|
||||
rml.setRole(RDMacro::Cmd);
|
||||
addr.setAddress("127.0.0.1");
|
||||
rml.setAddress(addr);
|
||||
rml.setEchoRequested(false);
|
||||
|
||||
if(air_start_lines[log]<air_logs[log]->size()) {
|
||||
rml.setCommand(RDMacro::MN); // Make Next
|
||||
rml.setArgQuantity(2);
|
||||
rml.setArg(0,mach+1);
|
||||
rml.setArg(1,air_start_lines[log]);
|
||||
rda->ripc()->sendRml(&rml);
|
||||
|
||||
if(air_start_starts[log]) {
|
||||
rml.setCommand(RDMacro::PN); // Start Next
|
||||
rml.setArgQuantity(1);
|
||||
rml.setArg(0,mach+1);
|
||||
rda->ripc()->sendRml(&rml);
|
||||
}
|
||||
}
|
||||
else {
|
||||
rda->log(RDConfig::LogWarning,QString().sprintf("vlog %d: ",mach+1)+
|
||||
QString().sprintf("line %d doesn't exist ",air_start_lines[log])+
|
||||
"in log \""+air_start_lognames[log]+"\"");
|
||||
}
|
||||
air_start_lognames[log]="";
|
||||
}
|
||||
|
||||
|
||||
void MainObject::exitData()
|
||||
{
|
||||
if(global_exiting) {
|
||||
for(unsigned i=0;i<air_plugin_hosts.size();i++) {
|
||||
air_plugin_hosts[i]->unload();
|
||||
}
|
||||
for(int i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||
delete air_logs[i];
|
||||
}
|
||||
rda->airplayConf()->setVirtualExitCode(RDAirPlayConf::ExitClean);
|
||||
rda->log(RDConfig::LogInfo,"exiting");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainObject::SetAutoMode(int index)
|
||||
{
|
||||
air_logs[index]->setOpMode(RDAirPlayConf::Auto);
|
||||
rda->log(RDConfig::LogInfo,
|
||||
QString().sprintf("log machine %d mode set to AUTOMATIC",
|
||||
index+RD_RDVAIRPLAY_LOG_BASE+1));
|
||||
}
|
||||
|
||||
|
||||
void MainObject::SetLiveAssistMode(int index)
|
||||
{
|
||||
air_logs[index]->setOpMode(RDAirPlayConf::LiveAssist);
|
||||
rda->log(RDConfig::LogInfo,
|
||||
QString().sprintf("log machine %d mode set to LIVE ASSIST",
|
||||
index+RD_RDVAIRPLAY_LOG_BASE+1));
|
||||
}
|
||||
|
||||
|
||||
void MainObject::SetManualMode(int index)
|
||||
{
|
||||
air_logs[index]->setOpMode(RDAirPlayConf::Manual);
|
||||
rda->log(RDConfig::LogInfo,
|
||||
QString().sprintf("log machine %d mode set to MANUAL",
|
||||
index+RD_RDVAIRPLAY_LOG_BASE+1));
|
||||
}
|
||||
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
QApplication a(argc,argv,false);
|
||||
new MainObject();
|
||||
return a.exec();
|
||||
}
|
66
rdvairplayd/rdvairplayd.h
Normal file
66
rdvairplayd/rdvairplayd.h
Normal file
@ -0,0 +1,66 @@
|
||||
// rdvairplayd.h
|
||||
//
|
||||
// Headless log player
|
||||
//
|
||||
// (C) Copyright 2018 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 RDVAIRPLAYD_H
|
||||
#define RDVAIRPLAYD_H
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qsocketdevice.h>
|
||||
|
||||
#include <rdevent_player.h>
|
||||
#include <rd.h>
|
||||
#include <rdlogplay.h>
|
||||
#include <rdmacro.h>
|
||||
#include <rdrlmhost.h>
|
||||
|
||||
#define RDVAIRPLAYD_USAGE "[options]\n"
|
||||
|
||||
class MainObject : public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
public:
|
||||
MainObject(QObject *parent=0);
|
||||
|
||||
private slots:
|
||||
void ripcConnectedData(bool state);
|
||||
void userData();
|
||||
void rmlReceivedData(RDMacro*);
|
||||
void logReloadedData(int log);
|
||||
void exitData();
|
||||
|
||||
private:
|
||||
void SetAutoMode(int index);
|
||||
void SetLiveAssistMode(int index);
|
||||
void SetManualMode(int index);
|
||||
int LogMachineIndex(int log_mach,bool *all=NULL) const;
|
||||
RDLogPlay *air_logs[RD_RDVAIRPLAY_LOG_QUAN];
|
||||
QString air_start_lognames[RD_RDVAIRPLAY_LOG_QUAN];
|
||||
int air_start_lines[RD_RDVAIRPLAY_LOG_QUAN];
|
||||
bool air_start_starts[RD_RDVAIRPLAY_LOG_QUAN];
|
||||
std::vector<RDRLMHost *> air_plugin_hosts;
|
||||
RDEventPlayer *air_event_player;
|
||||
QSocketDevice *air_nownext_socket;
|
||||
QDateTime air_startup_datetime;
|
||||
RDAirPlayConf::ExitCode air_previous_exit_code;
|
||||
QTimer *air_exit_timer;
|
||||
};
|
||||
|
||||
|
||||
#endif // RDVAIRPLAYD_H
|
@ -2,7 +2,7 @@
|
||||
##
|
||||
## Rivendell init script for LSB and chkconfig(8) compliant Linux systems.
|
||||
##
|
||||
## (C) Copyright 2002-2006,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
## (C) Copyright 2002-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of version 2 of the GNU General Public License as
|
||||
@ -78,6 +78,7 @@ function StartDaemons {
|
||||
|
||||
function StopDaemons {
|
||||
killall rdimport > /dev/null 2> /dev/null
|
||||
killall rdvairplayd > /dev/null 2> /dev/null
|
||||
if [ -f /var/run/rivendell/rdcatchd.pid ] ; then
|
||||
kill `cat /var/run/rivendell/rdcatchd.pid` > /dev/null 2> /dev/null
|
||||
fi
|
||||
|
@ -1,7 +1,7 @@
|
||||
## rivendell.spec.in
|
||||
##
|
||||
## The Rivendell Radio Automation System
|
||||
## Copyright (C) 2002-2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
## Copyright (C) 2002-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of version 2 of the GNU General Public License as
|
||||
@ -413,6 +413,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
@LOCAL_PREFIX@/@RD_LIB_PATH@/librd.la
|
||||
@LOCAL_PREFIX@/@RD_LIB_PATH@/librd.so
|
||||
%attr(4755,root,root) @LOCAL_PREFIX@/bin/caed
|
||||
@LOCAL_PREFIX@/sbin/rdvairplayd
|
||||
/etc/init.d/rivendell
|
||||
%config /etc/sysconfig/rivendell
|
||||
@HPI_FILE1@
|
||||
|
13
rlm/rlm.h
13
rlm/rlm.h
@ -2,7 +2,7 @@
|
||||
*
|
||||
* The Rivendell Loadable Module Interface
|
||||
*
|
||||
* (C) Copyright 2008-2013 Fred Gleason <fredg@paravelsystems.com>
|
||||
* (C) Copyright 2008-2018 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
|
||||
@ -80,7 +80,7 @@ extern "C" {
|
||||
/*
|
||||
* RLM Interface Version
|
||||
*/
|
||||
#define RLM_VERSION 17
|
||||
#define RLM_VERSION 18
|
||||
|
||||
/*
|
||||
* Available Timers
|
||||
@ -126,6 +126,12 @@ extern "C" {
|
||||
#define RLM_ENCODE_XML 1
|
||||
#define RLM_ENCODE_URL 2
|
||||
|
||||
/*
|
||||
* Virtual Logs
|
||||
*
|
||||
*/
|
||||
#define RLM_VLOG_QUANTITY 20
|
||||
|
||||
/*
|
||||
* Service data structure
|
||||
*/
|
||||
@ -140,7 +146,8 @@ extern "C" {
|
||||
*/
|
||||
struct rlm_log {
|
||||
char log_name[65]; /* Log name */
|
||||
uint32_t log_mach; /* Log machine number, 0=Main, 1=Aux 1, 2=Aux2 */
|
||||
uint32_t log_mach; /* Log machine number, 0=Main, 1=Aux 1, 2=Aux2,
|
||||
* 100 - 119=vLogs */
|
||||
char log_onair; /* On-air flag, 0=False, 1=True */
|
||||
uint32_t log_mode; /* Log machine mode, 1=LiveAssist, 2=Automatic, 3=Manual */
|
||||
char reserved[1974]; /* Reserved for future use */
|
||||
|
@ -46,7 +46,26 @@ char *rlm_icecast2_formats;
|
||||
int *rlm_icecast2_masters;
|
||||
int *rlm_icecast2_aux1s;
|
||||
int *rlm_icecast2_aux2s;
|
||||
|
||||
int *rlm_icecast2_vlog101s;
|
||||
int *rlm_icecast2_vlog102s;
|
||||
int *rlm_icecast2_vlog103s;
|
||||
int *rlm_icecast2_vlog104s;
|
||||
int *rlm_icecast2_vlog105s;
|
||||
int *rlm_icecast2_vlog106s;
|
||||
int *rlm_icecast2_vlog107s;
|
||||
int *rlm_icecast2_vlog108s;
|
||||
int *rlm_icecast2_vlog109s;
|
||||
int *rlm_icecast2_vlog110s;
|
||||
int *rlm_icecast2_vlog111s;
|
||||
int *rlm_icecast2_vlog112s;
|
||||
int *rlm_icecast2_vlog113s;
|
||||
int *rlm_icecast2_vlog114s;
|
||||
int *rlm_icecast2_vlog115s;
|
||||
int *rlm_icecast2_vlog116s;
|
||||
int *rlm_icecast2_vlog117s;
|
||||
int *rlm_icecast2_vlog118s;
|
||||
int *rlm_icecast2_vlog119s;
|
||||
int *rlm_icecast2_vlog120s;
|
||||
|
||||
int rlm_icecast2_BufferDiff(char *sString,int dOrigin,int dDiff,int dMaxSize)
|
||||
{
|
||||
@ -172,6 +191,26 @@ void rlm_icecast2_RLMStart(void *ptr,const char *arg)
|
||||
rlm_icecast2_masters=NULL;
|
||||
rlm_icecast2_aux1s=NULL;
|
||||
rlm_icecast2_aux2s=NULL;
|
||||
rlm_icecast2_vlog101s=NULL;
|
||||
rlm_icecast2_vlog102s=NULL;
|
||||
rlm_icecast2_vlog103s=NULL;
|
||||
rlm_icecast2_vlog104s=NULL;
|
||||
rlm_icecast2_vlog105s=NULL;
|
||||
rlm_icecast2_vlog106s=NULL;
|
||||
rlm_icecast2_vlog107s=NULL;
|
||||
rlm_icecast2_vlog108s=NULL;
|
||||
rlm_icecast2_vlog109s=NULL;
|
||||
rlm_icecast2_vlog110s=NULL;
|
||||
rlm_icecast2_vlog111s=NULL;
|
||||
rlm_icecast2_vlog112s=NULL;
|
||||
rlm_icecast2_vlog113s=NULL;
|
||||
rlm_icecast2_vlog114s=NULL;
|
||||
rlm_icecast2_vlog115s=NULL;
|
||||
rlm_icecast2_vlog116s=NULL;
|
||||
rlm_icecast2_vlog117s=NULL;
|
||||
rlm_icecast2_vlog118s=NULL;
|
||||
rlm_icecast2_vlog119s=NULL;
|
||||
rlm_icecast2_vlog120s=NULL;
|
||||
|
||||
sprintf(section,"Icecast%d",i++);
|
||||
strncpy(username,RLMGetStringValue(ptr,arg,section,"Username",""),255);
|
||||
@ -216,6 +255,107 @@ void rlm_icecast2_RLMStart(void *ptr,const char *arg)
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_aux2s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"Aux2Log");
|
||||
rlm_icecast2_vlog101s=realloc(rlm_icecast2_vlog101s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog101s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog101");
|
||||
|
||||
rlm_icecast2_vlog102s=realloc(rlm_icecast2_vlog102s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog102s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog102");
|
||||
|
||||
rlm_icecast2_vlog103s=realloc(rlm_icecast2_vlog103s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog103s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog103");
|
||||
|
||||
rlm_icecast2_vlog104s=realloc(rlm_icecast2_vlog104s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog104s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog104");
|
||||
|
||||
rlm_icecast2_vlog105s=realloc(rlm_icecast2_vlog105s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog105s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog105");
|
||||
|
||||
rlm_icecast2_vlog106s=realloc(rlm_icecast2_vlog106s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog106s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog106");
|
||||
|
||||
rlm_icecast2_vlog107s=realloc(rlm_icecast2_vlog107s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog107s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog107");
|
||||
|
||||
rlm_icecast2_vlog108s=realloc(rlm_icecast2_vlog108s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog108s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog108");
|
||||
|
||||
rlm_icecast2_vlog109s=realloc(rlm_icecast2_vlog109s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog109s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog109");
|
||||
|
||||
rlm_icecast2_vlog110s=realloc(rlm_icecast2_vlog110s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog110s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog110");
|
||||
|
||||
rlm_icecast2_vlog111s=realloc(rlm_icecast2_vlog111s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog111s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog111");
|
||||
|
||||
rlm_icecast2_vlog112s=realloc(rlm_icecast2_vlog112s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog112s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog112");
|
||||
|
||||
rlm_icecast2_vlog113s=realloc(rlm_icecast2_vlog113s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog113s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog113");
|
||||
|
||||
rlm_icecast2_vlog114s=realloc(rlm_icecast2_vlog114s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog114s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog114");
|
||||
|
||||
rlm_icecast2_vlog115s=realloc(rlm_icecast2_vlog115s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog115s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog115");
|
||||
|
||||
rlm_icecast2_vlog116s=realloc(rlm_icecast2_vlog116s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog116s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog116");
|
||||
|
||||
rlm_icecast2_vlog117s=realloc(rlm_icecast2_vlog117s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog117s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog117");
|
||||
|
||||
rlm_icecast2_vlog118s=realloc(rlm_icecast2_vlog118s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog118s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog118");
|
||||
|
||||
rlm_icecast2_vlog119s=realloc(rlm_icecast2_vlog119s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog119s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog119");
|
||||
|
||||
rlm_icecast2_vlog120s=realloc(rlm_icecast2_vlog120s,
|
||||
(rlm_icecast2_devs+1)*sizeof(int));
|
||||
rlm_icecast2_vlog120s[rlm_icecast2_devs]=
|
||||
rlm_icecast2_GetLogStatus(ptr,arg,section,"VLog120");
|
||||
|
||||
|
||||
sprintf(errtext,"rlm_icecast2: configured mountpoint \"http://%s:%u%s\"",
|
||||
rlm_icecast2_hostnames+256*rlm_icecast2_devs,
|
||||
rlm_icecast2_tcpports[rlm_icecast2_devs],
|
||||
@ -240,6 +380,26 @@ void rlm_icecast2_RLMFree(void *ptr)
|
||||
free(rlm_icecast2_masters);
|
||||
free(rlm_icecast2_aux1s);
|
||||
free(rlm_icecast2_aux2s);
|
||||
free(rlm_icecast2_vlog101s);
|
||||
free(rlm_icecast2_vlog102s);
|
||||
free(rlm_icecast2_vlog103s);
|
||||
free(rlm_icecast2_vlog104s);
|
||||
free(rlm_icecast2_vlog105s);
|
||||
free(rlm_icecast2_vlog106s);
|
||||
free(rlm_icecast2_vlog107s);
|
||||
free(rlm_icecast2_vlog108s);
|
||||
free(rlm_icecast2_vlog109s);
|
||||
free(rlm_icecast2_vlog110s);
|
||||
free(rlm_icecast2_vlog111s);
|
||||
free(rlm_icecast2_vlog112s);
|
||||
free(rlm_icecast2_vlog113s);
|
||||
free(rlm_icecast2_vlog114s);
|
||||
free(rlm_icecast2_vlog115s);
|
||||
free(rlm_icecast2_vlog116s);
|
||||
free(rlm_icecast2_vlog117s);
|
||||
free(rlm_icecast2_vlog118s);
|
||||
free(rlm_icecast2_vlog119s);
|
||||
free(rlm_icecast2_vlog120s);
|
||||
}
|
||||
|
||||
|
||||
@ -257,17 +417,97 @@ void rlm_icecast2_RLMPadDataSent(void *ptr,const struct rlm_svc *svc,
|
||||
|
||||
for(i=0;i<rlm_icecast2_devs;i++) {
|
||||
switch(log->log_mach) {
|
||||
case 0:
|
||||
flag=rlm_icecast2_masters[i];
|
||||
break;
|
||||
case 0:
|
||||
flag=rlm_icecast2_masters[i];
|
||||
break;
|
||||
|
||||
case 1:
|
||||
flag=rlm_icecast2_aux1s[i];
|
||||
break;
|
||||
case 1:
|
||||
flag=rlm_icecast2_aux1s[i];
|
||||
break;
|
||||
|
||||
case 2:
|
||||
flag=rlm_icecast2_aux2s[i];
|
||||
break;
|
||||
case 2:
|
||||
flag=rlm_icecast2_aux2s[i];
|
||||
break;
|
||||
|
||||
case 100:
|
||||
flag=rlm_icecast2_vlog101s[i];
|
||||
break;
|
||||
|
||||
case 101:
|
||||
flag=rlm_icecast2_vlog102s[i];
|
||||
break;
|
||||
|
||||
case 102:
|
||||
flag=rlm_icecast2_vlog103s[i];
|
||||
break;
|
||||
|
||||
case 103:
|
||||
flag=rlm_icecast2_vlog104s[i];
|
||||
break;
|
||||
|
||||
case 104:
|
||||
flag=rlm_icecast2_vlog105s[i];
|
||||
break;
|
||||
|
||||
case 105:
|
||||
flag=rlm_icecast2_vlog106s[i];
|
||||
break;
|
||||
|
||||
case 106:
|
||||
flag=rlm_icecast2_vlog107s[i];
|
||||
break;
|
||||
|
||||
case 107:
|
||||
flag=rlm_icecast2_vlog108s[i];
|
||||
break;
|
||||
|
||||
case 108:
|
||||
flag=rlm_icecast2_vlog109s[i];
|
||||
break;
|
||||
|
||||
case 109:
|
||||
flag=rlm_icecast2_vlog110s[i];
|
||||
break;
|
||||
|
||||
case 110:
|
||||
flag=rlm_icecast2_vlog111s[i];
|
||||
break;
|
||||
|
||||
case 111:
|
||||
flag=rlm_icecast2_vlog112s[i];
|
||||
break;
|
||||
|
||||
case 112:
|
||||
flag=rlm_icecast2_vlog113s[i];
|
||||
break;
|
||||
|
||||
case 113:
|
||||
flag=rlm_icecast2_vlog114s[i];
|
||||
break;
|
||||
|
||||
case 114:
|
||||
flag=rlm_icecast2_vlog115s[i];
|
||||
break;
|
||||
|
||||
case 115:
|
||||
flag=rlm_icecast2_vlog116s[i];
|
||||
break;
|
||||
|
||||
case 116:
|
||||
flag=rlm_icecast2_vlog117s[i];
|
||||
break;
|
||||
|
||||
case 117:
|
||||
flag=rlm_icecast2_vlog118s[i];
|
||||
break;
|
||||
|
||||
case 118:
|
||||
flag=rlm_icecast2_vlog119s[i];
|
||||
break;
|
||||
|
||||
case 119:
|
||||
flag=rlm_icecast2_vlog120s[i];
|
||||
break;
|
||||
}
|
||||
if((flag==1)||((flag==2)&&(log->log_onair!=0))) {
|
||||
strncpy(str,RLMResolveNowNext(ptr,now,next,
|
||||
|
@ -87,17 +87,22 @@ void rlm_test_RLMPadDataSent(void *ptr,const struct rlm_svc *svc,
|
||||
break;
|
||||
}
|
||||
switch(log->log_mach) {
|
||||
case 0:
|
||||
printf(" -- On Main Log ---------------------------------------------\n");
|
||||
break;
|
||||
case 0:
|
||||
printf(" -- On Main Log ---------------------------------------------\n");
|
||||
break;
|
||||
|
||||
case 1:
|
||||
printf(" -- On Aux 1 Log --------------------------------------------\n");
|
||||
break;
|
||||
case 1:
|
||||
printf(" -- On Aux 1 Log --------------------------------------------\n");
|
||||
break;
|
||||
|
||||
case 2:
|
||||
printf(" -- On Aux 2 Log --------------------------------------------\n");
|
||||
break;
|
||||
case 2:
|
||||
printf(" -- On Aux 2 Log --------------------------------------------\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
printf(" -- On vLog %d --------------------------------------------\n",
|
||||
log->log_mach+1);
|
||||
break;
|
||||
}
|
||||
printf("Playing NOW\n");
|
||||
printf(" Cart number: %06u\n",now->rlm_cartnum);
|
||||
|
@ -267,6 +267,22 @@ void MainObject::Revert(int schema) const
|
||||
case 277:
|
||||
Revert277();
|
||||
break;
|
||||
|
||||
case 278:
|
||||
Revert278();
|
||||
break;
|
||||
|
||||
case 279:
|
||||
Revert279();
|
||||
break;
|
||||
|
||||
case 280:
|
||||
Revert280();
|
||||
break;
|
||||
|
||||
case 281:
|
||||
Revert281();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -859,6 +875,187 @@ void MainObject::Revert277() const
|
||||
}
|
||||
|
||||
|
||||
void MainObject::Revert278() const
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
RDSqlQuery *q1;
|
||||
|
||||
for(int i=2;i>=0;i--) {
|
||||
sql=QString("alter table RDAIRPLAY add column ")+
|
||||
QString().sprintf("LOG_RML%d char(255) after DESCRIPTION_TEMPLATE",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString("alter table RDAIRPLAY add column ")+
|
||||
QString().sprintf("UDP_STRING%d char(255) after DESCRIPTION_TEMPLATE",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString("alter table RDAIRPLAY add column ")+
|
||||
QString().sprintf("UDP_PORT%d int unsigned after DESCRIPTION_TEMPLATE",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString("alter table RDAIRPLAY add column ")+
|
||||
QString().sprintf("UDP_ADDR%d char(255) after DESCRIPTION_TEMPLATE",i);
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString("alter table RDAIRPLAY add column ")+
|
||||
QString().sprintf("LOG%d_START_MODE int default 0 ",i)+
|
||||
"after AUDITION_PREROLL";
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString("alter table RDAIRPLAY add column ")+
|
||||
QString().sprintf("LOG%d_NEXT_CART int unsigned default 0 ",i)+
|
||||
"after AUDITION_PREROLL";
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString("alter table RDAIRPLAY add column ")+
|
||||
QString().sprintf("LOG%d_NOW_CART int unsigned default 0 ",i)+
|
||||
"after AUDITION_PREROLL";
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString("alter table RDAIRPLAY add column ")+
|
||||
QString().sprintf("LOG%d_LOG_LINE int default -1 ",i)+
|
||||
"after AUDITION_PREROLL";
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString("alter table RDAIRPLAY add column ")+
|
||||
QString().sprintf("LOG%d_LOG_ID int default -1 ",i)+
|
||||
"after AUDITION_PREROLL";
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString("alter table RDAIRPLAY add column ")+
|
||||
QString().sprintf("LOG%d_RUNNING enum('N','Y') default 'N' ",i)+
|
||||
"after AUDITION_PREROLL";
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString("alter table RDAIRPLAY add column ")+
|
||||
QString().sprintf("LOG%d_CURRENT_LOG char(64) ",i)+
|
||||
"after AUDITION_PREROLL";
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString("alter table RDAIRPLAY add column ")+
|
||||
QString().sprintf("LOG%d_LOG_NAME char(64) ",i)+
|
||||
"after AUDITION_PREROLL";
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
sql=QString("alter table RDAIRPLAY add column ")+
|
||||
QString().sprintf("LOG%d_AUTO_RESTART enum('N','Y') default 'N' ",i)+
|
||||
"after AUDITION_PREROLL";
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
}
|
||||
|
||||
sql=QString("select ")+
|
||||
"STATION_NAME,"+ // 00
|
||||
"MACHINE,"+ // 01
|
||||
"START_MODE,"+ // 02
|
||||
"AUTO_RESTART,"+ // 03
|
||||
"LOG_NAME,"+ // 04
|
||||
"CURRENT_LOG,"+ // 05
|
||||
"RUNNING,"+ // 06
|
||||
"LOG_ID,"+ // 07
|
||||
"LOG_LINE,"+ // 08
|
||||
"NOW_CART,"+ // 09
|
||||
"NEXT_CART,"+ // 10
|
||||
"UDP_ADDR,"+ // 11
|
||||
"UDP_PORT,"+ // 12
|
||||
"UDP_STRING,"+ // 13
|
||||
"LOG_RML "+ // 14
|
||||
"from LOG_MACHINES";
|
||||
q=new RDSqlQuery(sql,false);
|
||||
while(q->next()) {
|
||||
sql=QString("update RDAIRPLAY set ")+
|
||||
QString().sprintf("UDP_ADDR%d=\"",q->value(1).toInt())+
|
||||
RDEscapeString(q->value(11).toString())+"\","+
|
||||
QString().sprintf("UDP_PORT%d=%u,",
|
||||
q->value(1).toInt(),q->value(12).toUInt())+
|
||||
QString().sprintf("UDP_STRING%d=\"",q->value(1).toInt())+
|
||||
RDEscapeString(q->value(13).toString())+"\","+
|
||||
QString().sprintf("LOG_RML%d=\"",q->value(1).toInt())+
|
||||
RDEscapeString(q->value(14).toString())+"\","+
|
||||
QString().sprintf("LOG%d_START_MODE=%d,",
|
||||
q->value(1).toInt(),q->value(2).toInt())+
|
||||
QString().sprintf("LOG%d_AUTO_RESTART=\"",q->value(1).toInt())+
|
||||
RDEscapeString(q->value(3).toString())+"\","+
|
||||
QString().sprintf("LOG%d_LOG_NAME=\"",q->value(1).toInt())+
|
||||
RDEscapeString(q->value(4).toString())+"\","+
|
||||
QString().sprintf("LOG%d_CURRENT_LOG=\"",q->value(1).toInt())+
|
||||
RDEscapeString(q->value(5).toString())+"\","+
|
||||
QString().sprintf("LOG%d_RUNNING=\"",q->value(1).toInt())+
|
||||
RDEscapeString(q->value(6).toString())+"\","+
|
||||
QString().sprintf("LOG%d_LOG_ID=%d,",
|
||||
q->value(1).toInt(),q->value(7).toInt())+
|
||||
QString().sprintf("LOG%d_LOG_LINE=%d,",
|
||||
q->value(1).toInt(),q->value(8).toInt())+
|
||||
QString().sprintf("LOG%d_NOW_CART=%d,",
|
||||
q->value(1).toInt(),q->value(9).toInt())+
|
||||
QString().sprintf("LOG%d_NEXT_CART=%d ",
|
||||
q->value(1).toInt(),q->value(10).toInt())+
|
||||
"where STATION=\""+RDEscapeString(q->value(0).toString())+"\"";
|
||||
q1=new RDSqlQuery(sql,false);
|
||||
delete q1;
|
||||
}
|
||||
delete q;
|
||||
|
||||
sql=QString("drop table LOG_MACHINES");
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
SetVersion(277);
|
||||
}
|
||||
|
||||
|
||||
void MainObject::Revert279() const
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
|
||||
sql=QString("delete from RDAIRPLAY_CHANNELS where INSTANCE>=100");
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
SetVersion(278);
|
||||
}
|
||||
|
||||
|
||||
void MainObject::Revert280() const
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
|
||||
sql=QString("delete from LOG_MODES where MACHINE>=100");
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
SetVersion(279);
|
||||
}
|
||||
|
||||
|
||||
void MainObject::Revert281() const
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
|
||||
sql=QString("alter table RDAIRPLAY drop column VIRTUAL_EXIT_CODE");
|
||||
q=new RDSqlQuery(sql,false);
|
||||
delete q;
|
||||
|
||||
SetVersion(280);
|
||||
}
|
||||
|
||||
|
||||
int MainObject::GetVersion() const
|
||||
{
|
||||
QString sql;
|
||||
@ -905,7 +1102,7 @@ int MainObject::MapSchema(const QString &ver)
|
||||
version_map["2.17"]=268;
|
||||
version_map["2.18"]=272;
|
||||
version_map["2.19"]=275;
|
||||
version_map["2.20"]=277;
|
||||
version_map["2.20"]=281;
|
||||
|
||||
//
|
||||
// Normalize String
|
||||
|
@ -73,6 +73,10 @@ class MainObject : public QObject
|
||||
void Revert275() const;
|
||||
void Revert276() const;
|
||||
void Revert277() const;
|
||||
void Revert278() const;
|
||||
void Revert279() const;
|
||||
void Revert280() const;
|
||||
void Revert281() const;
|
||||
int GetVersion() const;
|
||||
void SetVersion(int schema) const;
|
||||
int MapSchema(const QString &ver);
|
||||
|
Loading…
x
Reference in New Issue
Block a user