2022-09-21 Fred Gleason <fredg@paravelsystems.com>

* Modified the 'load previous log' option in 'At Startup:' control
	in the 'Configure RDAirPlay' dialog in rdadmin(1) to be
	'load and cue previous log'.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2022-09-21 14:38:35 -04:00
parent cd262b6a34
commit 73ab30c214
6 changed files with 59 additions and 32 deletions

View File

@ -23362,3 +23362,7 @@
2022-09-20 Fred Gleason <fredg@paravelsystems.com>
* Updated the Operations Guide to include a pointer to the example
for generating an SSH keypair.
2022-09-21 Fred Gleason <fredg@paravelsystems.com>
* Modified the 'load previous log' option in 'At Startup:' control
in the 'Configure RDAirPlay' dialog in rdadmin(1) to be
'load and cue previous log'.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -2,7 +2,7 @@
//
// Rivendell Log Playout Machine
//
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2022 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
@ -2000,7 +2000,7 @@ bool RDLogPlay::StartEvent(int line,RDLogLine::TransType trans_type,
switch(logline->type()) {
case RDLogLine::Cart:
if(!StartAudioEvent(line)) {
rda->airplayConf()->setLogCurrentLine(play_id,nextLine());
UpdateRestartData();
return false;
}
aport=GetNextChannel(mport,&card,&port);
@ -2029,7 +2029,7 @@ bool RDLogPlay::StartEvent(int line,RDLogLine::TransType trans_type,
rda->syslog(LOG_WARNING,
"log engine: RDLogPlay::StartEvent(): no audio,CUT=%s",
(const char *)logline->cutName().toUtf8());
rda->airplayConf()->setLogCurrentLine(play_id,nextLine());
UpdateRestartData();
return false;
}
emit modified(line);
@ -2201,13 +2201,13 @@ bool RDLogPlay::StartEvent(int line,RDLogLine::TransType trans_type,
if((logline->state()==RDLogLine::Ok)||
(logline->state()==RDLogLine::NoCart)||
(logline->state()==RDLogLine::NoCut)) {
rda->airplayConf()->setLogCurrentLine(play_id,nextLine());
UpdateRestartData();
return true;
}
play_next_line++;
}
play_next_line=-1;
rda->airplayConf()->setLogCurrentLine(play_id,nextLine());
UpdateRestartData();
return true;
}
@ -2856,6 +2856,7 @@ void RDLogPlay::ChangeTransport()
createIndex(play_next_line+play_slot_quantity-1,
columnCount()));
}
UpdateRestartData();
}
@ -3215,6 +3216,39 @@ void RDLogPlay::SendNowNext()
}
void RDLogPlay::UpdateRestartData()
{
QString running;
int line=-1;
int id=-1;
int lines[TRANSPORT_QUANTITY];
if(runningEvents(lines,false)>0) {
line=lines[0];
id=logLine(line)->id();
running="Y";
}
else {
line=nextLine();
if(line>=0) {
id=logLine(line)->id();
}
running="N";
}
if(line<0) {
line=play_next_line;
running="N";
}
QString sql=QString("update `LOG_MACHINES` set ")+
QString::asprintf("`LOG_LINE`=%d,",line)+
QString::asprintf("`LOG_ID`=%d,",id)+
"`RUNNING`='"+running+"' "+
"where `STATION_NAME`='"+RDEscapeString(rda->station()->name())+"' && "+
QString::asprintf("`MACHINE`=%d",play_id);
RDSqlQuery::apply(sql);
}
QString RDLogPlay::GetPadJson(const QString &name,RDLogLine *ll,
const QDateTime &start_datetime,int line,
int padding,bool final) const

View File

@ -2,7 +2,7 @@
//
// Rivendell Log Playout Machine
//
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2022 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
@ -197,6 +197,7 @@ class RDLogPlay : public RDLogModel
RDLogLine::TransType GetTransType(const QString &logname,int line);
bool ClearBlock(int start_line);
void SendNowNext();
void UpdateRestartData();
QString GetPadJson(const QString &name,RDLogLine *ll,
const QDateTime &start_datetime,int line,int padding,
bool final=false) const;

View File

@ -2,7 +2,7 @@
//
// Edit an RDAirPlay Configuration
//
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2022 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
@ -749,7 +749,7 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station,
air_startmode_box=new QComboBox(this);
air_startmode_box->setGeometry(100,524,240,20);
air_startmode_box->insertItem(0,tr("start with empty log"));
air_startmode_box->insertItem(1,tr("load previous log"));
air_startmode_box->insertItem(1,tr("load and cue previous log"));
air_startmode_box->insertItem(2,tr("load specified log"));
label=new QLabel(tr("At Startup:"),this);
label->setFont(subLabelFont());
@ -1166,10 +1166,12 @@ void EditRDAirPlay::startModeChangedData(int mode)
RDAirPlayConf::StartSpecified);
air_startlog_button->setEnabled((RDAirPlayConf::StartMode)mode==
RDAirPlayConf::StartSpecified);
air_autorestart_box->setDisabled((RDAirPlayConf::StartMode)mode==
RDAirPlayConf::StartEmpty);
air_autorestart_label->setDisabled((RDAirPlayConf::StartMode)mode==
RDAirPlayConf::StartEmpty);
air_autorestart_box->
setDisabled(((RDAirPlayConf::StartMode)mode==RDAirPlayConf::StartEmpty)||
((RDAirPlayConf::StartMode)mode==RDAirPlayConf::StartSpecified));
air_autorestart_label->
setDisabled(((RDAirPlayConf::StartMode)mode==RDAirPlayConf::StartEmpty)||
((RDAirPlayConf::StartMode)mode==RDAirPlayConf::StartSpecified));
}

View File

@ -776,11 +776,10 @@ void MainWidget::ripcConnectedData(bool state)
RDDateTimeDecode(rda->airplayConf()->currentLog(i),
air_startup_datetime,rda->station(),rda->config());
if(!air_start_logname[i].isEmpty()) {
if(rdairplay_previous_exit_code==RDAirPlayConf::ExitDirty) {
if((air_start_line[i]=rda->airplayConf()->logCurrentLine(i))>=0) {
air_start_start[i]=rda->airplayConf()->autoRestart(i)&&
rda->airplayConf()->logRunning(i);
}
if((air_start_line[i]=rda->airplayConf()->logCurrentLine(i))>=0) {
air_start_start[i]=rda->airplayConf()->autoRestart(i)&&
rda->airplayConf()->logRunning(i)&&
(rdairplay_previous_exit_code==RDAirPlayConf::ExitDirty);
}
else {
air_start_line[i]=0;
@ -793,21 +792,8 @@ void MainWidget::ripcConnectedData(bool state)
air_start_logname[i]=
RDDateTimeDecode(rda->airplayConf()->logName(i),
air_startup_datetime,rda->station(),rda->config());
if(!air_start_logname[i].isEmpty()) {
if(rdairplay_previous_exit_code==RDAirPlayConf::ExitDirty) {
if(air_start_logname[i]==rda->airplayConf()->currentLog(i)) {
if((air_start_line[i]=rda->airplayConf()->logCurrentLine(i))>=
0) {
air_start_start[i]=rda->airplayConf()->autoRestart(i)&&
rda->airplayConf()->logRunning(i);
}
else {
air_start_line[i]=0;
air_start_start[i]=false;
}
}
}
}
air_start_line[i]=0;
air_start_start[i]=false;
break;
}
}