mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-26 15:20:29 +01:00
2019-01-07 Fred Gleason <fredg@paravelsystems.com>
* Removed 'apis/rlm/'. * Removed the 'Edit Now & Next' button from the 'Configure RDAirPlay' dialog in rdadmin(1). * Removed RLM support from rdairplay(1) and rdvairplayd(8). * Removed v1.x legacy PAD update support from rdairplay(1). * Dropped the 'NOWNEXT_PLUGINS' table from the database. * Dropped the 'LOG_MACHINES.UDP_ADDR' field from the database. * Dropped the 'LOG_MACHINES.UDP_PORT' field from the database. * Dropped the 'LOG_MACHINES.UDP_STRING' field from the database. * Dropped the 'LOG_MACHINES.LOG_RML' field from the database. * Incremented the database version to 305.
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
// rdnownext.cpp
|
||||
//
|
||||
// Rivendell Now & Next Implementation
|
||||
// Rivendell Metadata Wildcards Implementation
|
||||
//
|
||||
// (C) Copyright 2008,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// MAINTAINERS'S NOTE: These mappings must be kept in sync with those
|
||||
// in 'apis/PyPAD/api/PyPAD.py'!
|
||||
//
|
||||
// (C) Copyright 2008-2019 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
|
||||
@@ -53,142 +56,6 @@ void RDResolveNowNextDateTime(QString *str,const QString &code,
|
||||
}
|
||||
|
||||
|
||||
QString RDResolveNowNextEncode(const QString &str,int encoding)
|
||||
{
|
||||
QString ret=str;
|
||||
|
||||
switch(encoding) {
|
||||
case RLM_ENCODE_NONE:
|
||||
break;
|
||||
|
||||
case RLM_ENCODE_XML:
|
||||
ret=RDXmlEscape(str);
|
||||
break;
|
||||
|
||||
case RLM_ENCODE_URL:
|
||||
ret=RDUrlEscape(str);
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void RDResolveNowNext(QString *str,RDLogLine **loglines,int line,int encoding)
|
||||
{
|
||||
//
|
||||
// NOW PLAYING Event
|
||||
//
|
||||
if(loglines[0]!=NULL) {
|
||||
str->replace("%n",QString().sprintf("%06u",loglines[0]->cartNumber()));
|
||||
str->replace("%h",QString().sprintf("%d",loglines[0]->effectiveLength()));
|
||||
str->replace("%v",
|
||||
QString().sprintf("%d",loglines[0]->effectiveLength()/1000));
|
||||
str->replace("%g",RDResolveNowNextEncode(loglines[0]->groupName(),
|
||||
encoding));
|
||||
str->replace("%t",
|
||||
RDResolveNowNextEncode(loglines[0]->title(),encoding));
|
||||
str->replace("%a",RDResolveNowNextEncode(loglines[0]->artist(),encoding));
|
||||
str->replace("%l",RDResolveNowNextEncode(loglines[0]->album(),encoding));
|
||||
str->replace("%r",RDResolveNowNextEncode(loglines[0]->conductor(),
|
||||
encoding));
|
||||
str->replace("%s",RDResolveNowNextEncode(loglines[0]->songId(),encoding));
|
||||
str->replace("%y",loglines[0]->year().toString("yyyy"));
|
||||
str->replace("%b",RDResolveNowNextEncode(loglines[0]->label(),encoding));
|
||||
str->replace("%c",RDResolveNowNextEncode(loglines[0]->client(),encoding));
|
||||
str->replace("%e",RDResolveNowNextEncode(loglines[0]->agency(),encoding));
|
||||
str->replace("%m",RDResolveNowNextEncode(loglines[0]->composer(),encoding));
|
||||
str->replace("%p",RDResolveNowNextEncode(loglines[0]->publisher(),
|
||||
encoding));
|
||||
str->replace("%u",RDResolveNowNextEncode(loglines[0]->userDefined(),
|
||||
encoding));
|
||||
str->replace("%o",RDResolveNowNextEncode(loglines[0]->outcue(),encoding));
|
||||
str->replace("%i",RDResolveNowNextEncode(loglines[0]->description(),
|
||||
encoding));
|
||||
str->replace("%x",QString().sprintf("%d",loglines[0]->id()));
|
||||
RDResolveNowNextDateTime(str,"%d(",loglines[0]->startDatetime());
|
||||
}
|
||||
else { // No NOW PLAYING Event
|
||||
str->replace("%n","");
|
||||
str->replace("%h","");
|
||||
str->replace("%v","");
|
||||
str->replace("%g","");
|
||||
str->replace("%t","");
|
||||
str->replace("%a","");
|
||||
str->replace("%l","");
|
||||
str->replace("%r","");
|
||||
str->replace("%s","");
|
||||
str->replace("%y","");
|
||||
str->replace("%b","");
|
||||
str->replace("%c","");
|
||||
str->replace("%e","");
|
||||
str->replace("%m","");
|
||||
str->replace("%p","");
|
||||
str->replace("%u","");
|
||||
str->replace("%o","");
|
||||
str->replace("%i","");
|
||||
str->replace("%z","");
|
||||
RDResolveNowNextDateTime(str,"%d(",QDateTime());
|
||||
}
|
||||
|
||||
//
|
||||
// NEXT Event
|
||||
//
|
||||
if(loglines[1]!=NULL) {
|
||||
str->replace("%N",QString().sprintf("%06u",loglines[1]->cartNumber()));
|
||||
str->replace("%H",QString().sprintf("%d",loglines[1]->effectiveLength()));
|
||||
str->replace("%V",
|
||||
QString().sprintf("%d",loglines[1]->effectiveLength()/1000));
|
||||
str->replace("%G",RDResolveNowNextEncode(loglines[1]->groupName(),
|
||||
encoding));
|
||||
str->replace("%T",RDResolveNowNextEncode(loglines[1]->title(),encoding));
|
||||
str->replace("%A",RDResolveNowNextEncode(loglines[1]->artist(),encoding));
|
||||
str->replace("%L",RDResolveNowNextEncode(loglines[1]->album(),encoding));
|
||||
str->replace("%R",RDResolveNowNextEncode(loglines[1]->conductor(),
|
||||
encoding));
|
||||
str->replace("%S",RDResolveNowNextEncode(loglines[1]->songId(),encoding));
|
||||
str->replace("%Y",loglines[1]->year().toString("yyyy"));
|
||||
str->replace("%B",RDResolveNowNextEncode(loglines[1]->label(),encoding));
|
||||
str->replace("%C",RDResolveNowNextEncode(loglines[1]->client(),encoding));
|
||||
str->replace("%E",RDResolveNowNextEncode(loglines[1]->agency(),encoding));
|
||||
str->replace("%M",RDResolveNowNextEncode(loglines[1]->composer(),encoding));
|
||||
str->replace("%P",RDResolveNowNextEncode(loglines[1]->publisher(),
|
||||
encoding));
|
||||
str->replace("%U",RDResolveNowNextEncode(loglines[1]->userDefined(),
|
||||
encoding));
|
||||
str->replace("%O",RDResolveNowNextEncode(loglines[1]->outcue(),encoding));
|
||||
str->replace("%I",RDResolveNowNextEncode(loglines[1]->description(),
|
||||
encoding));
|
||||
str->replace("%X",QString().sprintf("%d",loglines[1]->id()));
|
||||
RDResolveNowNextDateTime(str,"%D(",loglines[1]->startDatetime());
|
||||
}
|
||||
else { // No NEXT Event
|
||||
str->replace("%N","");
|
||||
str->replace("%H","");
|
||||
str->replace("%V","");
|
||||
str->replace("%G","");
|
||||
str->replace("%T","");
|
||||
str->replace("%A","");
|
||||
str->replace("%L","");
|
||||
str->replace("%R","");
|
||||
str->replace("%S","");
|
||||
str->replace("%Y","");
|
||||
str->replace("%B","");
|
||||
str->replace("%C","");
|
||||
str->replace("%E","");
|
||||
str->replace("%M","");
|
||||
str->replace("%P","");
|
||||
str->replace("%U","");
|
||||
str->replace("%O","");
|
||||
str->replace("%I","");
|
||||
str->replace("%X","");
|
||||
RDResolveNowNextDateTime(str,"%D(",QDateTime());
|
||||
}
|
||||
str->replace("%%","%");
|
||||
str->replace("\\r","\n");
|
||||
str->replace("\\n","\r\n");
|
||||
}
|
||||
|
||||
|
||||
QString RDResolveNowNext(const QString &pattern,RDLogLine *ll,int line)
|
||||
{
|
||||
QString ret=pattern;
|
||||
|
||||
Reference in New Issue
Block a user