diff --git a/ChangeLog b/ChangeLog index a5c7a6a9..2ae7d477 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20936,3 +20936,6 @@ 2022-09-06 Fred Gleason * Added code to the podcasting subsystem to log extended curl(1) information to syslog. +2022-09-15 Fred Gleason + * Added support for a 'SuppressLinkParameterInheritance=' directive + in the '[Hacks]' section of rd.conf(5). diff --git a/conf/rd.conf-sample b/conf/rd.conf-sample index 72848c0e..ce9b51d4 100644 --- a/conf/rd.conf-sample +++ b/conf/rd.conf-sample @@ -191,3 +191,9 @@ TranscodingDelay=0 ; ; Default action is to not save files. ; SaveWebgetFilesDirectory= + +; Do not apply the event parameters (time and transition types, hard start +; times) from import links to the first item imported, but rather use the +; values of the import event itself. Takes a comma-delimited list of service +; names. +; SuppressLinkParameterInheritance= diff --git a/lib/rdconfig.cpp b/lib/rdconfig.cpp index 782169dc..05b5bbaa 100644 --- a/lib/rdconfig.cpp +++ b/lib/rdconfig.cpp @@ -511,6 +511,13 @@ QString RDConfig::destination(unsigned n) } +bool RDConfig::suppressLinkParameterInheritance(const QString &svc_name) const +{ + return conf_suppress_link_parameter_inheritance_services. + contains(svc_name,Qt::CaseInsensitive); +} + + bool RDConfig::load() { char sname[256]; @@ -626,6 +633,9 @@ bool RDConfig::load() profile->intValue("Hacks","MeterPortBaseNumber",RD_DEFAULT_METER_SOCKET_BASE_UDP_PORT); conf_meter_port_range= profile->intValue("Hacks","MeterPortRange",RD_METER_SOCKET_PORT_RANGE); + conf_suppress_link_parameter_inheritance_services= + profile->stringValue("Hacks","SuppressLinkParameterInheritance"). + split(",",QString::SkipEmptyParts); if((user=getpwnam(profile->stringValue("Identity","AudioOwner")))!=NULL) { conf_uid=user->pw_uid; } @@ -770,6 +780,7 @@ void RDConfig::clear() conf_sas_base_cart=1; conf_sas_tty_device=""; conf_destinations.clear(); + conf_suppress_link_parameter_inheritance_services.clear(); } diff --git a/lib/rdconfig.h b/lib/rdconfig.h index 861346f8..1f048956 100644 --- a/lib/rdconfig.h +++ b/lib/rdconfig.h @@ -27,6 +27,7 @@ #include #include +#include #include @@ -121,6 +122,7 @@ class RDConfig unsigned sasBaseCart() const; QString sasTtyDevice() const; QString destination(unsigned n); + bool suppressLinkParameterInheritance(const QString &svc_name) const; bool load(); void clear(); static QString createTablePostfix(const QString &engine); @@ -196,6 +198,7 @@ class RDConfig unsigned conf_sas_base_cart; QString conf_sas_tty_device; std::vector conf_destinations; + QStringList conf_suppress_link_parameter_inheritance_services; }; RDConfig *RDConfiguration(void); diff --git a/lib/rdevent_line.cpp b/lib/rdevent_line.cpp index e1b27293..131061e8 100644 --- a/lib/rdevent_line.cpp +++ b/lib/rdevent_line.cpp @@ -2,7 +2,7 @@ // // Abstract a Rivendell Log Manager Event // -// (C) Copyright 2002-2021 Fred Gleason +// (C) Copyright 2002-2022 Fred Gleason // // 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 @@ -920,6 +920,10 @@ bool RDEventLine::linkLog(RDLogEvent *e,RDLog *log,const QString &svcname, const QString &label_cart,const QString &track_cart, QString *errors) { + // + // FIXME: This entire method needs to be burned down and replaced + // with a rewrite. + // QString sql; RDSqlQuery *q; RDLogLine *logline=NULL; @@ -941,6 +945,8 @@ bool RDEventLine::linkLog(RDLogEvent *e,RDLog *log,const QString &svcname, case RDEventLine::None: break; } + bool suppress_link_parameter_inheritance= + rda->config()->suppressLinkParameterInheritance(svcname); RDLogLine::TimeType time_type=link_logline->timeType(); RDLogLine::TransType trans_type=link_logline->transType(); int grace_time=link_logline->graceTime(); @@ -949,31 +955,35 @@ bool RDEventLine::linkLog(RDLogEvent *e,RDLog *log,const QString &svcname, // // Insert Parent Link // - if(log->includeImportMarkers()&& - !(rda->config()->suppressMusicImportLinks()&& - (event_import_source==RDEventLine::Music))) { - e->insert(e->size(),1); - logline=new RDLogLine(); - *logline=*link_logline; - logline->setId(e->nextId()); - *(e->logLine(e->size()-1))=*logline; - delete logline; - logline=NULL; - + if((event_import_source==RDEventLine::Music)|| + (event_import_source==RDEventLine::Traffic)) { // // Clear Leading Event Values // time_type=RDLogLine::Relative; trans_type=event_default_transtype; grace_time=-1; - } - else { - // - // Propagate Leading Event Values to Next Event - // - time_type=link_logline->timeType(); - trans_type=link_logline->transType(); - grace_time=link_logline->graceTime(); + if(log->includeImportMarkers()&& + !(rda->config()->suppressMusicImportLinks()&& + (event_import_source==RDEventLine::Music))) { + e->insert(e->size(),1); + logline=new RDLogLine(); + *logline=*link_logline; + logline->setId(e->nextId()); + *(e->logLine(e->size()-1))=*logline; + delete logline; + logline=NULL; + } + else { + if(!suppress_link_parameter_inheritance) { + // + // Propagate Leading Event Values to Next Event + // + time_type=link_logline->timeType(); + trans_type=link_logline->transType(); + grace_time=link_logline->graceTime(); + } + } } //