mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-06-08 08:02:41 +02:00
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.
This commit is contained in:
parent
f16ff0800b
commit
f36547aab5
@ -16838,3 +16838,9 @@
|
|||||||
* Added an 'RLM_VLOG_QUANTITY' define to 'rlm.h'.
|
* Added an 'RLM_VLOG_QUANTITY' define to 'rlm.h'.
|
||||||
* Updated 'RLM_VERSION' to 18 in 'rlm.h'.
|
* Updated 'RLM_VERSION' to 18 in 'rlm.h'.
|
||||||
* Updated the 'rlm_icecast2' plug-in to support vlogs.
|
* 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.
|
||||||
|
@ -28,23 +28,8 @@ BUTTON_LABEL_TEMPLATE char(32)
|
|||||||
PAUSE_ENABLED enum('N','Y')
|
PAUSE_ENABLED enum('N','Y')
|
||||||
DEFAULT_SERVICE char(10) From SERVICES.NAME
|
DEFAULT_SERVICE char(10) From SERVICES.NAME
|
||||||
HOUR_SELECTOR_ENABLED enum('N','Y')
|
HOUR_SELECTOR_ENABLED enum('N','Y')
|
||||||
|
|
||||||
*** RETIRED ***
|
|
||||||
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)
|
|
||||||
*** RETIRED ***
|
|
||||||
|
|
||||||
EXIT_CODE int(11) 0=clean, 1=dirty
|
EXIT_CODE int(11) 0=clean, 1=dirty
|
||||||
|
VIRTUAL_EXIT_CODE int(11) 0=clean, 1=dirty
|
||||||
EXIT_PASSWORD char(41)
|
EXIT_PASSWORD char(41)
|
||||||
SKIN_PATH char(255)
|
SKIN_PATH char(255)
|
||||||
SHOW_COUNTERS enum('N','Y')
|
SHOW_COUNTERS enum('N','Y')
|
||||||
@ -53,36 +38,3 @@ TITLE_TEMPLATE char(64)
|
|||||||
ARTIST_TEMPLATE char(64)
|
ARTIST_TEMPLATE char(64)
|
||||||
OUTCUE_TEMPLATE char(64)
|
OUTCUE_TEMPLATE char(64)
|
||||||
DESCRIPTION_TEMPLATE char(64)
|
DESCRIPTION_TEMPLATE char(64)
|
||||||
|
|
||||||
*** RETIRED ***
|
|
||||||
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
|
|
||||||
*** RETIRED ***
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
/*
|
/*
|
||||||
* Current Database Version
|
* Current Database Version
|
||||||
*/
|
*/
|
||||||
#define RD_VERSION_DATABASE 280
|
#define RD_VERSION_DATABASE 281
|
||||||
|
|
||||||
|
|
||||||
#endif // DBVERSION_H
|
#endif // DBVERSION_H
|
||||||
|
@ -759,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
|
bool RDAirPlayConf::exitPasswordValid(const QString &passwd) const
|
||||||
{
|
{
|
||||||
QString sql;
|
QString sql;
|
||||||
|
@ -139,6 +139,8 @@ class RDAirPlayConf
|
|||||||
void setLogRml(int logno,const QString &str) const;
|
void setLogRml(int logno,const QString &str) const;
|
||||||
RDAirPlayConf::ExitCode exitCode() const;
|
RDAirPlayConf::ExitCode exitCode() const;
|
||||||
void setExitCode(RDAirPlayConf::ExitCode code) const;
|
void setExitCode(RDAirPlayConf::ExitCode code) const;
|
||||||
|
RDAirPlayConf::ExitCode virtualExitCode() const;
|
||||||
|
void setVirtualExitCode(RDAirPlayConf::ExitCode code) const;
|
||||||
bool exitPasswordValid(const QString &passwd) const;
|
bool exitPasswordValid(const QString &passwd) const;
|
||||||
void setExitPassword(const QString &passwd) const;
|
void setExitPassword(const QString &passwd) const;
|
||||||
QString skinPath() const;
|
QString skinPath() const;
|
||||||
|
@ -1087,51 +1087,13 @@ bool CreateDb(QString name,QString pwd,RDConfig *config)
|
|||||||
"ARTIST_TEMPLATE char(64) default '%a',"+
|
"ARTIST_TEMPLATE char(64) default '%a',"+
|
||||||
"OUTCUE_TEMPLATE char(64) default '%o',"+
|
"OUTCUE_TEMPLATE char(64) default '%o',"+
|
||||||
"DESCRIPTION_TEMPLATE char(64) default '%i',"+
|
"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,"+
|
"EXIT_CODE int default 0,"+
|
||||||
|
"VIRTUAL_EXIT_CODE int default 0,"+
|
||||||
"EXIT_PASSWORD char(41) default \"\","+
|
"EXIT_PASSWORD char(41) default \"\","+
|
||||||
"SKIN_PATH char(255) default \""+
|
"SKIN_PATH char(255) default \""+
|
||||||
RDEscapeString(RD_DEFAULT_RDAIRPLAY_SKIN)+"\","+
|
RDEscapeString(RD_DEFAULT_RDAIRPLAY_SKIN)+"\","+
|
||||||
"SHOW_COUNTERS enum('N','Y') default 'N',"+
|
"SHOW_COUNTERS enum('N','Y') default 'N',"+
|
||||||
"AUDITION_PREROLL int default 10000,"+
|
"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))"+
|
"index STATION_IDX (STATION))"+
|
||||||
config->createTablePostfix();
|
config->createTablePostfix();
|
||||||
if(!RunQuery(sql)) {
|
if(!RunQuery(sql)) {
|
||||||
@ -8246,6 +8208,12 @@ int UpdateDb(int ver,RDConfig *config)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include <rdapplication.h>
|
#include <rdapplication.h>
|
||||||
#include <rdcheck_daemons.h>
|
#include <rdcheck_daemons.h>
|
||||||
#include <rdconf.h>
|
#include <rdconf.h>
|
||||||
|
#include <rddatedecode.h>
|
||||||
#include <rddbheartbeat.h>
|
#include <rddbheartbeat.h>
|
||||||
#include <rdescape_string.h>
|
#include <rdescape_string.h>
|
||||||
#include <rdmixer.h>
|
#include <rdmixer.h>
|
||||||
@ -36,6 +37,19 @@
|
|||||||
|
|
||||||
#include "rdvairplay.h"
|
#include "rdvairplay.h"
|
||||||
|
|
||||||
|
bool global_exiting=false;
|
||||||
|
|
||||||
|
void SigHandler(int signo)
|
||||||
|
{
|
||||||
|
switch(signo) {
|
||||||
|
case SIGINT:
|
||||||
|
case SIGTERM:
|
||||||
|
global_exiting=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MainObject::MainObject(QObject *parent)
|
MainObject::MainObject(QObject *parent)
|
||||||
:QObject(parent)
|
:QObject(parent)
|
||||||
{
|
{
|
||||||
@ -56,6 +70,11 @@ MainObject::MainObject(QObject *parent)
|
|||||||
//
|
//
|
||||||
RDInitializeDaemons();
|
RDInitializeDaemons();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Startup DateTime
|
||||||
|
//
|
||||||
|
air_startup_datetime=QDateTime::currentDateTime();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Open the Database
|
// Open the Database
|
||||||
//
|
//
|
||||||
@ -64,6 +83,8 @@ MainObject::MainObject(QObject *parent)
|
|||||||
fprintf(stderr,"rdvairplay: %s\n",(const char *)err_msg);
|
fprintf(stderr,"rdvairplay: %s\n",(const char *)err_msg);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
air_previous_exit_code=rda->airplayConf()->virtualExitCode();
|
||||||
|
rda->airplayConf()->setVirtualExitCode(RDAirPlayConf::ExitDirty);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Read Command Options
|
// Read Command Options
|
||||||
@ -90,7 +111,8 @@ MainObject::MainObject(QObject *parent)
|
|||||||
//
|
//
|
||||||
// RIPC Connection
|
// RIPC Connection
|
||||||
//
|
//
|
||||||
// connect(rda->ripc(),SIGNAL(connected(bool)),this,SLOT(ripcConnected(bool)));
|
connect(rda->ripc(),SIGNAL(connected(bool)),
|
||||||
|
this,SLOT(ripcConnectedData(bool)));
|
||||||
connect(rda,SIGNAL(userChanged()),this,SLOT(userData()));
|
connect(rda,SIGNAL(userChanged()),this,SLOT(userData()));
|
||||||
connect(rda->ripc(),SIGNAL(rmlReceived(RDMacro *)),
|
connect(rda->ripc(),SIGNAL(rmlReceived(RDMacro *)),
|
||||||
this,SLOT(rmlReceivedData(RDMacro *)));
|
this,SLOT(rmlReceivedData(RDMacro *)));
|
||||||
@ -115,7 +137,6 @@ MainObject::MainObject(QObject *parent)
|
|||||||
QSignalMapper *reload_mapper=new QSignalMapper(this);
|
QSignalMapper *reload_mapper=new QSignalMapper(this);
|
||||||
connect(reload_mapper,SIGNAL(mapped(int)),this,SLOT(logReloadedData(int)));
|
connect(reload_mapper,SIGNAL(mapped(int)),this,SLOT(logReloadedData(int)));
|
||||||
QSignalMapper *rename_mapper=new QSignalMapper(this);
|
QSignalMapper *rename_mapper=new QSignalMapper(this);
|
||||||
// connect(rename_mapper,SIGNAL(mapped(int)),this,SLOT(logRenamedData(int)));
|
|
||||||
QString default_svcname=rda->airplayConf()->defaultSvc();
|
QString default_svcname=rda->airplayConf()->defaultSvc();
|
||||||
for(int i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
for(int i=0;i<RD_RDVAIRPLAY_LOG_QUAN;i++) {
|
||||||
air_logs[i]=new RDLogPlay(i+RD_RDVAIRPLAY_LOG_BASE,air_event_player,
|
air_logs[i]=new RDLogPlay(i+RD_RDVAIRPLAY_LOG_BASE,air_event_player,
|
||||||
@ -182,17 +203,161 @@ MainObject::MainObject(QObject *parent)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete q;
|
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()
|
void MainObject::userData()
|
||||||
{
|
{
|
||||||
printf("User connected!\n");
|
// printf("User connected!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainObject::logReloadedData(int log)
|
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,"RDVAirPlay exiting");
|
||||||
|
air_lock->unlock();
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -207,22 +372,7 @@ void MainObject::SetAutoMode(int index)
|
|||||||
|
|
||||||
void MainObject::SetLiveAssistMode(int index)
|
void MainObject::SetLiveAssistMode(int index)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
if(mach==0) {
|
|
||||||
air_pie_counter->setOpMode(RDAirPlayConf::LiveAssist);
|
|
||||||
}
|
|
||||||
air_mode_display->setOpMode(mach,RDAirPlayConf::LiveAssist);
|
|
||||||
air_op_mode[mach]=RDAirPlayConf::LiveAssist;
|
|
||||||
rda->airplayConf()->setOpMode(mach,RDAirPlayConf::LiveAssist);
|
|
||||||
*/
|
|
||||||
air_logs[index]->setOpMode(RDAirPlayConf::LiveAssist);
|
air_logs[index]->setOpMode(RDAirPlayConf::LiveAssist);
|
||||||
/*
|
|
||||||
air_log_list[mach]->setOpMode(RDAirPlayConf::LiveAssist);
|
|
||||||
if(mach==0) {
|
|
||||||
air_button_list->setOpMode(RDAirPlayConf::LiveAssist);
|
|
||||||
air_post_counter->setDisabled(true);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
rda->log(RDConfig::LogInfo,
|
rda->log(RDConfig::LogInfo,
|
||||||
QString().sprintf("log machine %d mode set to LIVE ASSIST",
|
QString().sprintf("log machine %d mode set to LIVE ASSIST",
|
||||||
index+RD_RDVAIRPLAY_LOG_BASE+1));
|
index+RD_RDVAIRPLAY_LOG_BASE+1));
|
||||||
|
@ -40,9 +40,11 @@ class MainObject : public QObject
|
|||||||
MainObject(QObject *parent=0);
|
MainObject(QObject *parent=0);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void ripcConnectedData(bool state);
|
||||||
void userData();
|
void userData();
|
||||||
void rmlReceivedData(RDMacro*);
|
void rmlReceivedData(RDMacro*);
|
||||||
void logReloadedData(int log);
|
void logReloadedData(int log);
|
||||||
|
void exitData();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetAutoMode(int index);
|
void SetAutoMode(int index);
|
||||||
@ -50,10 +52,16 @@ class MainObject : public QObject
|
|||||||
void SetManualMode(int index);
|
void SetManualMode(int index);
|
||||||
int LogMachineIndex(int log_mach,bool *all=NULL) const;
|
int LogMachineIndex(int log_mach,bool *all=NULL) const;
|
||||||
RDLogPlay *air_logs[RD_RDVAIRPLAY_LOG_QUAN];
|
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;
|
std::vector<RDRLMHost *> air_plugin_hosts;
|
||||||
RDInstanceLock *air_lock;
|
RDInstanceLock *air_lock;
|
||||||
RDEventPlayer *air_event_player;
|
RDEventPlayer *air_event_player;
|
||||||
QSocketDevice *air_nownext_socket;
|
QSocketDevice *air_nownext_socket;
|
||||||
|
QDateTime air_startup_datetime;
|
||||||
|
RDAirPlayConf::ExitCode air_previous_exit_code;
|
||||||
|
QTimer *air_exit_timer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -279,6 +279,10 @@ void MainObject::Revert(int schema) const
|
|||||||
case 280:
|
case 280:
|
||||||
Revert280();
|
Revert280();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 281:
|
||||||
|
Revert281();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1039,6 +1043,19 @@ void MainObject::Revert280() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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
|
int MainObject::GetVersion() const
|
||||||
{
|
{
|
||||||
QString sql;
|
QString sql;
|
||||||
@ -1085,7 +1102,7 @@ int MainObject::MapSchema(const QString &ver)
|
|||||||
version_map["2.17"]=268;
|
version_map["2.17"]=268;
|
||||||
version_map["2.18"]=272;
|
version_map["2.18"]=272;
|
||||||
version_map["2.19"]=275;
|
version_map["2.19"]=275;
|
||||||
version_map["2.20"]=280;
|
version_map["2.20"]=281;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Normalize String
|
// Normalize String
|
||||||
|
@ -76,6 +76,7 @@ class MainObject : public QObject
|
|||||||
void Revert278() const;
|
void Revert278() const;
|
||||||
void Revert279() const;
|
void Revert279() const;
|
||||||
void Revert280() const;
|
void Revert280() const;
|
||||||
|
void Revert281() const;
|
||||||
int GetVersion() const;
|
int GetVersion() const;
|
||||||
void SetVersion(int schema) const;
|
void SetVersion(int schema) const;
|
||||||
int MapSchema(const QString &ver);
|
int MapSchema(const QString &ver);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user