2024-04-03 Fred Gleason <fredg@paravelsystems.com>

* Added an 'ExtendedNextPadEvents=' directive to rd.conf(5).

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2024-04-03 14:40:27 -04:00
parent bb013678ca
commit 3d4fbf254a
10 changed files with 95 additions and 15 deletions

View File

@@ -24692,3 +24692,5 @@
* Modified the Sound Panel classes to use native Qt JSON methods.
2024-04-03 Fred Gleason <fredg@paravelsystems.com>
* Removed JSON generation methods.
2024-04-03 Fred Gleason <fredg@paravelsystems.com>
* Added an 'ExtendedNextPadEvents=' directive to rd.conf(5).

View File

@@ -188,6 +188,13 @@ TranscodingDelay=0
; bootup.
;ServiceStartupDelay=5
; Maximum number of extended next PAD events, available at TCP port 34290.
; Setting this to '-1' causes 'next' clauses for the entire runtime horizon
; of the log to be sent, while setting it to '0' disables the extended next
; PAD events feature entirely.
;ExtendedNextPadEvents=4
[Hacks]
; As implied by the name, directives in this section are generally for use
; in troubleshooting or maintenance situations. Do *NOT* change these on

View File

@@ -715,6 +715,27 @@
aspects of Rivendell.
</para>
<variablelist>
<varlistentry>
<term>
<userinput>ExtendedNextPadEvents = <replaceable>num</replaceable></userinput>
</term>
<listitem>
<para>
Instruct the PAD subsystem to provide an &quot;extended&quot;
interface at TCP port <computeroutput>34290</computeroutput>,
appending <replaceable>num</replaceable> &quot;next&quot;
objects in addition to the standard &quot;next&quot; object.
</para>
<para>
Setting <replaceable>num</replaceable> to
<userinput>-1</userinput> will cause &quot;next&quot; objects
for <emphasis>all</emphasis> upcoming events to be generated;
while setting <replaceable>num</replaceable> to
<userinput>0</userinput> will disable the extended PAD
interface entirely.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<userinput>ServiceStartDelay = <replaceable>secs</replaceable></userinput>

View File

@@ -96,6 +96,16 @@
}]]>
</programlisting>
</para>
<sect3 xml:id="sect.pad.the_json_interface.the_extended_json_interface">
<title>The Extended JSON Interface</title>
<para>
An &quot;extended&quot; version of the above PAD feed that contains
additional <code>next</code> objects is optionally available at
TCP port 34290. See the <userinput>ExtendedNextPadEvents=</userinput>
directive in the <userinput>[Tuning]</userinput> section of the
<command>rd.conf</command><manvolnum>5</manvolnum> man page.
</para>
</sect3>
</sect2>
<sect2 xml:id="sect.pad.pypad">

View File

@@ -633,6 +633,11 @@
*/
#define RD_DEFAULT_SERVICE_TIMEOUT 30
/*
* Default 'ExtendedNextPadEvents=' value is rd.conf(5)
*/
#define RD_DEFAULT_EXTENDED_NEXT_PAD_EVENTS 4
/*
* Default 'ServiceStartupDelay=' value in rd.conf(5) [seconds]
*/

View File

