diff --git a/ChangeLog b/ChangeLog index 6f49c052..b0c862ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18306,3 +18306,15 @@ 2019-01-07 Fred Gleason * Added a 'pypad_shoutcast1.py' PyPAD script. * Removed the 'rlm_shoutcast1' RLM. +2019-01-07 Fred Gleason + * 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. diff --git a/apis/Makefile.am b/apis/Makefile.am index 320f61dd..5d48e5f9 100644 --- a/apis/Makefile.am +++ b/apis/Makefile.am @@ -21,8 +21,7 @@ ## Use automake to process this into a Makefile.in SUBDIRS = PyPAD\ - rivwebcapi\ - rlm + rivwebcapi CLEANFILES = *~\ *.idb\ diff --git a/apis/PyPAD/api/PyPAD.py b/apis/PyPAD/api/PyPAD.py index 4bc956a6..820b19a4 100644 --- a/apis/PyPAD/api/PyPAD.py +++ b/apis/PyPAD/api/PyPAD.py @@ -2,7 +2,7 @@ # # PAD processor for Rivendell # -# (C) Copyright 2018 Fred Gleason +# (C) Copyright 2018-2019 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 @@ -373,6 +373,10 @@ class Update(object): See the documentation for the 'escape()' method for valid field values. """ + # + # MAINTAINER'S NOTE: These mappings must be kept in sync with + # those in 'lib/rdnownext.cpp'! + # string=self.__replaceWildcardPair('a','artist',string,esc) string=self.__replaceWildcardPair('b','label',string,esc) string=self.__replaceWildcardPair('c','client',string,esc) diff --git a/apis/rlm/Makefile-example b/apis/rlm/Makefile-example deleted file mode 100644 index 6d8005c1..00000000 --- a/apis/rlm/Makefile-example +++ /dev/null @@ -1,32 +0,0 @@ -## Makefile -## -## An example Makefile for building Rivendell Loadable Modules -## -## (C) Copyright 2008-2018 Fred Gleason -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU Library General Public License -## version 2 as published by the Free Software Foundation. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public -## License along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -## - -OBJS = - rlm_icecast2.rlm\ - rlm_shoutcast1.rlm\ - rlm_tunein.rlm - -%.rlm: %.c - $(CC) $(CFLAGS) -fPIC -shared $< -o $@ - -all: $(OBJS) - -clean: - rm -f $(OBJS) *~ diff --git a/apis/rlm/Makefile.am b/apis/rlm/Makefile.am deleted file mode 100644 index 370b7a87..00000000 --- a/apis/rlm/Makefile.am +++ /dev/null @@ -1,60 +0,0 @@ -## automake.am -## -## Automake.am for rivendell/rlm -## -## (C) Copyright 2008,2016-2017 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 -## published by the Free Software Foundation. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public -## License along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -## -## Use automake to process this into a Makefile.in - -AM_CFLAGS = -fPIC -Wall -I../ - -RLM_MODULES = - -all: $(RLM_MODULES) - -%.rlm: %.c - $(CC) $(AM_CFLAGS) -I$(top_srcdir) -shared $< -o $@ - -install: all - mkdir -p $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell - cp $(RLM_MODULES) $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/ - mkdir -p $(DESTDIR)$(headerdir) - cp rlm.h $(DESTDIR)$(headerdir) - mkdir -p $(DESTDIR)$(prefix)/src/rlm - cp *.c $(DESTDIR)$(prefix)/src/rlm/ - cp Makefile-example $(DESTDIR)$(prefix)/src/rlm/Makefile - -headerdir = $(includedir)/rlm -header_HEADERS = rlm.h - -EXTRA_DIST = Makefile-example\ - rlm.h - -CLEANFILES = *~\ - *.idb\ - *ilk\ - *.obj\ - *.pdb\ - *.qm\ - *.rlm\ - moc_* - -MAINTAINERCLEANFILES = *~\ - *.tar.gz\ - aclocal.m4\ - configure\ - Makefile.in\ - moc_* diff --git a/apis/rlm/rlm.h b/apis/rlm/rlm.h deleted file mode 100644 index 5cfc1f80..00000000 --- a/apis/rlm/rlm.h +++ /dev/null @@ -1,362 +0,0 @@ -/* rlm.h - * - * The Rivendell Loadable Module Interface - * - * (C) Copyright 2008-2018 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 - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * - * This interface can be used to create "Rivendell Loadable Modules" [RLMs] - * that enable Rivendell's "Now & Next" capability to supply program associated - * data [PAD] to external devices and systems. Runtime module configuration - * is accomplished in RDAdmin->ManageHosts->RDAirPlay->ConfigureNow&Next. - * - * Compiled plugins are dynamically loadable libraries (DLLs) and have names - * of the form '.rlm'. The following callbacks are provided: - * - * void _RLMStart(void *ptr,const char *arg) - * Called once upon RDAirPlay startup. The plugin should do any necessary - * startup tasks (opening i/o devices, allocating memory, etc) here. The - * single argument 'arg' is a null-terminated string, consisting of the - * 'Argument' parameter supplied in the specific runtime configuration - * from RDAdmin. The 'ptr' argument is an opaque pointer that is - * used as the first argument to the utility functions. - * - * void _RLMFree(void *ptr) - * Called once upon RDAirPlay shutdown. Any system resources allocated - * by the plugin should be released here. The 'ptr' argument is an opaque - * pointer that is be used as the first argument to any of the utility - * functions. - * - * - * void _RLMPadDataSent(void *ptr,const struct rlm_svc *svc, - * const struct rlm_log *log, - * const struct rlm_pad *now, - * const struct rlm_pad *next) - * Called each time RDAirPlay changes play state on a log. The 'svc' - * and 'log' parameters provide information about the current log and - * service respectively. The 'ptr' argument is an opaque pointer that - * is used as the first argument to the utility functions. - * - * WARNING: the structures provided in this callback are dynamically - * allocated, their scope is valid only within the callback! - * - * void _RLMTimerExpired(void *ptr,int timernum) - * Called each time the system RLM timer indicated by 'timernum' expires. - * See the 'RLMStartTimer()' and 'RLMStopTimer()' functions for info on - * using timers. The 'ptr' argument is an opaque pointer that is - * used as the first argument to the utility functions. - * - * void _RLMSerialDataReceived(void *ptr,int handle, - * const char *data,int len) - * Called each time data is received on an open tty/serial device. See - * the 'RLMOpenSerial()' and 'RLMCloseSerial()' functions for info on - * using tty/serial devices. The 'ptr' argument is an opaque pointer - * that is used as the first argument to the utility functions. - */ - -#ifndef RLM_H -#define RLM_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * RLM Interface Version - */ -#define RLM_VERSION 18 - -/* - * Available Timers - */ -#define RLM_MAX_TIMERS 32 - -/* - * Timer Modes - * (for use in the RLMStartTimer() function). - */ -#define RLM_TIMER_REPEATING 0 -#define RLM_TIMER_ONESHOT 1 - -/* - * Parity Modes - * (for use in the RLMOpenSerial() function). - */ -#define RLM_PARITY_NONE 0 -#define RLM_PARITY_EVEN 1 -#define RLM_PARITY_ODD 2 - -/* - * Cart Types - * (for use in the 'rlm_carttype' field of the 'rlm_pad' struct) - */ -#define RLM_CARTTYPE_ALL 0 -#define RLM_CARTTYPE_AUDIO 1 -#define RLM_CARTTYPE_MACRO 2 - -/* - * Log Machine Modes - * (for use in the 'rlm_mode' field of the 'rlm_log' struct) - */ -#define RLM_LOGMODE_LIVEASSIST 1 -#define RLM_LOGMODE_AUTOMATIC 2 -#define RLM_LOGMODE_MANUAL 3 - -/* - * Data Encodings - * (for use in the RLMResolveNowNextEncoded() function). - */ -#define RLM_ENCODE_NONE 0 -#define RLM_ENCODE_XML 1 -#define RLM_ENCODE_URL 2 - -/* - * Virtual Logs - * - */ -#define RLM_VLOG_QUANTITY 20 - -/* - * Service data structure - */ - struct rlm_svc { - char svc_name[256]; /* Service name */ - char svc_pgmcode[256]; /* Program Code */ - char reserved[1536]; /* Reserved for future use */ - }; - -/* - * Log data structure - */ - struct rlm_log { - char log_name[65]; /* Log name */ - uint32_t log_mach; /* Log machine number, 0=Main, 1=Aux 1, 2=Aux2, - * 100 - 119=vLogs */ - char log_onair; /* On-air flag, 0=False, 1=True */ - uint32_t log_mode; /* Log machine mode, 1=LiveAssist, 2=Automatic, 3=Manual */ - char reserved[1974]; /* Reserved for future use */ - }; - -/* - * Metadata structure - */ - struct rlm_pad { - uint32_t rlm_cartnum; /* Rivendell cart number */ - uint32_t rlm_len; /* Event length, in milliseconds */ - char rlm_year[5]; /* Cart year */ - char rlm_group[11]; /* Rivendell Group Name */ - char rlm_title[256]; /* Cart 'title' field */ - char rlm_artist[256]; /* Cart 'artist' field */ - char rlm_label[65]; /* Cart 'label' field */ - char rlm_client[65]; /* Cart 'client' field */ - char rlm_agency[65]; /* Cart 'agency' field */ - char rlm_comp[65]; /* Cart 'composer' field */ - char rlm_pub[65]; /* Cart 'publisher' field */ - char rlm_userdef[256]; /* Cart 'user defined' field */ - char rlm_album[256]; /* Cart 'album' field */ - char rlm_isrc[12]; /* Cut International Standard Recording Code */ - char rlm_isci[32]; /* Cut ISCI Code */ - char rlm_carttype; /* Cart type, see RLM_CARTTYPE_* defines */ - char rlm_ext_eventid[33]; /* Event ID, from external scheduler */ - char rlm_ext_data[33]; /* Data, from external scheduler */ - char rlm_ext_annctype[1]; /* Announcement Type, from external scheduler */ - int32_t rlm_start_msec; /* Event start time, milliseconds part */ - int32_t rlm_start_sec; /* Event start time, seconds part */ - int32_t rlm_start_min; /* Event start time, minutes part */ - int32_t rlm_start_hour; /* Event start time, hours part */ - int32_t rlm_start_day; /* Event start date, day of month part */ - int32_t rlm_start_mon; /* Event start date, month of year part */ - int32_t rlm_start_year; /* Event start date, year part */ - char rlm_conductor[65]; /* Cart 'conductor' field */ - char rlm_song_id[33]; /* Cart 'songId' field */ - char rlm_outcue[65]; /* Cut outcue field */ - char rlm_description[65]; /* Cut description field */ - char reserved[305]; /* Reserved for future use */ - }; - -/* - * Communications Functions - * - * - * Send a UDP packet. - * - * The parameter is a null-terminated string consisting of the - * IPv4 destination address in dotted-quad notation, and is the - * destination UDP port number. All structures are in host (*not* network) - * byte order. The data to be sent, of length , is pointed to by - * . - */ - void RLMSendUdp(void *ptr,const char *ipaddr,uint16_t port, - const char *data,int len); - -/* - * Open a tty device (serial port) for output. - * - * The parameter is a null-terminated string consisting of the - * name of the tty device to open (e.g. "/dev/ttyS0"). The , - * and parameters define the communications - * parameters to be used. - * - * RETURNS: if successful, a non-negative integer that should be used - * as the argument for the RLMSendSerial() and RLMCloseSerial() - * functions. If unsuccessful, a negative integer will be returned. - */ - int RLMOpenSerial(void *ptr,const char *devname,int speed, - int parity,int word_length); - -/* - * Output data on a tty device. - * - * Output data of length pointed to by on the tty device - * indicated by the value returned by the RLMOpenSerial() function. - */ - void RLMSendSerial(void *ptr,int handle,const char *data,int len); - -/* - * Close a tty device. - * - * Close the tty device indicated by the value returned by the - * RLMOpenSerial() function. - */ - void RLMCloseSerial(void *ptr,int handle); - -/* - * Convienence Functions - */ - -/* - * Get a string indicating the system time. - * - * Returns a pointer to a null-terminated string indicating the system time, - * formatted as per the argument. The following wildcards are - * supported: - * d the day as number without a leading zero (1-31) - * dd the day as number with a leading zero (01-31) - * ddd the abbreviated localized day name (e.g. 'Mon'..'Sun'). - * dddd the long localized day name (e.g. 'Monday'..'Sunday'). - * M the month as number without a leading zero (1-12) - * MM the month as number with a leading zero (01-12) - * MMM the abbreviated localized month name (e.g. 'Jan'..'Dec'). - * MMMM the long localized month name (e.g. 'January'..'December'). - * yy the year as two digit number (00-99) - * yyyy the year as four digit number (1752-8000) - * h the hour without a leading zero (0..23 or 1..12 if AM/PM - * display) - * hh the hour with a leading zero (00..23 or 01..12 if AM/PM display) - * m the minute without a leading zero (0..59) - * mm the minute with a leading zero (00..59) - * s the second whithout a leading zero (0..59) - * ss the second whith a leading zero (00..59) - * z the milliseconds without leading zeroes (0..999) - * zzz the milliseconds with leading zeroes (000..999) - * AP use AM/PM display. AP will be replaced by either "AM" or "PM". - * ap use am/pm display. ap will be replaced by either "am" or "pm". - * - * RETURNS: A pointer to a null terminated string. This string is statically - * allocated, and may be reused in subsequent calls to the utility functions. - */ - const char *RLMDateTime(void *ptr,int offset_msecs,const char *format); - -/* - * Resolve standard Rivendell Now & Next wildcards, with the possiblity - * to encode the PAD fields. - * - * Returns a pointer to a null-terminated string resulting from resolving - * the 'standard' Rivendell Now & Next wildcards in accordance with the - * data values in the and parameters. The following wildcards - * are supported: - * - * Now Next Field - * ---------------------------------------------- - * %n %N The Rivendell cart number - * %h %H Event length (in milliseconds) - * %g %G The Rivendell group name - * %t %T Title - * %a %A Artist - * %l %L Album - * %y %Y Year - * %b %B Record Label - * %c %C Client - * %e %E Agency - * %m %M Composer - * %p %P Publisher - * %r %R Conductor - * %s %S Song ID - * %u %U User Definied - * %o %O Outcue - * %i %I Description - * %D(
) The current date/time, formatted according to
.
- * can be any of the wildcards supported by the RLMDateTime() - * function (see above). - * - * Additionally, an encoding can be specified to allow PAD fields to be - * escaped for a particular format. Available encodings are: - * - * RLM_ENCODE_NONE - Perform no character escaping. - * RLM_ENCODE_XML - Escape reserved characters as per XML-v1.0 - * RLM_ENCODE_URL - Escape reserved characters as per RFC 2396 Section 2.4 - * - * RETURNS: A pointer to a null terminated string. This string is statically - * allocated, and may be reused in subsequent calls to the utility functions. - */ - const char *RLMResolveNowNextEncoded(void *ptr,const struct rlm_pad *now, - const struct rlm_pad *next, - const char *format,int encoding); - -/* - * Resolve standard Rivendell Now & Next wildcards - * - * (NOTE: This function is deprecated, and included merely to keep old code - * working. It should *not* be used in new code. For a better alternative, - * see the RLMResolveNowNextEncoded() function above). - * - * Returns a pointer to a null-terminated string resulting from resolving - * the 'standard' Rivendell Now & Next wildcards in accordance with the - * data values in the and parameters. The list of available - * wildcards can be found in the 'metadata_wildcards.txt' file in the - * Rivendell documentation directory. - * - * RETURNS: A pointer to a null terminated string. This string is statically - * allocated, and may be reused in subsequent calls to the utility functions. - */ - const char *RLMResolveNowNext(void *ptr,const struct rlm_pad *now, - const struct rlm_pad *next,const char *format); - - void RLMLog(void *ptr,int prio,const char *msg); - void RLMStartTimer(void *ptr,int timernum,int msecs,int mode); - void RLMStopTimer(void *ptr,int timernum); - int RLMGetIntegerValue(void *ptr,const char *filename,const char *section, - const char *label,int default_value); - int RLMGetHexValue(void *ptr,const char *filename, - const char *section,const char *label,int default_value); - int RLMGetBooleanValue(void *ptr,const char *filename, - const char *section,const char *label, - int default_value); - const char *RLMGetStringValue(void *ptr,const char *filename, - const char *section,const char *label, - const char *default_value); - const char *RLMDateTimeDecode(void *ptr, const char *format, - const char *svc_name); - - -#ifdef __cplusplus -} -#endif - -#endif /* RLM_H */ diff --git a/configure.ac b/configure.ac index cce20c21..f3fab2f2 100644 --- a/configure.ac +++ b/configure.ac @@ -476,7 +476,6 @@ AC_CONFIG_FILES([rivendell.spec \ apis/rivwebcapi/rivwebcapi.pc \ apis/rivwebcapi/rivwebcapi/Makefile \ apis/rivwebcapi/tests/Makefile \ - apis/rlm/Makefile \ lib/rdpaths.h \ lib/Makefile \ rdhpi/Makefile \ diff --git a/lib/Makefile.am b/lib/Makefile.am index 69a5021e..69b15608 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -201,7 +201,6 @@ dist_librd_la_SOURCES = dbversion.h\ rdreport.cpp rdreport.h\ rdringbuffer.cpp rdringbuffer.h\ rdripc.cpp rdripc.h\ - rdrlmhost.cpp rdrlmhost.h\ rdschedcode.cpp rdschedcode.h\ rdschedcodes_dialog.cpp rdschedcodes_dialog.h\ rdsegmeter.cpp rdsegmeter.h\ @@ -321,7 +320,6 @@ nodist_librd_la_SOURCES = moc_rdadd_cart.cpp\ moc_rdrehash.cpp\ moc_rdrenderer.cpp\ moc_rdripc.cpp\ - moc_rdrlmhost.cpp\ moc_rdschedcodes_dialog.cpp\ moc_rdsegmeter.cpp\ moc_rdsimpleplayer.cpp\ diff --git a/lib/dbversion.h b/lib/dbversion.h index 184545d3..68ebe13e 100644 --- a/lib/dbversion.h +++ b/lib/dbversion.h @@ -24,7 +24,7 @@ /* * Current Database Version */ -#define RD_VERSION_DATABASE 304 +#define RD_VERSION_DATABASE 305 #endif // DBVERSION_H diff --git a/lib/lib.pro b/lib/lib.pro index 79102f81..e19cadae 100644 --- a/lib/lib.pro +++ b/lib/lib.pro @@ -136,7 +136,6 @@ SOURCES += rdrehash.cpp SOURCES += rdrenderer.cpp SOURCES += rdreport.cpp SOURCES += rdripc.cpp -SOURCES += rdrlmhost.cpp SOURCES += rdschedcode.cpp SOURCES += rdsegmeter.cpp SOURCES += rdsettings.cpp @@ -270,7 +269,6 @@ HEADERS += rdrehash.h HEADERS += rdrenderer.h HEADERS += rdreport.h HEADERS += rdripc.h -HEADERS += rdrlmhost.h HEADERS += rdschedcode.h HEADERS += rdsegmeter.h HEADERS += rdsettings.h diff --git a/lib/rdairplay_conf.cpp b/lib/rdairplay_conf.cpp index f9437735..b90b18a2 100644 --- a/lib/rdairplay_conf.cpp +++ b/lib/rdairplay_conf.cpp @@ -632,114 +632,6 @@ void RDAirPlayConf::setDescriptionTemplate(const QString &str) } -QHostAddress RDAirPlayConf::udpAddress(int logno) const -{ - QHostAddress addr; - QString sql=QString("select UDP_ADDR ")+ - "from LOG_MACHINES where STATION_NAME=\""+ - RDEscapeString(air_station)+"\" && "+ - QString().sprintf("MACHINE=%d",logno); - RDSqlQuery *q=new RDSqlQuery(sql); - if(q->first()) { - addr.setAddress(q->value(0).toString()); - } - delete q; - return addr; -} - - -void RDAirPlayConf::setUdpAddress(int logno,QHostAddress addr) const -{ - QString sql=QString("update LOG_MACHINES set ")+ - "UDP_ADDR=\""+RDEscapeString(addr.toString())+"\" where "+ - "STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+ - QString().sprintf("MACHINE=%d",logno); - RDSqlQuery *q=new RDSqlQuery(sql); - delete q; -} - - -Q_UINT16 RDAirPlayConf::udpPort(int logno) const -{ - Q_UINT16 ret=0; - QString sql=QString("select UDP_PORT ")+ - "from LOG_MACHINES where STATION_NAME=\""+ - RDEscapeString(air_station)+"\" && "+ - QString().sprintf("MACHINE=%d",logno); - RDSqlQuery *q=new RDSqlQuery(sql); - if(q->first()) { - ret=q->value(0).toUInt(); - } - delete q; - return ret; -} - - -void RDAirPlayConf::setUdpPort(int logno,Q_UINT16 port) const -{ - QString sql=QString("update LOG_MACHINES set ")+ - QString().sprintf("UDP_PORT=%u ",port)+"where "+ - "STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+ - QString().sprintf("MACHINE=%d",logno); - RDSqlQuery *q=new RDSqlQuery(sql); - delete q; -} - - -QString RDAirPlayConf::udpString(int logno) const -{ - QString ret; - QString sql=QString("select UDP_STRING ")+ - "from LOG_MACHINES where STATION_NAME=\""+ - RDEscapeString(air_station)+"\" && "+ - QString().sprintf("MACHINE=%d",logno); - RDSqlQuery *q=new RDSqlQuery(sql); - if(q->first()) { - ret=q->value(0).toString(); - } - delete q; - return ret; -} - - -void RDAirPlayConf::setUdpString(int logno,const QString &str) const -{ - QString sql=QString("update LOG_MACHINES set ")+ - "UDP_STRING=\""+RDEscapeString(str)+"\" where "+ - "STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+ - QString().sprintf("MACHINE=%d",logno); - RDSqlQuery *q=new RDSqlQuery(sql); - delete q; -} - - -QString RDAirPlayConf::logRml(int logno) const -{ - QString ret; - QString sql=QString("select LOG_RML ")+ - "from LOG_MACHINES where STATION_NAME=\""+ - RDEscapeString(air_station)+"\" && "+ - QString().sprintf("MACHINE=%d",logno); - RDSqlQuery *q=new RDSqlQuery(sql); - if(q->first()) { - ret=q->value(0).toString(); - } - delete q; - return ret; -} - - -void RDAirPlayConf::setLogRml(int logno,const QString &str) const -{ - QString sql=QString("update LOG_MACHINES set ")+ - "LOG_RML=\""+RDEscapeString(str)+"\" where "+ - "STATION_NAME=\""+RDEscapeString(air_station)+"\" &&"+ - QString().sprintf("MACHINE=%d",logno); - RDSqlQuery *q=new RDSqlQuery(sql); - delete q; -} - - RDAirPlayConf::ExitCode RDAirPlayConf::exitCode() const { return (RDAirPlayConf::ExitCode) diff --git a/lib/rdairplay_conf.h b/lib/rdairplay_conf.h index 3bf25f08..51fbf1ea 100644 --- a/lib/rdairplay_conf.h +++ b/lib/rdairplay_conf.h @@ -129,14 +129,6 @@ class RDAirPlayConf void setDescriptionTemplate(const QString &str); bool hourSelectorEnabled() const; void setHourSelectorEnabled(bool state) const; - QHostAddress udpAddress(int logno) const; - void setUdpAddress(int logno,QHostAddress addr) const; - Q_UINT16 udpPort(int logno) const; - void setUdpPort(int logno,Q_UINT16 port) const; - QString udpString(int logno) const; - void setUdpString(int logno,const QString &str) const; - QString logRml(int logno) const; - void setLogRml(int logno,const QString &str) const; RDAirPlayConf::ExitCode exitCode() const; void setExitCode(RDAirPlayConf::ExitCode code) const; RDAirPlayConf::ExitCode virtualExitCode() const; diff --git a/lib/rdlogplay.cpp b/lib/rdlogplay.cpp index 8265553a..23493b74 100644 --- a/lib/rdlogplay.cpp +++ b/lib/rdlogplay.cpp @@ -2,7 +2,7 @@ // // Rivendell Log Playout Machine // -// (C) Copyright 2002-2009,2016-2018 Fred Gleason +// (C) Copyright 2002-2019 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 @@ -41,8 +41,7 @@ //#define SHOW_SLOTS //#define SHOW_METER_SLOTS -RDLogPlay::RDLogPlay(int id,RDEventPlayer *player,Q3SocketDevice *nn_sock, - std::vector *rlm_hosts,QObject *parent) +RDLogPlay::RDLogPlay(int id,RDEventPlayer *player,QObject *parent) : QObject(parent),RDLogEvent("") { // @@ -51,8 +50,6 @@ RDLogPlay::RDLogPlay(int id,RDEventPlayer *player,Q3SocketDevice *nn_sock, play_log=NULL; play_id=id; play_event_player=player; - // play_pad_socket=pad_sock; - play_rlm_hosts=rlm_hosts; play_onair_flag=false; play_segue_length=rda->airplayConf()->segueLength()+1; play_trans_length=rda->airplayConf()->transLength()+1; @@ -68,7 +65,6 @@ RDLogPlay::RDLogPlay(int id,RDEventPlayer *player,Q3SocketDevice *nn_sock, play_trans_line=-1; play_grace_line=-1; next_channel=0; - play_nownext_socket=nn_sock; play_timescaling_available=false; play_rescan_pos=0; play_refreshable=false; @@ -78,11 +74,11 @@ RDLogPlay::RDLogPlay(int id,RDEventPlayer *player,Q3SocketDevice *nn_sock, } // - // RLM2 Connection + // PAD Server Connection // play_pad_socket=new RDUnixSocket(this); if(!play_pad_socket->connectToAbstract(RD_PAD_SOURCE_UNIX_ADDRESS)) { - fprintf(stderr,"RLMHost: unable to connect to rdrlmd\n"); + fprintf(stderr,"RDLogPlat: unable to connect to rdpadd\n"); } // @@ -105,10 +101,6 @@ RDLogPlay::RDLogPlay(int id,RDEventPlayer *player,Q3SocketDevice *nn_sock, } play_macro_running=false; play_refresh_pending=false; - play_nownext_string=rda->airplayConf()->udpString(id); - play_nownext_address=rda->airplayConf()->udpAddress(id); - play_nownext_port=rda->airplayConf()->udpPort(id); - play_nownext_rml=rda->airplayConf()->logRml(id); play_now_cartnum=0; play_next_cartnum=0; play_prevnow_cartnum=0; @@ -2878,13 +2870,6 @@ void RDLogPlay::SendNowNext() // // Get NOW PLAYING Event // - /* - if(play_nownext_address.isNull()&&play_nownext_rml.isEmpty()&& - (play_rlm_hosts->size()==0)) { - return; - } - */ - QString cmd=play_nownext_string; int lines[TRANSPORT_QUANTITY]; int running=runningEvents(lines,false); for(int i=0;iwrite(QString("{\r\n").toUtf8()); play_pad_socket->write(QString(" \"padUpdate\": {\r\n").toUtf8()); @@ -3021,25 +3006,6 @@ void RDLogPlay::SendNowNext() play_pad_socket->write(QString(" }\r\n").toUtf8()); play_pad_socket->write(QString("}\r\n\r\n").toUtf8()); - // - // Old-style RLM Hosts - // - for(unsigned i=0;isize();i++) { - play_rlm_hosts->at(i)-> - sendEvent(svcname,logName(),play_id,logline,play_onair_flag,play_op_mode); - } - - // - // Premordial integrated interface - // - RDResolveNowNext(&cmd,logline,now_line,0); - play_nownext_socket-> - writeBlock(cmd,cmd.length(),play_nownext_address,play_nownext_port); - - cmd=play_nownext_rml; - RDResolveNowNext(&cmd,logline,now_line,0); - play_event_player->exec(cmd); - // // Clean up // diff --git a/lib/rdlogplay.h b/lib/rdlogplay.h index dd3e214e..e3d50f45 100644 --- a/lib/rdlogplay.h +++ b/lib/rdlogplay.h @@ -2,7 +2,7 @@ // // Rivendell Log Playout Machine // -// (C) Copyright 2002-2004,2016-2018 Fred Gleason +// (C) Copyright 2002-2019 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 @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -37,7 +36,6 @@ #include #include #include -#include #include #include @@ -54,8 +52,7 @@ class RDLogPlay : public QObject,public RDLogEvent { Q_OBJECT public: - RDLogPlay(int id,RDEventPlayer *player,Q3SocketDevice *nn_sock, - std::vector *rlm_hosts,QObject *parent=0); + RDLogPlay(int id,RDEventPlayer *player,QObject *parent=0); QString serviceName() const; void setServiceName(const QString &svcname); QString defaultServiceName() const; @@ -224,10 +221,6 @@ class RDLogPlay : public QObject,public RDLogEvent RDPlayDeck *play_deck[RD_MAX_STREAMS]; bool play_deck_active[RD_MAX_STREAMS]; int next_channel; - Q3SocketDevice *play_nownext_socket; - QString play_nownext_string; - QHostAddress play_nownext_address; - Q_UINT16 play_nownext_port; QString play_nownext_rml; bool play_timescaling_supported[RD_MAX_CARDS]; QString play_svc_name; @@ -240,7 +233,6 @@ class RDLogPlay : public QObject,public RDLogEvent bool play_onair_flag; int play_duck_volume_port1; int play_duck_volume_port2; - std::vector *play_rlm_hosts; unsigned play_now_cartnum; unsigned play_next_cartnum; unsigned play_prevnow_cartnum; diff --git a/lib/rdnownext.cpp b/lib/rdnownext.cpp index 173c6d95..bb8616cf 100644 --- a/lib/rdnownext.cpp +++ b/lib/rdnownext.cpp @@ -1,8 +1,11 @@ // rdnownext.cpp // -// Rivendell Now & Next Implementation +// Rivendell Metadata Wildcards Implementation // -// (C) Copyright 2008,2016 Fred Gleason +// MAINTAINERS'S NOTE: These mappings must be kept in sync with those +// in 'apis/PyPAD/api/PyPAD.py'! +// +// (C) Copyright 2008-2019 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 @@ -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; diff --git a/lib/rdnownext.h b/lib/rdnownext.h index d58b71a1..616f651e 100644 --- a/lib/rdnownext.h +++ b/lib/rdnownext.h @@ -1,8 +1,8 @@ // rdnownext.h // -// Rivendell Now & Next Implementation +// Rivendell Metadata Wildcards Implementation // -// (C) Copyright 2008,2016 Fred Gleason +// (C) Copyright 2008-2019 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 @@ -22,9 +22,7 @@ #define RDNOWNEXT_H #include -#include "../apis/rlm/rlm.h" -void RDResolveNowNext(QString *str,RDLogLine **loglines,int line,int encoding); QString RDResolveNowNext(const QString &pattern,RDLogLine *ll,int line); diff --git a/lib/rdrlmhost.cpp b/lib/rdrlmhost.cpp deleted file mode 100644 index 011a7559..00000000 --- a/lib/rdrlmhost.cpp +++ /dev/null @@ -1,542 +0,0 @@ -// rdrlmhost.cpp -// -// A container class for a Rivendell Loadable Module host. -// -// (C) Copyright 2008,2016-2018 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 -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#include -#include - -#include - -#include "rdapplication.h" -#include "rdconf.h" -#include "rddatedecode.h" -#include "rdnownext.h" -#include "rdprofile.h" -#include "rdrlmhost.h" -#include "rdsvc.h" - -//#include "globals.h" - - -RDRLMHost::RDRLMHost(const QString &path,const QString &arg, - Q3SocketDevice *udp_socket,QObject *parent) - : QObject(parent) -{ - plugin_path=RDDateDecode(path,QDate::currentDate(),rda->station(),rda->config()); - plugin_arg=RDDateDecode(arg,QDate::currentDate(),rda->station(),rda->config()); - plugin_udp_socket=udp_socket; - plugin_handle=NULL; - plugin_start_sym=NULL; - plugin_free_sym=NULL; - plugin_pad_data_sent_sym=NULL; - plugin_timer_expired_sym=NULL; - plugin_serial_data_received_sym=NULL; - - // - // Utility Timers - // - QSignalMapper *mapper=new QSignalMapper(this); - connect(mapper,SIGNAL(mapped(int)),this,SLOT(timerData(int))); - for(int i=0;isetMapping(plugin_callback_timers[i],i); - connect(plugin_callback_timers[i],SIGNAL(timeout()),mapper,SLOT(map())); - } -} - - -RDRLMHost::~RDRLMHost() -{ -} - - -QString RDRLMHost::pluginPath() const -{ - return plugin_path; -} - - -QString RDRLMHost::pluginArg() const -{ - return plugin_arg; -} - - -void RDRLMHost::sendEvent(const QString &svcname,const QString &logname, - int lognum,RDLogLine **loglines,bool onair, - RDAirPlayConf::OpMode mode) -{ - if(plugin_pad_data_sent_sym!=NULL) { - QDateTime now_dt(QDate::currentDate(),QTime::currentTime()); - struct rlm_svc *svc=new struct rlm_svc; - struct rlm_log *log=new struct rlm_log; - struct rlm_pad *now=new struct rlm_pad; - struct rlm_pad *next=new struct rlm_pad; - memset(svc,0,sizeof(struct rlm_svc)); - RDSvc *service=new RDSvc(svcname,rda->station(),rda->config()); - if(!svcname.isEmpty()) { - sprintf(svc->svc_name,"%s",(const char *)svcname.left(255)); - if(!service->programCode().isEmpty()) { - sprintf(svc->svc_pgmcode,"%s",(const char *)service->programCode()); - } - else { - svc->svc_pgmcode[0]=0; - } - } - else { - svc->svc_name[0]=0; - svc->svc_pgmcode[0]=0; - } - delete service; - memset(log,0,sizeof(struct rlm_log)); - if(!logname.isEmpty()) { - sprintf(log->log_name,"%s",(const char *)logname.left(64)); - } - else { - log->log_name[0]=0; - } - log->log_mach=lognum; - log->log_onair=onair; - log->log_mode=mode; - RDRLMHost::loadMetadata(loglines[0],now,now_dt); - RDRLMHost::loadMetadata(loglines[1],next); - plugin_pad_data_sent_sym(this,svc,log,now,next); - delete next; - delete now; - delete log; - delete svc; - } -} - - -bool RDRLMHost::load() -{ - QString basename=RDGetBasePart(plugin_path); - basename=basename.left(basename.findRev(".")); - if((plugin_handle=dlopen(plugin_path,RTLD_LAZY))==NULL) { - return false; - } - *(void **)(&plugin_start_sym)=dlsym(plugin_handle,basename+"_RLMStart"); - *(void **)(&plugin_free_sym)=dlsym(plugin_handle,basename+"_RLMFree"); - *(void **)(&plugin_pad_data_sent_sym)= - dlsym(plugin_handle,basename+"_RLMPadDataSent"); - *(void **)(&plugin_timer_expired_sym)= - dlsym(plugin_handle,basename+"_RLMTimerExpired"); - *(void **)(&plugin_serial_data_received_sym)= - dlsym(plugin_handle,basename+"_RLMSerialDataReceived"); - if(plugin_start_sym!=NULL) { - plugin_start_sym(this,plugin_arg); - } - - return true; -} - - -void RDRLMHost::unload() -{ - if(plugin_free_sym!=NULL) { - plugin_free_sym(this); - } -} - - -void RDRLMHost::loadMetadata(const RDLogLine *logline,struct rlm_pad *pad, - const QDateTime &start_datetime) -{ - QDateTime now(QDate::currentDate(),QTime::currentTime()); - - if(pad==NULL) { - return; - } - memset(pad,0,sizeof(struct rlm_pad)); - if(logline==NULL) { - return; - } - if(logline!=NULL) { - pad->rlm_cartnum=logline->cartNumber(); - switch(logline->cartType()) { - case RDCart::Audio: - pad->rlm_len=logline->effectiveLength(); - break; - - case RDCart::Macro: - if((logline->eventLength()>=0)&&logline->useEventLength()) { - pad->rlm_len=logline->eventLength(); - } - else { - pad->rlm_len=logline->effectiveLength(); - } - break; - - case RDCart::All: - break; - } - pad->rlm_carttype=logline->cartType(); - if(!logline->year().isNull()) { - snprintf(pad->rlm_year,5,"%s", - (const char *)logline->year().toString("yyyy")); - } - if(!logline->groupName().isEmpty()) { - snprintf(pad->rlm_group,11,"%s", - (const char *)logline->groupName().utf8()); - } - if(!logline->title().isEmpty()) { - snprintf(pad->rlm_title,256,"%s",(const char *)logline->title().utf8()); - } - if(!logline->artist().isEmpty()) { - snprintf(pad->rlm_artist,256,"%s",(const char *)logline->artist().utf8()); - } - if(!logline->label().isEmpty()) { - snprintf(pad->rlm_label,65,"%s",(const char *)logline->label().utf8()); - } - if(!logline->client().isEmpty()) { - snprintf(pad->rlm_client,65,"%s",(const char *)logline->client().utf8()); - } - if(!logline->agency().isEmpty()) { - snprintf(pad->rlm_agency,65,"%s",(const char *)logline->agency().utf8()); - } - if(!logline->composer().isEmpty()) { - snprintf(pad->rlm_comp,65,"%s",(const char *)logline->composer().utf8()); - } - if(!logline->publisher().isEmpty()) { - snprintf(pad->rlm_pub,65,"%s",(const char *)logline->publisher().utf8()); - } - if(!logline->userDefined().isEmpty()) { - snprintf(pad->rlm_userdef,256,"%s", - (const char *)logline->userDefined().utf8()); - } - if(!logline->outcue().isEmpty()) { - snprintf(pad->rlm_outcue,65,"%s",(const char *)logline->outcue().utf8()); - } - if(!logline->description().isEmpty()) { - snprintf(pad->rlm_description,65,"%s", - (const char *)logline->description().utf8()); - } - if(!logline->conductor().isEmpty()) { - snprintf(pad->rlm_conductor,65,"%s", - (const char *)logline->conductor().utf8()); - } - if(!logline->songId().isEmpty()) { - snprintf(pad->rlm_song_id,33,"%s",(const char *)logline->songId().utf8()); - } - if(!logline->album().isEmpty()) { - snprintf(pad->rlm_album,256,"%s",(const char *)logline->album().utf8()); - } - if(!logline->isrc().isEmpty()) { - strncpy(pad->rlm_isrc,(const char *)logline->isrc().utf8().left(12),12); - } - if(!logline->isci().isEmpty()) { - strncpy(pad->rlm_isci,(const char *)logline->isci().utf8().left(32),32); - } - if(!logline->extData().isEmpty()) { - snprintf(pad->rlm_ext_data,32,"%s",(const char *)logline->extData()); - } - if(!logline->extEventId().isEmpty()) { - snprintf(pad->rlm_ext_eventid,32,"%s", - (const char *)logline->extEventId()); - } - if(!logline->extAnncType().isEmpty()) { - snprintf(pad->rlm_ext_annctype,32,"%s", - (const char *)logline->extAnncType()); - } - if(start_datetime.isValid()) { - pad->rlm_start_msec=start_datetime.time().msec(); - pad->rlm_start_sec=start_datetime.time().second(); - pad->rlm_start_min=start_datetime.time().minute(); - pad->rlm_start_hour=start_datetime.time().hour(); - pad->rlm_start_day=start_datetime.date().day(); - pad->rlm_start_mon=start_datetime.date().month(); - pad->rlm_start_year=start_datetime.date().year(); - } - else { - QTime start_time=logline->startTime(RDLogLine::Predicted); - if(start_time.isNull()) { - start_time=logline->startTime(RDLogLine::Imported); - } - if(!start_time.isNull()) { - if(start_timerlm_start_msec=start_time.msec(); - pad->rlm_start_sec=start_time.second(); - pad->rlm_start_min=start_time.minute(); - pad->rlm_start_hour=start_time.hour(); - pad->rlm_start_day=now.date().day(); - pad->rlm_start_mon=now.date().month(); - pad->rlm_start_year=now.date().year(); - } - } -} - - -void RDRLMHost::saveMetadata(const struct rlm_pad *pad,RDLogLine *logline) -{ - if(logline==NULL) { - return; - } - logline->clear(); - if(pad==NULL) { - return; - } - logline->setCartNumber(pad->rlm_cartnum); - logline->setForcedLength(pad->rlm_len); - logline->setYear(QDate(QString(pad->rlm_year).toInt(),1,1)); - logline->setGroupName(pad->rlm_group); - logline->setTitle(pad->rlm_title); - logline->setArtist(pad->rlm_artist); - logline->setLabel(pad->rlm_label); - logline->setClient(pad->rlm_client); - logline->setAgency(pad->rlm_agency); - logline->setComposer(pad->rlm_comp); - logline->setPublisher(pad->rlm_pub); - logline->setUserDefined(pad->rlm_userdef); - logline->setOutcue(pad->rlm_outcue); - logline->setDescription(pad->rlm_description); - logline->setAlbum(pad->rlm_album); - logline->setIsrc(QString::fromAscii(pad->rlm_isrc,12)); - logline->setIsci(QString::fromAscii(pad->rlm_isci,32)); - if((pad->rlm_start_year>0)&&(pad->rlm_start_mon>0)&&(pad->rlm_start_day)) { - logline->setStartDatetime(QDateTime(QDate(pad->rlm_start_year, - pad->rlm_start_mon, - pad->rlm_start_day), - QTime(pad->rlm_start_hour, - pad->rlm_start_min, - pad->rlm_start_sec, - pad->rlm_start_msec))); - } - else { - logline->setStartDatetime(QDateTime()); - } -} - - -void RDRLMHost::timerData(int timernum) -{ - if(plugin_timer_expired_sym!=NULL) { - plugin_timer_expired_sym(this,timernum); - } -} - - -void RDRLMHost::ttyReceiveReadyData(int fd) -{ - char data[1024]; - int n; - - for(unsigned i=0;ifileDescriptor()==fd) { - while((n=plugin_tty_devices[i]->readBlock(data,1024))>0) { - if(plugin_serial_data_received_sym!=NULL) { - plugin_serial_data_received_sym(this,i,data,n); - } - } - return; - } - } - fprintf(stderr,"unknown tty descriptor: %d\n",fd); -} - - -// -// RLM Utility Functions -// -void RLMSendUdp(void *ptr,const char *ipaddr,uint16_t port, - const char *data,int len) -{ - RDRLMHost *host=(RDRLMHost *)ptr; - QHostAddress addr; - addr.setAddress(ipaddr); - if(!addr.isNull()) { - host->plugin_udp_socket->writeBlock(data,len,addr,port); - } -} - - -int RLMOpenSerial(void *ptr,const char *port,int speed,int parity, - int word_length) -{ - RDRLMHost *host=(RDRLMHost *)ptr; - host->plugin_tty_devices.push_back(new RDTTYDevice()); - host->plugin_tty_devices.back()->setName(port); - host->plugin_tty_devices.back()->setSpeed(speed); - host->plugin_tty_devices.back()->setParity((RDTTYDevice::Parity)parity); - host->plugin_tty_devices.back()->setWordLength(word_length); - if(host->plugin_tty_devices.back()->open(QIODevice::ReadWrite)) { - - host->plugin_tty_notifiers. - push_back(new QSocketNotifier(host->plugin_tty_devices.back()->fileDescriptor(), - QSocketNotifier::Read)); - host->connect(host->plugin_tty_notifiers.back(),SIGNAL(activated(int)), - host,SLOT(ttyReceiveReadyData(int))); - return (int)host->plugin_tty_devices.size()-1; - } - return -1; -} - - -void RLMSendSerial(void *ptr,int handle,const char *data,int len) -{ - RDRLMHost *host=(RDRLMHost *)ptr; - if((handle<0)||(handle>=(int)host->plugin_tty_devices.size())) { - return; - } - host->plugin_tty_devices[handle]->writeBlock(data,len); -} - - -void RLMCloseSerial(void *ptr,int handle) -{ - RDRLMHost *host=(RDRLMHost *)ptr; - - // - // FIXME: We really ought to take out the trash here! - // - host->plugin_tty_devices[handle]->close(); - delete host->plugin_tty_devices[handle]; - host->plugin_tty_devices[handle]=NULL; -} - - -const char *RLMDateTime(void *ptr,int offset_msecs,const char *format) -{ - RDRLMHost *host=(RDRLMHost *)ptr; - QDateTime datetime=QDateTime(QDate::currentDate(),QTime::currentTime(). - addMSecs(offset_msecs)); - strncpy(host->plugin_value_string,datetime.toString(format),1024); - return host->plugin_value_string; -} - - -const char *RLMResolveNowNextEncoded(void *ptr,const struct rlm_pad *now, - const struct rlm_pad *next, - const char *format,int encoding) -{ - RDRLMHost *host=(RDRLMHost *)ptr; - RDLogLine *loglines[2]; - QString str=format; - - loglines[0]=new RDLogLine(); - loglines[1]=new RDLogLine(); - RDRLMHost::saveMetadata(now,loglines[0]); - RDRLMHost::saveMetadata(next,loglines[1]); - RDResolveNowNext(&str,loglines,0,encoding); - strncpy(host->plugin_value_string,str,1024); - delete loglines[1]; - delete loglines[0]; - - return host->plugin_value_string; -} - - -const char *RLMResolveNowNext(void *ptr,const struct rlm_pad *now, - const struct rlm_pad *next,const char *format) -{ - return RLMResolveNowNextEncoded(ptr,now,next,format,RLM_ENCODE_NONE); -} - - -void RLMLog(void *ptr,int prio,const char *msg) -{ - rda->config()->log("log machine",(RDConfig::LogPriority)prio,msg); -} - - -void RLMStartTimer(void *ptr,int timernum,int msecs,int mode) -{ - RDRLMHost *host=(RDRLMHost *)ptr; - if((timernum<0)||(timernum>=RLM_MAX_TIMERS)) { - return; - } - if(host->plugin_callback_timers[timernum]->isActive()) { - host->plugin_callback_timers[timernum]->stop(); - } - host->plugin_callback_timers[timernum]->start(msecs,mode); -} - - -void RLMStopTimer(void *ptr,int timernum) -{ - RDRLMHost *host=(RDRLMHost *)ptr; - if((timernum<0)||(timernum>=RLM_MAX_TIMERS)) { - return; - } - if(host->plugin_callback_timers[timernum]->isActive()) { - host->plugin_callback_timers[timernum]->stop(); - } -} - - -int RLMGetIntegerValue(void *ptr,const char *filename,const char *section, - const char *label,int default_value) -{ - RDProfile *p=new RDProfile(); - p->setSource(filename); - int r=p->intValue(section,label,default_value); - delete p; - return r; -} - - -int RLMGetHexValue(void *ptr,const char *filename,const char *section, - const char *label,int default_value) -{ - RDProfile *p=new RDProfile(); - p->setSource(filename); - int r=p->hexValue(section,label,default_value); - delete p; - return r; -} - - -int RLMGetBooleanValue(void *ptr,const char *filename,const char *section, - const char *label,int default_value) -{ - RDProfile *p=new RDProfile(); - p->setSource(filename); - bool r=p->boolValue(section,label,default_value); - delete p; - return (int)r; -} - - -const char *RLMGetStringValue(void *ptr,const char *filename, - const char *section,const char *label, - const char *default_value) -{ - RDRLMHost *host=(RDRLMHost *)ptr; - RDProfile *p=new RDProfile(); - p->setSource(filename); - strncpy(host->plugin_value_string, - p->stringValue(section,label,default_value),1024); - delete p; - return host->plugin_value_string; -} - - -const char *RLMDateTimeDecode(void *ptr, const char *format, - const char *svc_name) -{ - RDRLMHost *host=(RDRLMHost *)ptr; - strncpy(host->plugin_value_string, - RDDateTimeDecode(format,QDateTime::currentDateTime(), - rda->station(),rda->config(), - svc_name),1024); - return host->plugin_value_string; -} diff --git a/lib/rdrlmhost.h b/lib/rdrlmhost.h deleted file mode 100644 index 64664f43..00000000 --- a/lib/rdrlmhost.h +++ /dev/null @@ -1,107 +0,0 @@ -// rdrlmhost.h -// -// A container class for a Rivendell Loadable Module host. -// -// (C) Copyright 2008,2016-2018 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 -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#ifndef RDRLMHOST_H -#define RDRLMHOST_H - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "../apis/rlm/rlm.h" - -class RDRLMHost : public QObject -{ - Q_OBJECT - public: - RDRLMHost(const QString &path,const QString &arg,Q3SocketDevice *udp_socket, - QObject *parent=0); - ~RDRLMHost(); - QString pluginPath() const; - QString pluginArg() const; - void sendEvent(const QString &svcname,const QString &logname, - int lognum,RDLogLine **loglines,bool onair, - RDAirPlayConf::OpMode mode); - bool load(); - void unload(); - static void loadMetadata(const RDLogLine *logline,struct rlm_pad *pad, - const QDateTime &start_datetime=QDateTime()); - static void saveMetadata(const struct rlm_pad *pad,RDLogLine *logline); - private slots: - void timerData(int timernum); - void ttyReceiveReadyData(int fd); - - private: - QString plugin_path; - QString plugin_arg; - Q3SocketDevice *plugin_udp_socket; - void *plugin_handle; - void (*plugin_start_sym)(void *,const char *); - void (*plugin_free_sym)(void *); - void (*plugin_pad_data_sent_sym) - (void *,const struct rlm_svc *,const struct rlm_log *, - const struct rlm_pad *,const struct rlm_pad *); - void (*plugin_timer_expired_sym)(void *,int); - void (*plugin_serial_data_received_sym)(void *,int,const char *,int); - - std::vector plugin_tty_devices; - std::vector plugin_tty_notifiers; - QTimer *plugin_callback_timers[RLM_MAX_TIMERS]; - friend void RLMSendUdp(void *ptr,const char *ipaddr,uint16_t port, - const char *data,int len); - friend int RLMOpenSerial(void *ptr,const char *port,int speed, - int parity,int word_length); - friend void RLMSendSerial(void *ptr,int handle,const char *data, - int len); - friend void RLMCloseSerial(void *ptr,int handle); - friend const char *RLMDateTime(int offset_msecs,const char *format); - friend const char *RLMResolveNowNextEncoded(void *ptr, - const struct rlm_pad *now, - const struct rlm_pad *next, - const char *format, - int encoding); - friend const char *RLMResolveNowNext(void *ptr, - const struct rlm_pad *now, - const struct rlm_pad *next, - const char *format); - friend void RLMLog(void *ptr,int prio,const char *msg); - friend void RLMStartTimer(void *ptr,int timernum,int msecs, - int mode); - friend void RLMStopTimer(void *ptr,int timernum); - friend const char *RLMDateTime(void *ptr,int offset_msecs, - const char *format); - friend const char *RLMGetStringValue(void *ptr,const char *filename, - const char *section,const char *label, - const char *default_value); - friend const char *RLMDateTimeDecode(void *ptr, const char *format, - const char *svc_name); - char plugin_value_string[1024]; -}; - - -#endif // RDRLMHOST_H diff --git a/rdadmin/Makefile.am b/rdadmin/Makefile.am index 1e1415b3..d3753663 100644 --- a/rdadmin/Makefile.am +++ b/rdadmin/Makefile.am @@ -71,8 +71,6 @@ dist_rdadmin_SOURCES = add_feed.cpp add_feed.h\ edit_livewiregpio.cpp edit_livewiregpio.h\ edit_matrix.cpp edit_matrix.h\ edit_node.cpp edit_node.h\ - edit_now_next.cpp edit_now_next.h\ - edit_nownextplugin.cpp edit_nownextplugin.h\ edit_pypad.cpp edit_pypad.h\ edit_rdairplay.cpp edit_rdairplay.h\ edit_rdlibrary.cpp edit_rdlibrary.h\ @@ -150,8 +148,6 @@ nodist_rdadmin_SOURCES = moc_add_feed.cpp\ moc_edit_livewiregpio.cpp\ moc_edit_matrix.cpp\ moc_edit_node.cpp\ - moc_edit_now_next.cpp\ - moc_edit_nownextplugin.cpp\ moc_edit_pypad.cpp\ moc_edit_rdairplay.cpp\ moc_edit_rdlibrary.cpp\ diff --git a/rdadmin/edit_now_next.cpp b/rdadmin/edit_now_next.cpp deleted file mode 100644 index 019f9797..00000000 --- a/rdadmin/edit_now_next.cpp +++ /dev/null @@ -1,571 +0,0 @@ -// edit_now_next.cpp -// -// Edit the Now & Next Configuration for a Rivendell Workstation. -// -// (C) Copyright 2002-2018 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 -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#include -#include - -#include -#include -#include -#include -#include - -#include "edit_now_next.h" -#include "edit_nownextplugin.h" -#include "globals.h" - -EditNowNext::EditNowNext(RDAirPlayConf *conf,QWidget *parent) - : QDialog(parent) -{ - setModal(true); - - QString sql; - RDSqlQuery *q; - RDListViewItem *item; - - nownext_conf=conf; - - // - // Create Fonts - // - QFont normal_font=QFont("Helvetica",12,QFont::Normal); - normal_font.setPixelSize(12); - QFont font=QFont("Helvetica",12,QFont::Bold); - font.setPixelSize(12); - QFont section_font=QFont("Helvetica",14,QFont::Bold); - section_font.setPixelSize(14); - - // - // Fix the Window Size - // - setMinimumWidth(sizeHint().width()); - setMaximumWidth(sizeHint().width()); - setMinimumHeight(sizeHint().height()); - setMaximumHeight(sizeHint().height()); - - setWindowTitle("RDAdmin - "+tr("Edit Now & Next Data")); - - // - // Text Validator - // - RDTextValidator *validator=new RDTextValidator(this); - QIntValidator *int_validator=new QIntValidator(1,999999,this); - - // - // Button Mappers - // - QSignalMapper *now_mapper=new QSignalMapper(this); - connect(now_mapper,SIGNAL(mapped(int)),this,SLOT(editNowcartData(int))); - QSignalMapper *next_mapper=new QSignalMapper(this); - connect(next_mapper,SIGNAL(mapped(int)),this,SLOT(editNextcartData(int))); - - // - // Master Log Label - // - QLabel *label=new QLabel(tr("Master Log"),this); - label->setGeometry(10,7,100,19); - label->setFont(section_font); - label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter); - - // - // Master Log UDP Address - // - nownext_address_edit[0]=new QLineEdit(this); - nownext_address_edit[0]->setGeometry(135,33,120,19); - label=new QLabel(nownext_address_edit[0],tr("IP Address:"),this); - label->setGeometry(10,33,120,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - - // - // Master Log UDP Port - // - nownext_port_spin[0]=new QSpinBox(this); - nownext_port_spin[0]->setGeometry(375,33,60,19); - nownext_port_spin[0]->setRange(0,65535); - label=new QLabel(nownext_port_spin[0],tr("UDP Port:"),this); - label->setGeometry(270,33,100,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - - // - // Master Log UDP String - // - nownext_string_edit[0]=new QLineEdit(this); - nownext_string_edit[0]->setGeometry(135,55,sizeHint().width()-145,19); - label=new QLabel(nownext_string_edit[0],tr("UDP String:"),this); - label->setGeometry(10,55,120,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - - // - // Master Log RML - // - nownext_rml_edit[0]=new QLineEdit(this); - nownext_rml_edit[0]->setGeometry(135,77,sizeHint().width()-145,19); - nownext_rml_edit[0]->setValidator(validator); - label=new QLabel(nownext_rml_edit[0],tr("RML:"),this); - label->setGeometry(10,77,120,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - - // - // Main Log Default Now Cart - // - nownext_nowcart_edit[0]=new QLineEdit(this); - nownext_nowcart_edit[0]->setGeometry(135,104,60,19); - nownext_nowcart_edit[0]->setValidator(int_validator); - label=new QLabel(nownext_nowcart_edit[0],tr("Default Now Cart:"),this); - label->setGeometry(10,104,120,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - QPushButton *button=new QPushButton(this); - button->setGeometry(205,101,50,26); - button->setFont(normal_font); - button->setText(tr("Select")); - now_mapper->setMapping(button,0); - connect(button,SIGNAL(clicked()),now_mapper,SLOT(map())); - - // - // Main Log Default Next Cart - // - nownext_nextcart_edit[0]=new QLineEdit(this); - nownext_nextcart_edit[0]->setGeometry(135,136,60,19); - nownext_nextcart_edit[0]->setValidator(int_validator); - label=new QLabel(nownext_nextcart_edit[0],tr("Default Next Cart:"),this); - label->setGeometry(10,136,120,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - button=new QPushButton(this); - button->setGeometry(205,132,50,26); - button->setFont(normal_font); - button->setText(tr("Select")); - next_mapper->setMapping(button,0); - connect(button,SIGNAL(clicked()),next_mapper,SLOT(map())); - - // - // Aux Log 1 Label - // - label=new QLabel(tr("Aux Log 1"),this); - label->setGeometry(10,175,100,19); - label->setFont(section_font); - label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter); - - // - // Aux Log 1 UDP Address - // - nownext_address_edit[1]=new QLineEdit(this); - nownext_address_edit[1]->setGeometry(135,201,120,19); - label=new QLabel(nownext_address_edit[1],tr("IP Address:"),this); - label->setGeometry(10,201,120,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - - // - // Aux Log 1 UDP Port - // - nownext_port_spin[1]=new QSpinBox(this); - nownext_port_spin[1]->setGeometry(375,201,60,19); - nownext_port_spin[1]->setRange(0,65535); - label=new QLabel(nownext_port_spin[1],tr("UDP Port:"),this); - label->setGeometry(270,201,100,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - - // - // Aux Log 1 UDP String - // - nownext_string_edit[1]=new QLineEdit(this); - nownext_string_edit[1]->setGeometry(135,223,sizeHint().width()-145,19); - label=new QLabel(nownext_string_edit[1],tr("UDP String:"),this); - label->setGeometry(10,223,120,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - - // - // Aux Log 1 RML - // - nownext_rml_edit[1]=new QLineEdit(this); - nownext_rml_edit[1]->setGeometry(135,245,sizeHint().width()-145,19); - nownext_rml_edit[1]->setValidator(validator); - label=new QLabel(nownext_rml_edit[1],tr("RML:"),this); - label->setGeometry(10,245,120,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - - // - // Aux 1 Log Default Now Cart - // - nownext_nowcart_edit[1]=new QLineEdit(this); - nownext_nowcart_edit[1]->setGeometry(135,272,60,19); - nownext_nowcart_edit[1]->setValidator(int_validator); - label=new QLabel(nownext_nowcart_edit[1],tr("Default Now Cart:"),this); - label->setGeometry(10,272,120,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - button=new QPushButton(this); - button->setGeometry(205,269,50,26); - button->setFont(normal_font); - button->setText(tr("Select")); - now_mapper->setMapping(button,1); - connect(button,SIGNAL(clicked()),now_mapper,SLOT(map())); - - // - // Aux 1 Log Default Next Cart - // - nownext_nextcart_edit[1]=new QLineEdit(this); - nownext_nextcart_edit[1]->setGeometry(135,304,60,19); - nownext_nextcart_edit[1]->setValidator(int_validator); - label=new QLabel(nownext_nextcart_edit[1],tr("Default Next Cart:"),this); - label->setGeometry(10,304,120,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - button=new QPushButton(this); - button->setGeometry(205,300,50,26); - button->setFont(normal_font); - button->setText(tr("Select")); - next_mapper->setMapping(button,1); - connect(button,SIGNAL(clicked()),next_mapper,SLOT(map())); - - // - // Aux Log 2 Label - // - label=new QLabel(tr("Aux Log 2"),this); - label->setGeometry(10,343,100,19); - label->setFont(section_font); - label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter); - - // - // Aux Log 2 UDP Address - // - nownext_address_edit[2]=new QLineEdit(this); - nownext_address_edit[2]->setGeometry(135,369,120,19); - label=new QLabel(nownext_address_edit[2],tr("IP Address:"),this); - label->setGeometry(10,369,120,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - - // - // Aux Log 2 UDP Port - // - nownext_port_spin[2]=new QSpinBox(this); - nownext_port_spin[2]->setGeometry(375,369,60,19); - nownext_port_spin[2]->setRange(0,65535); - label=new QLabel(nownext_port_spin[2],tr("UDP Port:"),this); - label->setGeometry(270,369,100,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - - // - // Aux Log 2 UDP String - // - nownext_string_edit[2]=new QLineEdit(this); - nownext_string_edit[2]->setGeometry(135,391,sizeHint().width()-145,19); - label=new QLabel(nownext_string_edit[2],tr("UDP String:"),this); - label->setGeometry(10,391,120,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - - // - // Aux Log 2 RML - // - nownext_rml_edit[2]=new QLineEdit(this); - nownext_rml_edit[2]->setGeometry(135,413,sizeHint().width()-145,19); - nownext_rml_edit[2]->setValidator(validator); - label=new QLabel(nownext_rml_edit[2],tr("RML:"),this); - label->setGeometry(10,413,120,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - - // - // Aux 1 Log Default Now Cart - // - nownext_nowcart_edit[2]=new QLineEdit(this); - nownext_nowcart_edit[2]->setGeometry(135,440,60,19); - nownext_nowcart_edit[2]->setValidator(int_validator); - label=new QLabel(nownext_nowcart_edit[2],tr("Default Now Cart:"),this); - label->setGeometry(10,440,120,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - button=new QPushButton(this); - button->setGeometry(205,437,50,26); - button->setFont(normal_font); - button->setText(tr("Select")); - now_mapper->setMapping(button,2); - connect(button,SIGNAL(clicked()),now_mapper,SLOT(map())); - - // - // Aux 1 Log Default Next Cart - // - nownext_nextcart_edit[2]=new QLineEdit(this); - nownext_nextcart_edit[2]->setGeometry(135,472,60,19); - nownext_nextcart_edit[2]->setValidator(int_validator); - label=new QLabel(nownext_nextcart_edit[2],tr("Default Next Cart:"),this); - label->setGeometry(10,472,120,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - button=new QPushButton(this); - button->setGeometry(205,469,50,26); - button->setFont(normal_font); - button->setText(tr("Select")); - next_mapper->setMapping(button,2); - connect(button,SIGNAL(clicked()),next_mapper,SLOT(map())); - - // - // Plugin List - // - nownext_plugin_list=new RDListView(this); - nownext_plugin_list->setGeometry(10,540,sizeHint().width()-20,120); - nownext_plugin_list->setItemMargin(5); - nownext_plugin_list->addColumn(tr("Path")); - nownext_plugin_list->setColumnAlignment(0,Qt::AlignLeft|Qt::AlignVCenter); - nownext_plugin_list->addColumn(tr("Argument")); - nownext_plugin_list->setColumnAlignment(1,Qt::AlignLeft|Qt::AlignVCenter); - nownext_plugin_list->setAllColumnsShowFocus(true); - connect(nownext_plugin_list, - SIGNAL(doubleClicked(Q3ListViewItem *,const QPoint &,int)), - this, - SLOT(pluginDoubleClickedData(Q3ListViewItem *,const QPoint &,int))); - - label=new QLabel(nownext_plugin_list,tr("Loadable Modules:"),this); - label->setGeometry(10,518,sizeHint().width()-20,19); - label->setFont(section_font); - label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter); - - nownext_add_button=new QPushButton(tr("Add"),this); - nownext_add_button->setGeometry(sizeHint().width()-210,665,60,25); - nownext_add_button->setFont(font); - connect(nownext_add_button,SIGNAL(clicked()),this,SLOT(addPluginData())); - - nownext_edit_button=new QPushButton(tr("Edit"),this); - nownext_edit_button->setGeometry(sizeHint().width()-140,665,60,25); - nownext_edit_button->setFont(font); - connect(nownext_edit_button,SIGNAL(clicked()),this,SLOT(editPluginData())); - - nownext_delete_button=new QPushButton(tr("Delete"),this); - nownext_delete_button->setGeometry(sizeHint().width()-70,665,60,25); - nownext_delete_button->setFont(font); - connect(nownext_delete_button,SIGNAL(clicked()), - this,SLOT(deletePluginData())); - - // - // Ok Button - // - QPushButton *ok_button=new QPushButton(this); - ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50); - ok_button->setDefault(true); - ok_button->setFont(font); - ok_button->setText(tr("&OK")); - connect(ok_button,SIGNAL(clicked()),this,SLOT(okData())); - - // - // Cancel Button - // - QPushButton *cancel_button=new QPushButton(this); - cancel_button-> - setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50); - cancel_button->setFont(font); - cancel_button->setText(tr("&Cancel")); - connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData())); - - // - // Populate Fields - // - for(int i=0;i<3;i++) { - nownext_address_edit[i]->setText(nownext_conf->udpAddress(i).toString()); - nownext_port_spin[i]->setValue(nownext_conf->udpPort(i)); - nownext_string_edit[i]->setText(nownext_conf->udpString(i)); - nownext_rml_edit[i]->setText(nownext_conf->logRml(i)); - if(nownext_conf->logNowCart(i)>0) { - nownext_nowcart_edit[i]-> - setText(QString().sprintf("%06u",nownext_conf->logNowCart(i))); - } - if(nownext_conf->logNextCart(i)>0) { - nownext_nextcart_edit[i]-> - setText(QString().sprintf("%06u",nownext_conf->logNextCart(i))); - } - } - sql=QString("select ")+ - "ID,"+ // 00 - "PLUGIN_PATH,"+ // 01 - "PLUGIN_ARG "+ // 02 - "from NOWNEXT_PLUGINS where "+ - "(STATION_NAME=\""+RDEscapeString(nownext_conf->station())+"\") && "+ - "(LOG_MACHINE=0)"; - q=new RDSqlQuery(sql); - while(q->next()) { - item=new RDListViewItem(nownext_plugin_list); - item->setId(q->value(0).toInt()); - item->setText(0,q->value(1).toString()); - item->setText(1,q->value(2).toString()); - } - delete q; -} - - -EditNowNext::~EditNowNext() -{ -} - - -QSize EditNowNext::sizeHint() const -{ - return QSize(445,770); -} - - -QSizePolicy EditNowNext::sizePolicy() const -{ - return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); -} - - -void EditNowNext::addPluginData() -{ - QString path; - QString arg; - EditNowNextPlugin *d=new EditNowNextPlugin(&path,&arg,this); - if(d->exec()==0) { - RDListViewItem *item=new RDListViewItem(nownext_plugin_list); - item->setId(-1); - item->setText(0,path); - item->setText(1,arg); - nownext_plugin_list->ensureItemVisible(item); - } - delete d; -} - - -void EditNowNext::editPluginData() -{ - RDListViewItem *item= - (RDListViewItem *)nownext_plugin_list->selectedItem(); - if(item==NULL) { - return; - } - QString path=item->text(0); - QString arg=item->text(1); - EditNowNextPlugin *d=new EditNowNextPlugin(&path,&arg,this); - if(d->exec()==0) { - item->setText(0,path); - item->setText(1,arg); - } - delete d; -} - - -void EditNowNext::deletePluginData() -{ - RDListViewItem *item=(RDListViewItem *)nownext_plugin_list->selectedItem(); - if(item==NULL) { - return; - } - delete item; -} - - -void EditNowNext::pluginDoubleClickedData(Q3ListViewItem *item,const QPoint &pt, - int col) -{ - editPluginData(); -} - - -void EditNowNext::editNowcartData(int lognum) -{ - int cartnum=nownext_nowcart_edit[lognum]->text().toInt(); - if(admin_cart_dialog->exec(&cartnum,RDCart::All,NULL,0, - rda->user()->name(),rda->user()->password())==0) { - nownext_nowcart_edit[lognum]->setText(QString().sprintf("%06d",cartnum)); - } -} - - -void EditNowNext::editNextcartData(int lognum) -{ - int cartnum=nownext_nextcart_edit[lognum]->text().toInt(); - if(admin_cart_dialog->exec(&cartnum,RDCart::All,NULL,0, - rda->user()->name(),rda->user()->password())==0) { - nownext_nextcart_edit[lognum]->setText(QString().sprintf("%06d",cartnum)); - } -} - - -void EditNowNext::okData() -{ - QHostAddress addr[3]; - QString sql; - RDSqlQuery *q; - RDListViewItem *item; - - for(int i=0;i<3;i++) { - if(nownext_address_edit[i]->text().isEmpty()) { - nownext_address_edit[i]->setText("0.0.0.0"); - } - if(!addr[i].setAddress(nownext_address_edit[i]->text())) { - QMessageBox::warning(this,tr("Invalid Address"), - tr("The IP address")+ - " \""+nownext_address_edit[i]->text()+"\" "+ - tr("is invalid!")); - return; - } - } - for(int i=0;i<3;i++) { - nownext_conf->setUdpAddress(i,addr[i]); - nownext_conf->setUdpPort(i,(Q_UINT16)nownext_port_spin[i]->value()); - nownext_conf->setUdpString(i,nownext_string_edit[i]->text()); - nownext_conf->setLogRml(i,nownext_rml_edit[i]->text()); - if(nownext_nowcart_edit[i]->text().isEmpty()) { - nownext_conf->setLogNowCart(i,0); - } - else { - nownext_conf->setLogNowCart(i,nownext_nowcart_edit[i]->text().toUInt()); - } - if(nownext_nextcart_edit[i]->text().isEmpty()) { - nownext_conf->setLogNextCart(i,0); - } - else { - nownext_conf->setLogNextCart(i,nownext_nextcart_edit[i]->text().toUInt()); - } - sql=QString("delete from NOWNEXT_PLUGINS where ")+ - "(STATION_NAME=\""+RDEscapeString(nownext_conf->station())+"\")&&"+ - QString().sprintf("(LOG_MACHINE=%d)",i); - q=new RDSqlQuery(sql); - delete q; - } - item=(RDListViewItem *)nownext_plugin_list->firstChild(); - while(item!=NULL) { - sql=QString("insert into NOWNEXT_PLUGINS set ")+ - "STATION_NAME=\""+RDEscapeString(nownext_conf->station())+"\","+ - "LOG_MACHINE=0,"+ - "PLUGIN_PATH=\""+RDEscapeString(item->text(0))+"\","+ - "PLUGIN_ARG=\""+RDEscapeString(item->text(1))+"\""; - q=new RDSqlQuery(sql); - delete q; - item=(RDListViewItem *)item->nextSibling(); - } - done(0); -} - - -void EditNowNext::cancelData() -{ - done(-1); -} diff --git a/rdadmin/edit_now_next.h b/rdadmin/edit_now_next.h deleted file mode 100644 index 3ba16fd3..00000000 --- a/rdadmin/edit_now_next.h +++ /dev/null @@ -1,70 +0,0 @@ -// edit_now_next.h -// -// Edit the Now & Next Configuration for a Rivendell Workstation -// -// (C) Copyright 2002-2018 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 -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#ifndef EDIT_NOW_NEXT_H -#define EDIT_NOW_NEXT_H - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -class EditNowNext : public QDialog -{ - Q_OBJECT - public: - EditNowNext(RDAirPlayConf *conf,QWidget *parent=0); - ~EditNowNext(); - QSize sizeHint() const; - QSizePolicy sizePolicy() const; - - private slots: - void addPluginData(); - void editPluginData(); - void deletePluginData(); - void pluginDoubleClickedData(Q3ListViewItem *item,const QPoint &pt,int col); - void editNowcartData(int lognum); - void editNextcartData(int lognum); - void okData(); - void cancelData(); - - private: - QLineEdit *nownext_address_edit[3]; - QSpinBox *nownext_port_spin[3]; - QLineEdit *nownext_string_edit[3]; - QLineEdit *nownext_rml_edit[3]; - QLineEdit *nownext_nowcart_edit[3]; - QLineEdit *nownext_nextcart_edit[3]; - RDListView *nownext_plugin_list; - QPushButton *nownext_add_button; - QPushButton *nownext_edit_button; - QPushButton *nownext_delete_button; - RDAirPlayConf *nownext_conf; -}; - - -#endif - diff --git a/rdadmin/edit_nownextplugin.cpp b/rdadmin/edit_nownextplugin.cpp deleted file mode 100644 index 9ca9d95c..00000000 --- a/rdadmin/edit_nownextplugin.cpp +++ /dev/null @@ -1,153 +0,0 @@ -// edit_nownextplugin.cpp -// -// Edit a Rivendell Now & Next Plugin Configuration -// -// (C) Copyright 2008-2018 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 -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#include -#include -#include -#include - -#include -#include - -#include "edit_nownextplugin.h" - -EditNowNextPlugin::EditNowNextPlugin(QString *path,QString *arg, - QWidget *parent) - : QDialog(parent) -{ - setModal(true); - - plugin_path=path; - plugin_arg=arg; - - // - // Fix the Window Size - // - setMinimumWidth(sizeHint().width()); - setMaximumWidth(sizeHint().width()); - setMinimumHeight(sizeHint().height()); - setMaximumHeight(sizeHint().height()); - - setWindowTitle("RDAdmin - "+tr("Edit Plugin")); - - // - // Create Fonts - // - QFont font=QFont("Helvetica",12,QFont::Bold); - font.setPixelSize(12); - QFont user_font=QFont("Helvetica",12,QFont::Normal); - user_font.setPixelSize(12); - - // - // Path - // - plugin_path_edit=new QLineEdit(this); - plugin_path_edit->setGeometry(110,11,sizeHint().width()-180,19); - plugin_path_edit->setMaxLength(255); - QLabel *label=new QLabel(plugin_path_edit,tr("Plugin Path:"),this); - label->setGeometry(10,11,95,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter|Qt::TextShowMnemonic); - QPushButton *button=new QPushButton(tr("Select"),this); - button->setGeometry(sizeHint().width()-60,10,50,22); - button->setFont(user_font); - connect(button,SIGNAL(clicked()),this,SLOT(selectData())); - - // - // Argument - // - plugin_arg_edit=new QLineEdit(this); - plugin_arg_edit->setGeometry(110,38,sizeHint().width()-120,19); - plugin_arg_edit->setMaxLength(255); - label=new QLabel(plugin_arg_edit,tr("Argument:"),this); - label->setGeometry(10,38,95,19); - label->setFont(font); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter|Qt::TextShowMnemonic); - - // - // Ok Button - // - QPushButton *ok_button=new QPushButton(this); - ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50); - ok_button->setDefault(true); - ok_button->setFont(font); - ok_button->setText(tr("&OK")); - connect(ok_button,SIGNAL(clicked()),this,SLOT(okData())); - - // - // Cancel Button - // - QPushButton *cancel_button=new QPushButton(this); - cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60, - 80,50); - cancel_button->setFont(font); - cancel_button->setText(tr("&Cancel")); - connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData())); - - plugin_path_edit->setText(*path); - plugin_arg_edit->setText(*arg); -} - - -EditNowNextPlugin::~EditNowNextPlugin() -{ - delete plugin_path_edit; - delete plugin_arg_edit; -} - - -QSize EditNowNextPlugin::sizeHint() const -{ - return QSize(400,130); -} - - -QSizePolicy EditNowNextPlugin::sizePolicy() const -{ - return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); -} - - -void EditNowNextPlugin::selectData() -{ - QString filename=RD_MODULES_DIR; - if(!plugin_path_edit->text().isEmpty()) { - filename=plugin_path_edit->text(); - } - filename=Q3FileDialog::getOpenFileName(filename,RD_MODULE_FILE_FILTER, - this,"",tr("Select plugin")); - if(!filename.isNull()) { - plugin_path_edit->setText(filename); - } -} - - -void EditNowNextPlugin::okData() -{ - *plugin_path=plugin_path_edit->text(); - *plugin_arg=plugin_arg_edit->text(); - done(0); -} - - -void EditNowNextPlugin::cancelData() -{ - done(-1); -} diff --git a/rdadmin/edit_nownextplugin.h b/rdadmin/edit_nownextplugin.h deleted file mode 100644 index 2a796389..00000000 --- a/rdadmin/edit_nownextplugin.h +++ /dev/null @@ -1,49 +0,0 @@ -// edit_nownextplugin.h -// -// Edit a Rivendell Now & Next Plugin Configuration -// -// (C) Copyright 2008-2018 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 -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#ifndef EDIT_NOWNEXTPLUGIN_H -#define EDIT_NOWNEXTPLUGIN_H - -#include -#include - -class EditNowNextPlugin : public QDialog -{ - Q_OBJECT - public: - EditNowNextPlugin(QString *path,QString *arg,QWidget *parent=0); - ~EditNowNextPlugin(); - QSize sizeHint() const; - QSizePolicy sizePolicy() const; - - private slots: - void selectData(); - void okData(); - void cancelData(); - - private: - QLineEdit *plugin_path_edit; - QLineEdit *plugin_arg_edit; - QString *plugin_path; - QString *plugin_arg; -}; - - -#endif // EDIT_NOWNEXTPLUGIN_H diff --git a/rdadmin/edit_rdairplay.cpp b/rdadmin/edit_rdairplay.cpp index a2061eff..d7cd8be2 100644 --- a/rdadmin/edit_rdairplay.cpp +++ b/rdadmin/edit_rdairplay.cpp @@ -40,7 +40,6 @@ #include "edit_rdairplay.h" #include "edit_hotkeys.h" -#include "edit_now_next.h" #include "edit_channelgpios.h" #include "globals.h" @@ -292,15 +291,6 @@ EditRDAirPlay::EditRDAirPlay(RDStation *station,RDStation *cae_station, button->setText(tr("Configure Hot Keys")); connect(button,SIGNAL(clicked()),this,SLOT(editHotKeys())); - // - // Now & Next Button - // - button=new QPushButton(this); - button->setGeometry(200,385,180,50); - button->setFont(small_font); - button->setText(tr("Configure Now && Next\nParameters")); - connect(button,SIGNAL(clicked()),this,SLOT(nownextData())); - // // Sound Panel First Play Output // @@ -1128,13 +1118,6 @@ void EditRDAirPlay::selectData() } -void EditRDAirPlay::nownextData() -{ - EditNowNext *edit=new EditNowNext(air_conf,this); - edit->exec(); - delete edit; -} - void EditRDAirPlay::editHotKeys() { QString module_name = QString("airplay"); diff --git a/rdadmin/edit_rdairplay.h b/rdadmin/edit_rdairplay.h index e1dcbcc2..15e6db7a 100644 --- a/rdadmin/edit_rdairplay.h +++ b/rdadmin/edit_rdairplay.h @@ -59,7 +59,6 @@ class EditRDAirPlay : public QDialog void virtualModeActivatedData(int vlognum); void startModeChangedData(int mode); void selectData(); - void nownextData(); void editHotKeys(); void selectSkinData(); void modeControlActivatedData(int n); diff --git a/rdadmin/edit_rdpanel.cpp b/rdadmin/edit_rdpanel.cpp index c6c9a97e..40b59dc3 100644 --- a/rdadmin/edit_rdpanel.cpp +++ b/rdadmin/edit_rdpanel.cpp @@ -38,7 +38,6 @@ #include #include -#include "edit_now_next.h" #include "edit_rdpanel.h" EditRDPanel::EditRDPanel(RDStation *station,RDStation *cae_station, diff --git a/rdadmin/rdadmin.pro b/rdadmin/rdadmin.pro index 8e4e4fd6..427b004b 100644 --- a/rdadmin/rdadmin.pro +++ b/rdadmin/rdadmin.pro @@ -45,8 +45,6 @@ x11 { SOURCES += edit_jack_client.cpp SOURCES += edit_livewiregpio.cpp SOURCES += edit_matrix.cpp - SOURCES += edit_nownextplugin.cpp - SOURCES += edit_now_next.cpp SOURCES += edit_pypad.cpp SOURCES += edit_rdairplay.cpp SOURCES += edit_rdlibrary.cpp @@ -114,8 +112,6 @@ x11 { HEADERS += edit_jack_client.h HEADERS += edit_livewiregpio.h HEADERS += edit_matrix.h - HEADERS += edit_nownextplugin.h - HEADERS += edit_now_next.h HEADERS += edit_pypad.h HEADERS += edit_rdairplay.h HEADERS += edit_rdlibrary.h diff --git a/rdadmin/rdadmin_cs.ts b/rdadmin/rdadmin_cs.ts index 9162ca58..3132c5b2 100644 --- a/rdadmin/rdadmin_cs.ts +++ b/rdadmin/rdadmin_cs.ts @@ -2187,122 +2187,122 @@ GPIOs EditNowNext Edit Now & Next Data - Upravit data Nyní & Další + Upravit data Nyní & Další Master Log - Hlavní zápis + Hlavní zápis IP Address: - Adresa IP: + Adresa IP: UDP Port: - Přípojka UDP: + Přípojka UDP: UDP String: - Řetězec UDP: + Řetězec UDP: RML: - RML: + RML: Aux Log 1 - Pomocný zápis 1 + Pomocný zápis 1 &OK - &OK + &OK &Cancel - Z&rušit + Z&rušit The IP address - Adresa IP + Adresa IP is invalid! - je neplatná! + je neplatná! Invalid Address - Neplatná adresa + Neplatná adresa Add - Přidat + Přidat Edit - Upravit + Upravit Delete - Smazat + Smazat Path - Cesta + Cesta Argument - Argument + Argument Loadable Modules: - Nahratelné moduly: + Nahratelné moduly: Default Now Cart: - Výchozí vozík Nyní: + Výchozí vozík Nyní: Default Next Cart: - Výchozí vozík Další: + Výchozí vozík Další: Select - Vybrat + Vybrat Aux Log 2 - Pomocný zápis 2 + Pomocný zápis 2 EditNowNextPlugin Edit Plugin - Upravit přídavný modul + Upravit přídavný modul Plugin Path: - Cesta k přídavnému modulu: + Cesta k přídavnému modulu: Argument: - Argument: + Argument: &OK - &OK + &OK &Cancel - Z&rušit + Z&rušit Select - Vybrat + Vybrat Select plugin - Vybrat přídavný modul + Vybrat přídavný modul @@ -2529,7 +2529,7 @@ GPIOs Configure Now && Next Parameters - Nastavit parametry + Nastavit parametry Nyní && Další diff --git a/rdadmin/rdadmin_de.ts b/rdadmin/rdadmin_de.ts index fcf2dd6b..f24ab043 100644 --- a/rdadmin/rdadmin_de.ts +++ b/rdadmin/rdadmin_de.ts @@ -2101,122 +2101,122 @@ GPIOs EditNowNext Edit Now & Next Data - Now & Next Daten editieren + Now & Next Daten editieren Master Log - Hauptlog + Hauptlog IP Address: - IP-Adresse: + IP-Adresse: UDP Port: - UDP Port: + UDP Port: UDP String: - UDP String: + UDP String: RML: - RML: + RML: Aux Log 1 - Aux Log 1 + Aux Log 1 &OK - &OK + &OK &Cancel - Abbre&chen + Abbre&chen The IP address - Die IP-Adresse + Die IP-Adresse is invalid! - ist ungültig! + ist ungültig! Invalid Address - Ungültige Adresse + Ungültige Adresse Add - Hinzufügen + Hinzufügen Edit - Editieren + Editieren Delete - Löschen + Löschen Path - Pfad + Pfad Argument - Argument + Argument Loadable Modules: - Ladbare Module: + Ladbare Module: Default Now Cart: - Standard-Now-Cart: + Standard-Now-Cart: Default Next Cart: - Standard-Next-Cart: + Standard-Next-Cart: Select - Auswählen + Auswählen Aux Log 2 - Aux Log 2 + Aux Log 2 EditNowNextPlugin Edit Plugin - Plugin editieren + Plugin editieren Plugin Path: - Plugin-Pfad: + Plugin-Pfad: Argument: - Argument: + Argument: &OK - &OK + &OK &Cancel - Abbre&chen + Abbre&chen Select - Auswählen + Auswählen Select plugin - Plugin wählen + Plugin wählen @@ -2443,7 +2443,7 @@ GPIOs Configure Now && Next Parameters - Now && Next-Parameter + Now && Next-Parameter konfigurieren diff --git a/rdadmin/rdadmin_es.ts b/rdadmin/rdadmin_es.ts index 32139b57..0aebab31 100644 --- a/rdadmin/rdadmin_es.ts +++ b/rdadmin/rdadmin_es.ts @@ -2200,122 +2200,122 @@ GPIOs EditNowNext Edit Now & Next Data - Editar datos Now & Next + Editar datos Now & Next Master Log - Lista Maestra + Lista Maestra IP Address: - Dirección IP: + Dirección IP: UDP Port: - Puerto UDP: + Puerto UDP: UDP String: - Cadena UDP: + Cadena UDP: RML: - RML: + RML: Aux Log 1 - Lista aux. 1 + Lista aux. 1 &OK - &Aceptar + &Aceptar &Cancel - &Cancelar + &Cancelar The IP address - ¡La dirección IP + ¡La dirección IP is invalid! - es inválida! + es inválida! Invalid Address - Dirección inválida + Dirección inválida Add - Añadir + Añadir Edit - Editar + Editar Delete - Borrar + Borrar Path - Carpeta + Carpeta Argument - Argumento + Argumento Loadable Modules: - Módulos Cargables: + Módulos Cargables: Default Now Cart: - Cart.Now p/omis.: + Cart.Now p/omis.: Default Next Cart: - Cart.Next p/omis.: + Cart.Next p/omis.: Select - Elegir + Elegir Aux Log 2 - Lista aux. 2 + Lista aux. 2 EditNowNextPlugin Edit Plugin - Editar Plugin + Editar Plugin Plugin Path: - Carpeta Plugins: + Carpeta Plugins: Argument: - Argumento: + Argumento: &OK - &Aceptar + &Aceptar &Cancel - &Cancelar + &Cancelar Select - Elegir + Elegir Select plugin - Elegir plugin + Elegir plugin @@ -2410,7 +2410,7 @@ GPIOs Configure Now && Next Parameters - Parámetros Now && Next + Parámetros Now && Next Manual Segue: diff --git a/rdadmin/rdadmin_fr.ts b/rdadmin/rdadmin_fr.ts index f6d3cb5c..1ffab6ce 100644 --- a/rdadmin/rdadmin_fr.ts +++ b/rdadmin/rdadmin_fr.ts @@ -1743,128 +1743,6 @@ GPIOs - - EditNowNext - - Edit Now & Next Data - - - - Master Log - - - - IP Address: - - - - UDP Port: - - - - UDP String: - - - - RML: - - - - Aux Log 1 - - - - &OK - - - - &Cancel - - - - The IP address - - - - is invalid! - - - - Invalid Address - - - - Add - - - - Edit - - - - Delete - - - - Path - - - - Argument - - - - Loadable Modules: - - - - Default Now Cart: - - - - Default Next Cart: - - - - Select - - - - Aux Log 2 - - - - - EditNowNextPlugin - - Edit Plugin - - - - Plugin Path: - - - - Argument: - - - - &OK - - - - &Cancel - - - - Select - - - - Select plugin - - - EditPypad @@ -2066,11 +1944,6 @@ GPIOs Start Next - - Configure Now && Next -Parameters - - Start/Stop Settings diff --git a/rdadmin/rdadmin_nb.ts b/rdadmin/rdadmin_nb.ts index 41a17f73..d7edb28a 100644 --- a/rdadmin/rdadmin_nb.ts +++ b/rdadmin/rdadmin_nb.ts @@ -2073,122 +2073,74 @@ GPIOs EditNowNext Edit Now & Next Data - Rediger no & neste data + Rediger no & neste data Master Log - Hovudlogg + Hovudlogg IP Address: - IP-adresse: + IP-adresse: UDP Port: - UDP-port: + UDP-port: UDP String: - UDP-streng: + UDP-streng: RML: - RMS: + RMS: Aux Log 1 - Hjelpelogg 1 + Hjelpelogg 1 &OK - &OK + &OK &Cancel - &Avbryt + &Avbryt The IP address - IP-adressa + IP-adressa is invalid! - er ugyldig! + er ugyldig! Invalid Address - Ugyldig adresse - - - Default Now Cart: - + Ugyldig adresse Select - Vel - - - Default Next Cart: - - - - Path - - - - Argument - - - - Loadable Modules: - - - - Add - - - - Edit - - - - Delete - + Vel Aux Log 2 - Hjelpelogg 2 + Hjelpelogg 2 EditNowNextPlugin - - Edit Plugin - - - - Plugin Path: - - Select - Vel - - - Argument: - + Vel &OK - &OK + &OK &Cancel - &Avbryt - - - Select plugin - + &Avbryt @@ -2419,7 +2371,7 @@ GPIOs Configure Now && Next Parameters - Set opp no && Neste + Set opp no && Neste parametrar diff --git a/rdadmin/rdadmin_nn.ts b/rdadmin/rdadmin_nn.ts index 41a17f73..d7edb28a 100644 --- a/rdadmin/rdadmin_nn.ts +++ b/rdadmin/rdadmin_nn.ts @@ -2073,122 +2073,74 @@ GPIOs EditNowNext Edit Now & Next Data - Rediger no & neste data + Rediger no & neste data Master Log - Hovudlogg + Hovudlogg IP Address: - IP-adresse: + IP-adresse: UDP Port: - UDP-port: + UDP-port: UDP String: - UDP-streng: + UDP-streng: RML: - RMS: + RMS: Aux Log 1 - Hjelpelogg 1 + Hjelpelogg 1 &OK - &OK + &OK &Cancel - &Avbryt + &Avbryt The IP address - IP-adressa + IP-adressa is invalid! - er ugyldig! + er ugyldig! Invalid Address - Ugyldig adresse - - - Default Now Cart: - + Ugyldig adresse Select - Vel - - - Default Next Cart: - - - - Path - - - - Argument - - - - Loadable Modules: - - - - Add - - - - Edit - - - - Delete - + Vel Aux Log 2 - Hjelpelogg 2 + Hjelpelogg 2 EditNowNextPlugin - - Edit Plugin - - - - Plugin Path: - - Select - Vel - - - Argument: - + Vel &OK - &OK + &OK &Cancel - &Avbryt - - - Select plugin - + &Avbryt @@ -2419,7 +2371,7 @@ GPIOs Configure Now && Next Parameters - Set opp no && Neste + Set opp no && Neste parametrar diff --git a/rdadmin/rdadmin_pt_BR.ts b/rdadmin/rdadmin_pt_BR.ts index 2e92e3a8..3f22aca7 100644 --- a/rdadmin/rdadmin_pt_BR.ts +++ b/rdadmin/rdadmin_pt_BR.ts @@ -2076,122 +2076,122 @@ GPIOs EditNowNext Edit Now & Next Data - Editar Agora & Próximo + Editar Agora & Próximo Master Log - Lista Principal + Lista Principal IP Address: - Endereço de IP: + Endereço de IP: UDP Port: - Porta UDP: + Porta UDP: UDP String: - String UDP: + String UDP: RML: - RML: + RML: Default Now Cart: - Cartão 'Agora': + Cartão 'Agora': Select - Sel + Sel Default Next Cart: - Cartão 'Próximo': + Cartão 'Próximo': Aux Log 1 - Lista Auxiliar 1 + Lista Auxiliar 1 Path - Caminho + Caminho Argument - Argumento + Argumento Loadable Modules: - Módulos Carregáveis: + Módulos Carregáveis: Add - Adicionar + Adicionar Edit - Editar + Editar Delete - Deletar + Deletar &OK - &OK + &OK &Cancel - &Cancelar + &Cancelar The IP address - Endereço de IP + Endereço de IP is invalid! - é inválido! + é inválido! Invalid Address - Endereço Inválido + Endereço Inválido Aux Log 2 - Lista Auxiliar 2 + Lista Auxiliar 2 EditNowNextPlugin Edit Plugin - Editar Plugin + Editar Plugin Plugin Path: - Pasta do Plugin: + Pasta do Plugin: Select - Sel + Sel Argument: - Argumento: + Argumento: &OK - &OK + &OK &Cancel - &Cancelar + &Cancelar Select plugin - Selecionar Plugin + Selecionar Plugin @@ -2418,7 +2418,7 @@ GPIOs Configure Now && Next Parameters - Configurar Parâmetros do + Configurar Parâmetros do Agora && Próximo diff --git a/rdairplay/rdairplay.cpp b/rdairplay/rdairplay.cpp index d8cd34eb..fa3920d9 100644 --- a/rdairplay/rdairplay.cpp +++ b/rdairplay/rdairplay.cpp @@ -305,16 +305,6 @@ MainWidget::MainWidget(QWidget *parent) // rdevent_player=new RDEventPlayer(rda->ripc(),this); - // - // User - // - // rduser=NULL; - - // - // UDP Transmission Socket - // - air_nownext_socket=new Q3SocketDevice(Q3SocketDevice::Datagram); - // // Log Machines // @@ -324,8 +314,7 @@ MainWidget::MainWidget(QWidget *parent) connect(rename_mapper,SIGNAL(mapped(int)),this,SLOT(logRenamedData(int))); QString default_svcname=rda->airplayConf()->defaultSvc(); for(int i=0;isetDefaultServiceName(default_svcname); air_log[i]->setNowCart(rda->airplayConf()->logNowCart(i)); air_log[i]->setNextCart(rda->airplayConf()->logNextCart(i)); @@ -786,33 +775,6 @@ MainWidget::MainWidget(QWidget *parent) } } - // - // Load Plugins - // - QString sql; - RDSqlQuery *q; - - // - // Load Plugins - // - sql=QString("select ")+ - "PLUGIN_PATH,"+ // 00 - "PLUGIN_ARG "+ // 01 - "from NOWNEXT_PLUGINS where "+ - "(STATION_NAME=\""+RDEscapeString(rda->config()->stationName())+"\")&&"+ - "(LOG_MACHINE=0)"; - q=new RDSqlQuery(sql); - while(q->next()) { - air_plugin_hosts. - push_back(new RDRLMHost(q->value(0).toString(),q->value(1).toString(), - air_nownext_socket,this)); - LogLine(RDConfig::LogInfo,"Loading RLM \""+q->value(0).toString()+"\""); - if(!air_plugin_hosts.back()->load()) { - LogLine(RDConfig::LogWarning,"Failed to load RLM \""+q->value(0).toString()+"\""); - } - } - delete q; - // // Create the HotKeyList object // @@ -2099,9 +2061,6 @@ void MainWidget::closeEvent(QCloseEvent *e) e->setAccepted(false); return; } - for(unsigned i=0;iunload(); - } for(int i=0;i #include #include -#include #include #include #include @@ -48,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -200,8 +198,6 @@ class MainWidget : public QWidget RDLabel *air_refresh_label; QPixmap *air_refresh_pixmap; QString air_editor_cmd; - Q3SocketDevice *air_nownext_socket; - std::vector air_plugin_hosts; QSplashScreen *air_splash_screen; int keystrokecount; bool AltKeyHit ; @@ -220,7 +216,6 @@ class MainWidget : public QWidget RDAirPlayConf::GpioType air_channel_gpio_types[RDAirPlayConf::LastChannel]; std::map air_channel_timers[2]; RDEmptyCart *air_empty_cart; - RDCae *air_cae; }; diff --git a/rdvairplayd/rdvairplayd.cpp b/rdvairplayd/rdvairplayd.cpp index 47d5f9fa..c178ff0f 100644 --- a/rdvairplayd/rdvairplayd.cpp +++ b/rdvairplayd/rdvairplayd.cpp @@ -109,11 +109,6 @@ MainObject::MainObject(QObject *parent) // air_event_player=new RDEventPlayer(rda->ripc(),this); - // - // UDP Transmission Socket - // - air_nownext_socket=new Q3SocketDevice(Q3SocketDevice::Datagram); - // // Log Machines // @@ -122,12 +117,8 @@ MainObject::MainObject(QObject *parent) QSignalMapper *rename_mapper=new QSignalMapper(this); QString default_svcname=rda->airplayConf()->defaultSvc(); for(int i=0;isetDefaultServiceName(default_svcname); - // - // FIXME: Add the ability to specify default carts for vLogs! - // air_logs[i]->setNowCart(rda->airplayConf()->logNowCart(i)); air_logs[i]->setNextCart(rda->airplayConf()->logNextCart(i)); reload_mapper->setMapping(air_logs[i],i); @@ -161,34 +152,6 @@ MainObject::MainObject(QObject *parent) // connect(air_logs[0],SIGNAL(transportChanged()), // this,SLOT(transportChangedData())); - // - // Load Plugins - // - QString sql; - RDSqlQuery *q; - - sql=QString("select ")+ - "PLUGIN_PATH,"+ - "PLUGIN_ARG "+ - "from NOWNEXT_PLUGINS where "+ - "(STATION_NAME=\""+RDEscapeString(rda->config()->stationName())+"\")&&"+ - "(LOG_MACHINE=0)"; - q=new RDSqlQuery(sql); - while(q->next()) { - air_plugin_hosts. - push_back(new RDRLMHost(q->value(0).toString(),q->value(1).toString(), - air_nownext_socket,this)); - rda->log(RDConfig::LogInfo,QString(). - sprintf("Loading RLM \"%s\"", - (const char *)q->value(0).toString())); - if(!air_plugin_hosts.back()->load()) { - rda->log(RDConfig::LogWarning,QString(). - sprintf("Failed to load RLM \"%s\"", - (const char *)q->value(0).toString())); - } - } - delete q; - // // Exit Timer // @@ -333,9 +296,6 @@ void MainObject::logReloadedData(int log) void MainObject::exitData() { if(global_exiting) { - for(unsigned i=0;iunload(); - } for(int i=0;i -#include #include #include #include #include -#include #define RDVAIRPLAYD_USAGE "[options]\n" @@ -54,9 +52,7 @@ class MainObject : public QObject 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 air_plugin_hosts; RDEventPlayer *air_event_player; - Q3SocketDevice *air_nownext_socket; QDateTime air_startup_datetime; RDAirPlayConf::ExitCode air_previous_exit_code; QTimer *air_exit_timer; diff --git a/utils/rddbmgr/revertschema.cpp b/utils/rddbmgr/revertschema.cpp index d259375a..fa666ead 100644 --- a/utils/rddbmgr/revertschema.cpp +++ b/utils/rddbmgr/revertschema.cpp @@ -40,6 +40,49 @@ bool MainObject::RevertSchema(int cur_schema,int set_schema,QString *err_msg) // NEW SCHEMA REVERSIONS GO HERE... + // + // Revert 305 + // + if((cur_schema==305)&&(set_schemacur_schema)) { + DropTable("NOWNEXT_PLUGINS"); + DropColumn("LOG_MACHINES","UDP_ADDR"); + DropColumn("LOG_MACHINES","UDP_PORT"); + DropColumn("LOG_MACHINES","UDP_STRING"); + DropColumn("LOG_MACHINES","LOG_RML"); + + WriteSchemaVersion(++cur_schema); + } + // NEW SCHEMA UPDATES GO HERE...