@@ -538,6 +538,12 @@ int RDConfig::serviceStartupDelay() const
}
int RDConfig::extendedNextPadEvents() const
{
return conf_extended_next_pad_events;
}
QString RDConfig::sasStation() const
{
return conf_sas_station;
@@ -729,6 +735,9 @@ bool RDConfig::load()
conf_temp_directory=profile->stringValue("Tuning","TempDirectory","");
conf_service_startup_delay=profile->intValue("Tuning","ServiceStartupDelay",
RD_DEFAULT_SERVICE_STARTUP_DELAY);
conf_extended_next_pad_events=
profile->intValue("Tuning","ExtendedNextPadEvents",
RD_DEFAULT_EXTENDED_NEXT_PAD_EVENTS);
conf_sas_station=profile->stringValue("SASFilter","Station","");
conf_sas_matrix=profile->intValue("SASFilter","Matrix",0);
conf_sas_base_cart=profile->intValue("SASFilter","BaseCart",0);

View File

@@ -126,6 +126,7 @@ class RDConfig
int serviceTimeout() const;
QString tempDirectory();
int serviceStartupDelay() const;
int extendedNextPadEvents() const;
QString sasStation() const;
int sasMatrix() const;
unsigned sasBaseCart() const;
@@ -214,6 +215,7 @@ class RDConfig
int conf_service_timeout;
QString conf_temp_directory;
int conf_service_startup_delay;
int conf_extended_next_pad_events;
QString conf_sas_station;
int conf_sas_matrix;
unsigned conf_sas_base_cart;

View File

@@ -74,7 +74,11 @@ RDLogPlay::RDLogPlay(int id,RDEventPlayer *player,bool enable_cue,QObject *paren
//
// PAD Server Connection
//
for(int i=0;i<2;i++) {
int extended_next=2;
if(rda->config()->extendedNextPadEvents()==0) {
extended_next=1;
}
for(int i=0;i<extended_next;i++) {
play_pad_socket[i]=new RDUnixSocket(this);
if(!play_pad_socket[i]->
connectToAbstract(QString::asprintf("%s-%d",
@@ -3172,7 +3176,11 @@ void RDLogPlay::SendNowNext()
}
int next_num=1;
for(int i=0;i<2;i++) {
int extended_next=2;
if(rda->config()->extendedNextPadEvents()==0) {
extended_next=1;
}
for(int i=0;i<extended_next;i++) {
//
// Header Fields
@@ -3234,18 +3242,24 @@ void RDLogPlay::SendNowNext()
//
// Extended Events
//
if(nextLine()>=0) {
if((i>0)&&(nextLine()>=0)) {
for(int j=nextLine()+1;j<lineCount();j++) {
if((ll=logLine(j))!=NULL) {
if((ll->type()==RDLogLine::Cart)||(ll->type()==RDLogLine::Macro)) {
if((ll->status()==RDLogLine::Scheduled)&&
(!logLine(i)->asyncronous())) {
next_datetime=next_datetime.addSecs(ll->forcedLength()/1000);
jo0.insert(QString::asprintf("next%d",next_num),
GetPadJson(QString::asprintf("next%d",next_num),ll,
next_datetime,j));
next_num++;
if(rda->config()->extendedNextPadEvents()!=0) {
int limit=lineCount();
if(rda->config()->extendedNextPadEvents()>0) {
limit=nextLine()+1+rda->config()->extendedNextPadEvents();
}
if(nextLine()>=0) {
if((i>0)&&(nextLine()>=0)) {
for(int j=nextLine()+1;j<limit;j++) {
if((ll=logLine(j))!=NULL) {
if((ll->type()==RDLogLine::Cart)||(ll->type()==RDLogLine::Macro)) {
if((ll->status()==RDLogLine::Scheduled)&&
(!logLine(i)->asyncronous())) {
next_datetime=next_datetime.addSecs(ll->forcedLength()/1000);
jo0.insert(QString::asprintf("next%d",next_num),
GetPadJson(QString::asprintf("next%d",next_num),ll,
next_datetime,j));
next_num++;
}
}
}
}

View File

@@ -27,7 +27,14 @@
MainObject::MainObject()
: QObject()
{
for(int i=0;i<2;i++) {
d_config=new RDConfig();
d_config->load();
int extended_next=2;
if(d_config->extendedNextPadEvents()==0) {
extended_next=1;
}
for(int i=0;i<extended_next;i++) {
d_repeaters.push_back(new Repeater(QString::asprintf("%s-%d",
RD_PAD_SOURCE_UNIX_BASE_ADDRESS,i),
RD_PAD_CLIENT_TCP_PORT+i,this));

View File

@@ -24,6 +24,8 @@
#include <QList>
#include <QObject>
#include <rdconfig.h>
#include "repeater.h"
#define RDPADD_USAGE "\n\n"
@@ -36,6 +38,7 @@ class MainObject : public QObject
private:
QList<Repeater *> d_repeaters;
RDConfig *d_config;
};