diff --git a/.gitignore b/.gitignore index 67cc8b37..eb92770a 100644 --- a/.gitignore +++ b/.gitignore @@ -113,6 +113,7 @@ tests/download_test tests/getpids_test tests/log_unlink_test tests/mcast_recv_test +tests/metadata_wildcard_test tests/notification_test tests/rdxml_parse_test tests/readcd_test diff --git a/ChangeLog b/ChangeLog index fe12c613..536935f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19245,6 +19245,7 @@ * Added an rdsoftkeys(1) man page. 2019-10-31 Fred Gleason * Incremented the package version to 3.2.0. +<<<<<<< HEAD 2019-11-20 Fred Gleason * Added interlocks to the 'Edit Switcher' and 'Edit Serial Ports' dialogs in rdadmin(1) to prohibit use of a disabled serial device. @@ -19533,6 +19534,7 @@ * Cleaned up a compiler warning in 'lib/rdcae.cpp'. 2020-02-07 Fred Gleason * Incremented the package version to 3.2.1int1. +<<<<<<< HEAD 2020-02-07 Fred Gleason * Removed Q3Support dependencies from the 'Editing Feed' dialog in rdadmin(1). @@ -19560,6 +19562,132 @@ 2020-02-11 Fred Gleason * Added a check to the 'Add RSS Feed' dialog in rdadmin(1) to prevent creation of feeds with a blank name. +2020-02-14 Fred Gleason + * Fixed a regression in the BroadcastTools SS16.4 switcher driver + that could cause deadlocks and intermittent operation. +2020-02-14 Fred Gleason + * Fixed a regression in the BroadcastTools SS4.4 switcher driver + that could cause deadlocks and intermittent operation. +2020-02-14 Fred Gleason + * Cleaned up the device access mode in the BroadcastTools 10x1 + switcher driver. +2020-02-14 Fred Gleason + * Cleaned up the device access mode in the BroadcastTools 16x1 + switcher driver. +2020-02-14 Fred Gleason + * Cleaned up the device access mode in the BroadcastTools 8x2 + switcher driver. +2020-02-14 Fred Gleason + * Fixed a regression in the BroadcastTools ACS8.2 switcher driver + that could cause deadlocks and intermittent operation. +2020-02-14 Fred Gleason + * Fixed a regression in the BroadcastTools ADMS 44.22 switcher driver + that could cause deadlocks and intermittent operation. +2020-02-14 Fred Gleason + * Fixed a regression in the BroadcastTools GPI-16 switcher driver + that could cause deadlocks and intermittent operation. +2020-02-14 Fred Gleason + * Fixed a regression in the BroadcastTools SRC-16 switcher driver + that could cause deadlocks and intermittent operation. +2020-02-14 Fred Gleason + * Fixed a regression in the BroadcastTools SRC-8 III switcher driver + that could cause deadlocks and intermittent operation. +2020-02-14 Fred Gleason + * Cleaned up the device access mode in the BroadcastTools SS12.4 + switcher driver. +2020-02-14 Fred Gleason + * Cleaned up the device access mode in the BroadcastTools SS2.1 + switcher driver. +2020-02-14 Fred Gleason + * Fixed a regression in the BroadcastTools SS 4.1 MLR switcher driver + that could cause deadlocks and intermittent operation. +2020-02-14 Fred Gleason + * Fixed a regression in the BroadcastTools SS 4.2 switcher driver + that could cause deadlocks and intermittent operation. +2020-02-14 Fred Gleason + * Removed superflous poll interface define from the Broadcast Tools + SS 4.4 switcher driver. +2020-02-14 Fred Gleason + * Fixed a regression in the BroadcastTools SS 8.2 switcher driver + that could cause deadlocks and intermittent operation. +2020-02-14 Fred Gleason + * Cleaned up the device access mode in the Quartz 1 switcher driver. +2020-02-14 Fred Gleason + * Cleaned up the device access mode in the Ross NK SCP/A switcher + driver. +2020-02-16 Fred Gleason + * Cleaned up the device access mode in the SAS 16000 switcher + driver. +2020-02-16 Fred Gleason + * Removed a bogus Q3Socket dependency from the SAS 16000 switcher + driver. +2020-02-16 Fred Gleason + * Cleaned up the device access mode in the SAS 32000 switcher + driver. +2020-02-16 Fred Gleason + * Cleaned up the device access mode in the SAS 64000 switcher + driver. +2020-02-16 Fred Gleason + * Cleaned up the device access mode in the SAS 64000gpi switcher + driver. +2020-02-16 Fred Gleason + * Cleaned up the device access mode in the SAS USI switcher + driver. +2020-02-16 Fred Gleason + * Removed Q3Socket dependency from the SAS USI switcher driver. +2020-02-16 Fred Gleason + * Cleaned up the device access mode in the SAS USI switcher + driver. +2020-02-17 Fred Gleason + * Cleaned up the device access mode in the Starguide 3 switcher + driver. +2020-02-17 Fred Gleason + * Cleaned up the device access mode in the Unity 4000 switcher + driver. +2020-02-17 Fred Gleason + * Cleaned up the tty device access mode in the vGuest switcher + driver. +2020-02-17 Fred Gleason + * Removed Q3Socket dependency from the WheatNet SLIO switcher + driver. + * Removed Q3Socket dependency from the WheatNet LIO switcher + driver. +2020-02-17 Fred Gleason + * Removed Q3Socket dependency from the Software Authority switcher + driver. +2020-02-17 Fred Gleason + * Removed Q3Socket dependency from the Modbus switcher + driver. +2020-02-17 Fred Gleason + * Removed Q3Socket dependency from the Quartz 1 switcher driver. +2020-02-17 Fred Gleason + * Removed Q3Socket dependency from the Harlond switcher driver. +2020-02-17 Fred Gleason + * Removed Q3Socket dependency from the Broadcast Tools Sentinel4Web + switcher driver. +2020-02-17 Fred Gleason + * Removed Q3Socket dependency from the Broadcast Tools MLR>>Web + switcher driver. +2020-02-17 Fred Gleason + * Removed Q3Socket dependency from the vGuest switcher driver. +2020-02-18 Fred Gleason + * Fixed a regression in the implmenetation of the 'Set Serial Trap' + ['SI'] RML that could cause deadlocks and intermittent operation. +2020-02-18 Fred Gleason + * Incremented the package version to 3.2.1int2. +2020-02-18 Fred Gleason + * Fixed a bug in rdairplay(1) that could cause random segfaults + when updating the Label Widget. +2020-02-18 Fred Gleason + * Removed the 'RDLabel' widget. +2020-02-19 Fred Gleason + * Added a 'Disconnect All Jack Ports' ['JZ'] RML. +2020-02-19 Fred Gleason + * Fixed a bug with the '%y' metadata wildcard where garbage would + be returned if a valid year had not been set. + * Added a 'metadata_wildcard_test' harness. +2020-02-19 Fred Gleason + * Incremented the package version to 3.2.1int3. 2020-02-20 Fred Gleason * Added a 'FEEDS.AUDIENCE_METRICS' field to the database. * Incremented the database version to 316. @@ -19589,5 +19717,78 @@ 2020-02-21 Fred Gleason * Tweaked controls to be disabled for superfeeds in the 'Edit Feed' dialog in rdadmin(1). +2020-02-21 Fred Gleason + * Fixed a regression in rdlogmanager(1) that caused trailer + whitespace to be generated in the 'EXT_DATA', 'EXT_EVENT', + 'EXT_ANNC_TYPE' and 'EXT_CART_NAME' log fields when importing + from a CounterPoint format log. +2020-02-21 Fred Gleason + * Added a syslog message for each CIC update in the 'pypad_xds.py' + script. 2020-02-23 Fred Gleason * Implemented superfeed in 'rdfeed.xml'. +2020-02-23 Fred Gleason + * Added '-lexpat' to the '--libs' output for the 'rivwebcapi' + pkg-config profile. +2020-02-24 Fred Gleason + * Refactored the 'AR_GET_DISTRO()' autoconf macro to use + '/etc/os-release'. +2020-02-25 Fred Gleason + * Fixed a bug in the 'CounterPoint Traffic Reconciliation' report + generator in rdlogmanager(1) that caused it to omit the leading '0' + from values in the 'Scheduled event length' column. +2020-02-25 Fred Gleason + * Reverted the leading '0' fix to the 'CounterPoint Traffic + Reconciliation' report generator. + * Added a 'CounterPoint Traffic Reconciliation v2' report. +2020-02-25 Fred Gleason + * Removed the 'Q3ButtonGroup' dependency from the 'Import Audio' + dialog. +2020-02-25 Fred Gleason + * Removed the 'Q3FileDialog' dependency from the 'Import Audio' + dialog. +2020-02-25 Fred Gleason + * Added captioning to the 'Import Audio' dialog. +2020-02-25 Fred Gleason + * Removed the 'Q3Frame' dependency from 'RDBusyBar'. + * Add stylesheet support for color rendering in RDBusyBar. +2020-02-25 Fred Gleason + * Removed the 'Q3FileDialog' dependency from the 'Select Cart' + dialog. +2020-02-25 Fred Gleason + * Added captioning to the 'Select Cart' dialog. +2020-02-25 Fred Gleason + * Removed the 'Q3ProgressDialog' dependency from the 'Select Cart' + dialog. +2020-02-25 Fred Gleason + * Removed the 'Q3FileDialog' dependency from rdadmin(1). +2020-02-25 Fred Gleason + * Removed the 'Q3FileDialog' dependency from rddbconfig(8). +2020-02-25 Fred Gleason + * Removed the 'Q3FileDialog' dependency from rddiscimport(1). +2020-02-25 Fred Gleason + * Removed the 'Q3ProgressDialog' dependency from the 'Select Cut' + dialog. +2020-02-25 Fred Gleason + * Removed the 'Q3ProgressDialog' dependency from rdadmin(1). +2020-02-25 Fred Gleason + * Fixed the layout of the 'Matching Carts' field in rdlibrary(1)'s + main window when Realtime Filtering is disabled. +2020-02-26 Fred Gleason + * Removed the 'Q3ProgressBar' dependency from rdairplay(1). +2020-02-26 Fred Gleason + * Removed the 'Q3ProgressBar' dependency from rdcartslots(1). +2020-02-26 Fred Gleason + * Added sanity check code to 'RDRender'. +2020-02-26 Fred Gleason + * Removed the 'Q3ProgressBar' dependency from rdlogedit(1). +2020-02-26 Fred Gleason + * Removed the 'Q3ProgressBar' dependency from rddiscimport(1). +2020-02-26 Fred Gleason + * Fixed a bug in rdairplay(1) that would cause a hard-timed log + event with a 'wait' parameter set to attempt to play the event + twice. +2020-03-09 Fred Gleason + * Fixed a bug in rddbmgr(8) that threw a SQL error when attempting + to modify a DB containing tables set to use character set UTF-8 + to schema 297. diff --git a/NEWS b/NEWS index 70d4b15f..6a654f0f 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,7 @@ The NEWS file for the Rivendell package. ------------------------------------------------------------------------------- -v3.2.1int1 -- 7 February 2020 +v3.2.1int3 -- 19 February 2020 Changes: MusicBrainz Integration. The CD rippers in rdlibrary(1) can now be @@ -21,6 +21,8 @@ Changes: filepath wildcards to allow specification of a +/- time offset. See Appendix D 'Filepath Wildcards' in the Operations Guide for details. + New RML. Added a 'Disconnect All Jack Ports' ['JZ'] RML. + Database Update: This version of Rivendell uses database schema version 314, and will automatically upgrade any earlier versions. To see the current schema diff --git a/PACKAGE_VERSION b/PACKAGE_VERSION index 8c559de5..cf1c15d2 100644 --- a/PACKAGE_VERSION +++ b/PACKAGE_VERSION @@ -1 +1 @@ -3.2.1int1 \ No newline at end of file +3.2.1int3 \ No newline at end of file diff --git a/apis/pypad/api/pypad.py b/apis/pypad/api/pypad.py index fd38e976..b75e4df9 100644 --- a/apis/pypad/api/pypad.py +++ b/apis/pypad/api/pypad.py @@ -122,7 +122,10 @@ class Update(object): if isinstance(self.__fields['padUpdate'][stype][sfield],str): string=string.replace('%'+wildcard,self.escape(self.__fields['padUpdate'][stype][sfield],esc)) else: - string=string.replace('%'+wildcard,str(self.__fields['padUpdate'][stype][sfield])) + if self.__fields['padUpdate'][stype][sfield] is None: + string=string.replace('%'+wildcard,'') + else : + string=string.replace('%'+wildcard,str(self.__fields['padUpdate'][stype][sfield])) except TypeError: string=string.replace('%'+wildcard,'') except KeyError: diff --git a/apis/pypad/scripts/pypad_xds.py b/apis/pypad/scripts/pypad_xds.py index 8e97fe45..0f700f67 100755 --- a/apis/pypad/scripts/pypad_xds.py +++ b/apis/pypad/scripts/pypad_xds.py @@ -25,6 +25,7 @@ import socket import configparser import serial import time +import syslog import pypad # @@ -77,6 +78,7 @@ def ProcessPad(update): if update.shouldBeProcessed(section) and update.hasPadType(pypad.TYPE_NOW) and update.hasService() and (last_updates[update.machine()] != update.startDateTimeString(pypad.TYPE_NOW)): last_updates[update.machine()]=update.startDateTimeString(pypad.TYPE_NOW) packet='0:'+update.serviceProgramCode()+':'+update.config().get(section,'IsciPrefix')+FilterField(update.padField(pypad.TYPE_NOW,pypad.FIELD_EXTERNAL_EVENT_ID))+':*' + update.syslog(syslog.LOG_INFO,'sending CIC update "'+packet+'"') reps=range(1) if(update.config().has_option(section,'Repetitions')): reps=range(update.config().getint(section,'Repetitions')) diff --git a/apis/rivwebcapi/rivwebcapi.pc.in b/apis/rivwebcapi/rivwebcapi.pc.in index c19a0bc2..43393ed9 100644 --- a/apis/rivwebcapi/rivwebcapi.pc.in +++ b/apis/rivwebcapi/rivwebcapi.pc.in @@ -6,5 +6,5 @@ includedir=${prefix}/include/rivwebcapi Name: rivwebcapi Description: C API for the Rivendell Radio Automation System Web Service Version: @VERSION@ -Libs: -L${libdir} -lrivwebcapi -lcurl -lm +Libs: -L${libdir} -lrivwebcapi -lcurl -lexpat -lm Cflags: -I${includedir} -I/usr/include diff --git a/docs/opsguide/rml.xml b/docs/opsguide/rml.xml index 19830c22..80314ace 100644 --- a/docs/opsguide/rml.xml +++ b/docs/opsguide/rml.xml @@ -514,6 +514,31 @@ + + Disconnect All Jack Ports [JZ] + + + + Module + ripcd8 + + + Mnemonic + JZ + + + + + Disconnect all JACK input port connections. + + + JZ! + + + Attempt to disconnect all JACK port connections. + + + Duck Panel Button [PD] diff --git a/get_distro.pl b/get_distro.pl index 7c03a220..00830f4d 100755 --- a/get_distro.pl +++ b/get_distro.pl @@ -25,83 +25,64 @@ #USAGE: get_distro.pl NAME|VERSION|MAJOR|MINOR|POINT if($ARGV[0] eq "NAME") { - if(!system("test","-f","/etc/SuSE-release")) { - print "SuSE"; - exit 0; - } - if(!system("test","-f","/etc/debian_version")) { - print "Debian"; - exit 0; - } - if(!system("test","-f","/etc/redhat-release")) { - print "RedHat"; - exit 0; - } + print &Extract("NAME"); + exit 0; } if($ARGV[0] eq "VERSION") { - if(!system("test","-f","/etc/SuSE-release")) { - print &GetVersion("/etc/SuSE-release"); - exit 0; - } - if(!system("test","-f","/etc/debian_version")) { - print &GetVersion("/etc/debian_version"); - exit 0; - } - if(!system("test","-f","/etc/redhat-release")) { - print &GetVersion("/etc/redhat-release"); - exit 0; - } + print &Extract("VERSION_ID"); + exit 0; } if($ARGV[0] eq "MAJOR") { - if(!system("test","-f","/etc/SuSE-release")) { - print &GetMajor("/etc/SuSE-release"); - exit 0; - } - if(!system("test","-f","/etc/debian_version")) { - print &GetMajor("/etc/debian_version"); - exit 0; - } - if(!system("test","-f","/etc/redhat-release")) { - print &GetMajor("/etc/redhat-release"); - exit 0; - } + my $ver=&Extract("VERSION_ID"); + my @f0=split '\.',$ver; + print $f0[0]; + exit 0; } if($ARGV[0] eq "MINOR") { - if(!system("test","-f","/etc/SuSE-release")) { - print &GetMinor("/etc/SuSE-release"); - exit 0; - } - if(!system("test","-f","/etc/debian_version")) { - print &GetMinor("/etc/debian_version"); - exit 0; - } - if(!system("test","-f","/etc/redhat-release")) { - print &GetMinor("/etc/redhat-release"); + my $ver=&Extract("VERSION_ID"); + my @f0=split '\.',$ver; + if(scalar(@f0)>=2) { + print $f0[1]; exit 0; } + print "0"; + exit 0; } if($ARGV[0] eq "POINT") { - if(!system("test","-f","/etc/SuSE-release")) { - print &GetPoint("/etc/SuSE-release"); - exit 0; - } - if(!system("test","-f","/etc/debian_version")) { - print &GetPoint("/etc/debian_version"); - exit 0; - } - if(!system("test","-f","/etc/redhat-release")) { - print &GetPoint("/etc/redhat-release"); + my $ver=&Extract("VERSION_ID"); + my @f0=split '\.',$ver; + if(scalar(@f0)>=3) { + print $f0[2]; exit 0; } + print "0"; + exit 0; } exit 256; +sub Extract +{ + if(open RELEASE,"<","/etc/os-release") { + while() { + my @f0=split "\n",$_; + for(my $i=0;$i<@f0;$i++) { + my @f1=split "=",$f0[$i]; + if($f1[0] eq $_[0]) { + return substr($f1[1],1,length($f1[1])-2); + } + } + } + } + return ""; +} + + sub GetVersion { if(open VERSION,"<",$_[0]) { diff --git a/lib/Makefile.am b/lib/Makefile.am index 6dc77f93..e8ef0ec6 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -147,7 +147,6 @@ dist_librd_la_SOURCES = dbversion.h\ rdinstancelock.cpp rdinstancelock.h\ rd.h\ rdkernelgpio.cpp rdkernelgpio.h\ - rdlabel.cpp rdlabel.h\ rdlibrary_conf.cpp rdlibrary_conf.h\ rdlineedit.cpp rdlineedit.h\ rdlistselector.cpp rdlistselector.h\ @@ -294,7 +293,6 @@ nodist_librd_la_SOURCES = moc_rdadd_cart.cpp\ moc_rdhotkeylist.cpp\ moc_rdimport_audio.cpp\ moc_rdkernelgpio.cpp\ - moc_rdlabel.cpp\ moc_rdlineedit.cpp\ moc_rdlist_groups.cpp\ moc_rdlist_logs.cpp\ diff --git a/lib/export_radiotraffic.cpp b/lib/export_radiotraffic.cpp index 945840b8..78e12de6 100644 --- a/lib/export_radiotraffic.cpp +++ b/lib/export_radiotraffic.cpp @@ -2,7 +2,7 @@ // // Export a Rivendell Report to RadioTraffic.com // -// (C) Copyright 2002-2005,2009,2016-2018 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -30,8 +30,20 @@ bool RDReport::ExportRadioTraffic(const QString &filename, const QDate &startdate,const QDate &enddate, - const QString &mixtable) + const QString &mixtable,int version) { + // + // Maintainer's Note: + // This method implements the 'CounterPoint' reconciliation format as + // documented in 'docs/misc/scheduler_formats.ods'. + // + // The 'version' field is for maintaining bug-for-bug backwards + // compatibility. Recognized values are: + // 0 - The original implementation. This is missing a leading '0' + // column 3 ['Scheduled event length']. + // + // 1 - Fixes the 'missing leading zero' error in column 3. + // QString sql; RDSqlQuery *q; QString air_fmt; @@ -75,6 +87,9 @@ bool RDReport::ExportRadioTraffic(const QString &filename, *strm << q->value(4).toTime().toString("hh:mm:ss")+" "; *strm << q->value(2).toDateTime().toString("hh:mm:ss")+" "; if(q->value(5).toInt()>0) { + if(version>0) { + *strm << QString("0"); + } *strm << RDGetTimeLength(q->value(5).toInt(),true,false)+" "; } else { diff --git a/lib/lib.pro b/lib/lib.pro index 6f2441c5..2e111a23 100644 --- a/lib/lib.pro +++ b/lib/lib.pro @@ -104,7 +104,6 @@ SOURCES += rdhash.cpp SOURCES += rdidvalidator.cpp SOURCES += rdimport_audio.cpp SOURCES += rdkernelgpio.cpp -SOURCES += rdlabel.cpp SOURCES += rdlibrary_conf.cpp SOURCES += rdlineedit.cpp SOURCES += rdlist_logs.cpp @@ -242,7 +241,6 @@ HEADERS += rdhash.h HEADERS += rdidvalidator.h HEADERS += rdimport_audio.h HEADERS += rdkernelgpio.h -HEADERS += rdlabel.h HEADERS += rdlibrary_conf.h HEADERS += rdlineedit.h HEADERS += rdlist_groups.h diff --git a/lib/librd_cs.ts b/lib/librd_cs.ts index 3ecfeaea..6f794ced 100644 --- a/lib/librd_cs.ts +++ b/lib/librd_cs.ts @@ -765,6 +765,10 @@ -- End of List -- + + CounterPoint Traffic Reconciliation v2 + + RDAddCart @@ -1225,6 +1229,14 @@ ze &souboru End Konec + + Open Audio File + + + + Cancel + Zrušit + RDCddbLookup @@ -2167,6 +2179,14 @@ Bitte Kofiguration prüfen und erneut versuchen. Abort Zrušit + + Select Audio File + + + + Save Audio File + + RDIntegerDialog diff --git a/lib/librd_de.ts b/lib/librd_de.ts index 21328ccf..bbcd37e8 100644 --- a/lib/librd_de.ts +++ b/lib/librd_de.ts @@ -761,6 +761,10 @@ -- End of List -- + + CounterPoint Traffic Reconciliation v2 + + RDAddCart @@ -1216,6 +1220,14 @@ senden End Ende + + Open Audio File + + + + Cancel + Abbrechen + RDCddbLookup @@ -2158,6 +2170,14 @@ Bitte Kofiguration prüfen und erneut versuchen. Abort Abbrechen + + Select Audio File + + + + Save Audio File + + RDIntegerDialog diff --git a/lib/librd_es.ts b/lib/librd_es.ts index fbe85532..a473b7f3 100644 --- a/lib/librd_es.ts +++ b/lib/librd_es.ts @@ -761,6 +761,10 @@ -- End of List -- + + CounterPoint Traffic Reconciliation v2 + + RDAddCart @@ -1216,6 +1220,14 @@ Color End Final + + Open Audio File + + + + Cancel + Cancelar + RDCddbLookup @@ -2156,6 +2168,14 @@ Do you still want to proceed? Abort Abortar + + Select Audio File + + + + Save Audio File + + RDIntegerDialog diff --git a/lib/librd_fr.ts b/lib/librd_fr.ts index 31fa3ad4..0cac54d5 100644 --- a/lib/librd_fr.ts +++ b/lib/librd_fr.ts @@ -731,6 +731,10 @@ -- End of List -- + + CounterPoint Traffic Reconciliation v2 + + RDAddCart @@ -1066,6 +1070,14 @@ La Couleur End Fin + + Open Audio File + + + + Cancel + + RDCddbLookup @@ -1824,6 +1836,14 @@ Do you want to overwrite it? Export Error + + Select Audio File + + + + Save Audio File + + RDIntegerDialog diff --git a/lib/librd_nb.ts b/lib/librd_nb.ts index aca8e654..76db7db1 100644 --- a/lib/librd_nb.ts +++ b/lib/librd_nb.ts @@ -761,6 +761,10 @@ -- End of List -- + + CounterPoint Traffic Reconciliation v2 + + RDAddCart @@ -1215,6 +1219,14 @@ farge End Slutten + + Open Audio File + + + + Cancel + + RDCddbLookup @@ -2156,6 +2168,14 @@ Sjekk eksportoppsettet ditt og prøv att. Abort + + Select Audio File + + + + Save Audio File + + RDIntegerDialog diff --git a/lib/librd_nn.ts b/lib/librd_nn.ts index aca8e654..76db7db1 100644 --- a/lib/librd_nn.ts +++ b/lib/librd_nn.ts @@ -761,6 +761,10 @@ -- End of List -- + + CounterPoint Traffic Reconciliation v2 + + RDAddCart @@ -1215,6 +1219,14 @@ farge End Slutten + + Open Audio File + + + + Cancel + + RDCddbLookup @@ -2156,6 +2168,14 @@ Sjekk eksportoppsettet ditt og prøv att. Abort + + Select Audio File + + + + Save Audio File + + RDIntegerDialog diff --git a/lib/librd_pt_BR.ts b/lib/librd_pt_BR.ts index 6a621b69..f2a616f8 100644 --- a/lib/librd_pt_BR.ts +++ b/lib/librd_pt_BR.ts @@ -761,6 +761,10 @@ -- End of List -- + + CounterPoint Traffic Reconciliation v2 + + RDAddCart @@ -1216,6 +1220,14 @@ Cor End Fim + + Open Audio File + + + + Cancel + Cancelar + RDCddbLookup @@ -2162,6 +2174,14 @@ Por Favor, cheque suas configurações e tenbte outra vez. Export Error + + Select Audio File + + + + Save Audio File + + RDIntegerDialog diff --git a/lib/rdbusybar.cpp b/lib/rdbusybar.cpp index f4a4bc51..b1e1d7f6 100644 --- a/lib/rdbusybar.cpp +++ b/lib/rdbusybar.cpp @@ -2,7 +2,7 @@ // // A 'progress bar' widget that shows busy state. // -// (C) Copyright 2010,2016 Fred Gleason +// (C) Copyright 2010-2020 Fred Gleason // // it under the terms of the GNU Library General Public License // version 2 as published by the Free Software Foundation. @@ -18,16 +18,13 @@ // // -#include -//Added by qt3to4: -#include -#include +#include "rdbusybar.h" RDBusyBar::RDBusyBar(QWidget *parent,Qt::WFlags f) - : Q3Frame(parent,"",f) + : QFrame(parent,f) { bar_pos=0; - setFrameStyle(Q3Frame::StyledPanel|Q3Frame::Sunken); + setFrameStyle(QFrame::StyledPanel|QFrame::Sunken); QPalette p=palette(); p.setColor(QPalette::Active,QColorGroup::Background, p.color(QPalette::Active,QColorGroup::Base)); @@ -37,6 +34,8 @@ RDBusyBar::RDBusyBar(QWidget *parent,Qt::WFlags f) p.setColor(QPalette::Active,QColorGroup::Background, p.color(QPalette::Active,QColorGroup::Highlight)); bar_label->setPalette(p); + bar_label->setStyleSheet("background-color:"+ + p.color(QPalette::Active,QColorGroup::Highlight).name()); bar_label->hide(); bar_timer=new QTimer(this); @@ -48,7 +47,7 @@ void RDBusyBar::activate(bool state) if(state) { Update(); bar_label->show(); - bar_timer->start(500); + bar_timer->start(200); } else { bar_label->hide(); diff --git a/lib/rdbusybar.h b/lib/rdbusybar.h index b6a1a483..285bc1b3 100644 --- a/lib/rdbusybar.h +++ b/lib/rdbusybar.h @@ -22,12 +22,12 @@ #ifndef RDBUSYBAR_H #define RDBUSYBAR_H -#include -#include +#include #include #include +#include -class RDBusyBar : public Q3Frame +class RDBusyBar : public QFrame { Q_OBJECT diff --git a/lib/rdcart_dialog.cpp b/lib/rdcart_dialog.cpp index bfa9774d..b5892b7a 100644 --- a/lib/rdcart_dialog.cpp +++ b/lib/rdcart_dialog.cpp @@ -2,7 +2,7 @@ // // A widget to select a Rivendell Cart. // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -21,9 +21,8 @@ #include #include -#include - #include +#include #include #include "rdapplication.h" @@ -46,9 +45,11 @@ #include "../icons/rml5.xpm" RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode, - QWidget *parent) + const QString &caption,QWidget *parent) : RDDialog(parent) { + cart_caption=caption; + // // Fix the Window Size // @@ -76,7 +77,7 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode, cart_import_path=RDGetHomeDir(); cart_import_file_filter=RD_AUDIO_FILE_FILTER; - setWindowTitle(tr("Select Cart")); + setWindowTitle(caption+" - "+tr("Select Cart")); // // Create Icons @@ -93,8 +94,7 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode, // Progress Dialog // cart_progress_dialog= - new Q3ProgressDialog(tr("Please Wait..."),"Cancel",10,this, - "cart_progress_dialog",false, + new QProgressDialog(tr("Please Wait..."),tr("Cancel"),0,10,this, Qt::WStyle_Customize|Qt::WStyle_NormalBorder); cart_progress_dialog->setCaption(" "); QLabel *label=new QLabel(tr("Please Wait..."),cart_progress_dialog); @@ -515,8 +515,10 @@ void RDCartDialog::loadFileData() RDWaveData wavedata; QString err_msg; - filename=Q3FileDialog::getOpenFileName(cart_import_path, - cart_import_file_filter,this); + filename=QFileDialog::getOpenFileName(this,cart_caption+" - "+ + tr("Open Audio File"), + cart_import_path, + cart_import_file_filter); if(!filename.isEmpty()) { cart_import_path=RDGetPathPart(filename); @@ -719,8 +721,8 @@ void RDCartDialog::RefreshCarts() q=new RDSqlQuery(sql); int step=0; int count=0; - cart_progress_dialog->setTotalSteps(q->size()/RDCART_DIALOG_STEP_SIZE); - cart_progress_dialog->setProgress(0); + cart_progress_dialog->setMaximum(q->size()/RDCART_DIALOG_STEP_SIZE); + cart_progress_dialog->setValue(0); while(q->next()) { l=new RDListViewItem(cart_cart_list); l->setId(q->value(10).toUInt()); @@ -757,7 +759,7 @@ void RDCartDialog::RefreshCarts() l->setText(12,"TFN"); } if(count++>RDCART_DIALOG_STEP_SIZE) { - cart_progress_dialog->setProgress(++step); + cart_progress_dialog->setValue(++step); count=0; QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); } diff --git a/lib/rdcart_dialog.h b/lib/rdcart_dialog.h index 92f89b5e..a3ccafee 100644 --- a/lib/rdcart_dialog.h +++ b/lib/rdcart_dialog.h @@ -2,7 +2,7 @@ // // A widget to select a Rivendell Cart. // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -21,11 +21,11 @@ #ifndef RDCART_DIALOG_H #define RDCART_DIALOG_H -#include -#include -#include -#include #include +#include +#include +#include +#include #include #include @@ -41,7 +41,7 @@ class RDCartDialog : public RDDialog Q_OBJECT public: RDCartDialog(QString *filter,QString *group,QString *schedcode, - QWidget *parent=0); + const QString &caption,QWidget *parent=0); ~RDCartDialog(); QSize sizeHint() const; QSizePolicy sizePolicy() const; @@ -104,7 +104,7 @@ class RDCartDialog : public RDDialog QString *cart_service; int cart_service_quan; RDStation::FilterMode cart_filter_mode; - Q3ProgressDialog *cart_progress_dialog; + QProgressDialog *cart_progress_dialog; QString cart_import_path; QString cart_import_file_filter; bool *cart_temp_allowed; @@ -112,7 +112,8 @@ class RDCartDialog : public RDDialog QString cart_user_password; RDBusyDialog *cart_busy_dialog; RDSimplePlayer *cart_player; + QString cart_caption; }; -#endif +#endif // RDCART_DIALOG_H diff --git a/lib/rdcodetrap.cpp b/lib/rdcodetrap.cpp index c6c2fbd3..4929475a 100644 --- a/lib/rdcodetrap.cpp +++ b/lib/rdcodetrap.cpp @@ -2,7 +2,7 @@ // // A class for trapping arbitrary character sequences. // -// (C) Copyright 2002-2004,2016 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -37,7 +37,7 @@ RDCodeTrap::~RDCodeTrap() void RDCodeTrap::addTrap(int id,const char *code,int length) { - for(unsigned i=0;i::iterator it=trap_events.begin()+i; + QList::iterator it=trap_events.begin()+i; trap_events.erase(it,it+1); i--; } @@ -69,11 +69,11 @@ void RDCodeTrap::removeTrap(int id) void RDCodeTrap::removeTrap(const char *code,int length) { - for(unsigned i=0;i::iterator it=trap_events.begin()+i; + QList::iterator it=trap_events.begin()+i; trap_events.erase(it,it+1); i--; } @@ -84,12 +84,12 @@ void RDCodeTrap::removeTrap(const char *code,int length) void RDCodeTrap::removeTrap(int id,const char *code,int length) { - for(unsigned i=0;i::iterator it=trap_events.begin()+i; + QList::iterator it=trap_events.begin()+i; trap_events.erase(it,it+1); i--; } @@ -100,7 +100,7 @@ void RDCodeTrap::removeTrap(int id,const char *code,int length) void RDCodeTrap::scan(const char *buf,int length) { - for(unsigned i=0;i +// (C) Copyright 2002-2020 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 @@ -21,14 +21,10 @@ #ifndef RDCODETRAP_H #define RDCODETRAP_H -#include - +#include #include -using namespace std; - - -struct RTrapEvent { +struct RDTrapEvent { int id; char *code; int length; @@ -53,7 +49,7 @@ class RDCodeTrap : public QObject void trapped(int id); private: - vector trap_events; + QList trap_events; }; diff --git a/lib/rdcut_dialog.cpp b/lib/rdcut_dialog.cpp index c3b1dc43..2024f730 100644 --- a/lib/rdcut_dialog.cpp +++ b/lib/rdcut_dialog.cpp @@ -2,7 +2,7 @@ // // A widget to select a Rivendell Cut. // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -83,8 +83,7 @@ RDCutDialog::RDCutDialog(QString *cutname,const QString &caption, // Progress Dialog // cut_progress_dialog= - new Q3ProgressDialog(tr("Please Wait..."),"Cancel",10,this, - "cut_progress_dialog",false, + new QProgressDialog(tr("Please Wait..."),"Cancel",0,10,this, Qt::WStyle_Customize|Qt::WStyle_NormalBorder); cut_progress_dialog->setCaption(" "); QLabel *label=new QLabel(tr("Please Wait..."),cut_progress_dialog); @@ -492,8 +491,8 @@ void RDCutDialog::RefreshCarts() q=new RDSqlQuery(sql); int step=0; int count=0; - cut_progress_dialog->setTotalSteps(q->size()/RDCUT_DIALOG_STEP_SIZE); - cut_progress_dialog->setProgress(0); + cut_progress_dialog->setMaximum(q->size()/RDCUT_DIALOG_STEP_SIZE); + cut_progress_dialog->setValue(0); while(q->next()) { l=new RDListViewItem(cut_cart_list); switch((RDCart::Type)q->value(4).toUInt()) { @@ -511,7 +510,7 @@ void RDCutDialog::RefreshCarts() l->setText(3,q->value(2).toString()); // Group l->setTextColor(3,q->value(3).toString(),QFont::Bold); if(count++>RDCUT_DIALOG_STEP_SIZE) { - cut_progress_dialog->setProgress(++step); + cut_progress_dialog->setValue(++step); count=0; qApp->processEvents(QEventLoop::ExcludeUserInputEvents); } diff --git a/lib/rdcut_dialog.h b/lib/rdcut_dialog.h index 0c3f0c4c..58d1997a 100644 --- a/lib/rdcut_dialog.h +++ b/lib/rdcut_dialog.h @@ -2,7 +2,7 @@ // // A widget to select a Rivendell Cut. // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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,10 +22,10 @@ #define RDCUT_DIALOG_H #include -#include #include #include +#include #include #include @@ -90,7 +90,7 @@ class RDCutDialog : public RDDialog QPixmap *cut_macro_map; bool cut_allow_clear; bool cut_exclude_tracks; - Q3ProgressDialog *cut_progress_dialog; + QProgressDialog *cut_progress_dialog; QString cut_caption; }; diff --git a/lib/rdevent_line.cpp b/lib/rdevent_line.cpp index 9df3d0b8..05eb8d54 100644 --- a/lib/rdevent_line.cpp +++ b/lib/rdevent_line.cpp @@ -1161,10 +1161,10 @@ bool RDEventLine::linkLog(RDLogEvent *e,RDLog *log,const QString &svcname, logline->setExtStartTime(QTime().addSecs(3600*start_start_hour+ q->value(1).toInt())); logline->setExtLength(q->value(2).toInt()); - logline->setExtData(q->value(3).toString()); - logline->setExtEventId(q->value(4).toString()); - logline->setExtAnncType(q->value(5).toString()); - logline->setExtCartName(q->value(6).toString()); + logline->setExtData(q->value(3).toString().trimmed()); + logline->setExtEventId(q->value(4).toString().trimmed()); + logline->setExtAnncType(q->value(5).toString().trimmed()); + logline->setExtCartName(q->value(6).toString().trimmed()); logline->setEventLength(event_length); logline->setLinkEventName(event_name); logline->setLinkStartTime(link_logline->linkStartTime()); diff --git a/lib/rdimport_audio.cpp b/lib/rdimport_audio.cpp index 29c8a19d..33fe0a4b 100644 --- a/lib/rdimport_audio.cpp +++ b/lib/rdimport_audio.cpp @@ -2,7 +2,7 @@ // // Audio File Importation Dialog for Rivendell. // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -27,14 +27,10 @@ #include #include -#include +#include #include #include #include -//Added by qt3to4: -#include -#include -#include #include "rd.h" #include "rdapplication.h" @@ -47,7 +43,8 @@ RDImportAudio::RDImportAudio(QString cutname,QString *path, RDSettings *settings,bool *import_metadata, RDWaveData *wavedata,RDCut *clipboard, - bool *running,QWidget *parent) + bool *running,const QString &caption, + QWidget *parent) : RDDialog(parent) { import_default_settings=settings; @@ -58,11 +55,12 @@ RDImportAudio::RDImportAudio(QString cutname,QString *path, import_wavedata=wavedata; import_clipboard=clipboard; import_running=running; + import_caption=caption; import_file_filter=RD_AUDIO_FILE_FILTER; import_import_conv=NULL; import_export_conv=NULL; - setWindowTitle(tr("Import/Export Audio File")); + setWindowTitle(caption+" - "+tr("Import/Export Audio File")); // // Fix the Window Size @@ -73,16 +71,15 @@ RDImportAudio::RDImportAudio(QString cutname,QString *path, // // Mode Group // - import_mode_group=new Q3ButtonGroup(this); - import_mode_group->hide(); - connect(import_mode_group,SIGNAL(clicked(int)), + import_mode_group=new QButtonGroup(this); + connect(import_mode_group,SIGNAL(buttonClicked(int)), this,SLOT(modeClickedData(int))); // // Input Mode Button // import_importmode_button=new QRadioButton(tr("Import File"), this); - import_mode_group->insert(import_importmode_button); + import_mode_group->addButton(import_importmode_button,0); import_importmode_button->setGeometry(10,10,sizeHint().width()-40,15); import_importmode_button->setFont(sectionLabelFont()); import_importmode_button->setChecked(true); @@ -156,7 +153,7 @@ RDImportAudio::RDImportAudio(QString cutname,QString *path, // Output Mode Button // import_exportmode_button=new QRadioButton(tr("Export File"),this); - import_mode_group->insert(import_exportmode_button); + import_mode_group->addButton(import_exportmode_button,1); import_exportmode_button->setGeometry(10,120,sizeHint().width()-40,15); import_exportmode_button->setFont(sectionLabelFont()); @@ -270,7 +267,7 @@ RDImportAudio::RDImportAudio(QString cutname,QString *path, import_channels_box->setCurrentItem(settings->channels()-1); filenameChangedData(""); - modeClickedData(import_mode_group->selectedId()); + modeClickedData(import_mode_group->checkedId()); } @@ -405,14 +402,16 @@ void RDImportAudio::selectInputFileData() QString filename; if(import_in_filename_edit->text().isEmpty()) { - filename= - Q3FileDialog::getOpenFileName(*import_path, - import_file_filter,this); + filename=QFileDialog::getOpenFileName(this,import_caption+" - "+ + tr("Select Audio File"), + *import_path, + import_file_filter); } else { - filename= - Q3FileDialog::getOpenFileName(import_in_filename_edit->text(), - import_file_filter,this); + filename=QFileDialog::getOpenFileName(this,import_caption+" - "+ + tr("Select Audio File"), + import_in_filename_edit->text(), + import_file_filter); } if(!filename.isEmpty()) { import_in_filename_edit->setText(filename); @@ -429,12 +428,16 @@ void RDImportAudio::selectOutputFileData() import_settings->format())+")"; if(import_out_filename_edit->text().isEmpty()) { - filename= - Q3FileDialog::getSaveFileName(*import_path,filter,this); + filename=QFileDialog::getSaveFileName(this,import_caption+" - "+ + tr("Save Audio File"), + *import_path, + filter); } else { - filename=Q3FileDialog::getSaveFileName(import_out_filename_edit->text(), - filter,this); + filename=QFileDialog::getSaveFileName(this,import_caption+" - "+ + tr("Save Audio File"), + import_out_filename_edit->text(), + filter); } if(!filename.isEmpty()) { import_out_filename_edit-> @@ -469,7 +472,7 @@ void RDImportAudio::importData() import_export_conv->abort(); return; } - if(import_mode_group->selectedId()==0) { + if(import_mode_group->checkedId()==0) { Import(); } else { diff --git a/lib/rdimport_audio.h b/lib/rdimport_audio.h index 7c37fa9e..8094f4bc 100644 --- a/lib/rdimport_audio.h +++ b/lib/rdimport_audio.h @@ -2,7 +2,7 @@ // // Audio File Importation Dialog for Rivendell. // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -24,8 +24,7 @@ #include #include -#include - +#include #include #include #include @@ -56,7 +55,8 @@ class RDImportAudio : public RDDialog public: RDImportAudio(QString cutname,QString *path,RDSettings *settings, bool *import_metadata,RDWaveData *wavedata, - RDCut *clipboard,bool *running,QWidget *parent=0); + RDCut *clipboard,bool *running,const QString &caption, + QWidget *parent=0); ~RDImportAudio(); QSize sizeHint() const; QSizePolicy sizePolicy() const; @@ -92,7 +92,7 @@ class RDImportAudio : public RDDialog RDSettings *import_default_settings; RDCut *import_clipboard; bool *import_running; - Q3ButtonGroup *import_mode_group; + QButtonGroup *import_mode_group; QRadioButton *import_importmode_button; QRadioButton *import_exportmode_button; QLabel *import_in_filename_label; @@ -129,6 +129,7 @@ class RDImportAudio : public RDDialog RDWaveData *import_wavedata; RDAudioImport *import_import_conv; RDAudioExport *import_export_conv; + QString import_caption; }; diff --git a/lib/rdlabel.cpp b/lib/rdlabel.cpp deleted file mode 100644 index 7522a0d3..00000000 --- a/lib/rdlabel.cpp +++ /dev/null @@ -1,139 +0,0 @@ -// rdlabel.cpp -// -// Multiline button labelling that is smart about spaces and the like -// -// (C) Copyright 2002,2016 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. -// -// - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - - -RDLabel::RDLabel(QWidget *parent,Qt::WFlags f) - : QLabel(parent,"",f) -{ - label_wrap=false; -} - - -RDLabel::RDLabel(const QString &text,QWidget *parent=0,Qt::WFlags f) - : QLabel(text,parent,"",f) -{ - label_wrap=false; - label_text=text; - QLabel::setText(WrapText()); -} - - -RDLabel::RDLabel(QWidget *buddy,const QString &text,QWidget *parent,Qt::WFlags f) - : QLabel(buddy,text,parent,"",f) -{ - label_wrap=false; - label_text=text; - QLabel::setText(WrapText()); -} - - -QString RDLabel::text() const -{ - return label_text; -} - - -void RDLabel::setFont(const QFont &font) -{ - label_font=font; - QLabel::setFont(font); - QLabel::setText(WrapText()); -} - - -bool RDLabel::wordWrapEnabled() const -{ - return label_wrap; -} - - -void RDLabel::setWordWrapEnabled(bool state) -{ - label_wrap=state; - QLabel::setText(WrapText()); -} - - -void RDLabel::setText(const QString &string) -{ - label_text=string; - QLabel::setText(WrapText()); -} - - -QString RDLabel::WrapText() -{ - QFontMetrics fm(label_font); - QString str; - QString residue=label_text; - bool space_found=false; - int l; - - if(label_wrap&&!label_text.isEmpty()) { - while(!residue.isEmpty()) { - space_found=false; - for(int i=residue.length();i>=0;i--) { - if((i==((int)residue.length()))||(residue.at(i).isSpace())) { - if(fm.boundingRect(residue.left(i)).width()<=width()) { - space_found=true; - if(!str.isEmpty()) { - str+="\n"; - } - str+=residue.left(i); - if(i==(int)residue.length()) { - return str; - } - residue=residue.right(residue.length()-i-1); - } - } - } - if(!space_found) { - l=residue.length(); - for(int i=l;i>=0;i--) { - if(fm.boundingRect(residue.left(i)).width()<=width()) { - if(!str.isEmpty()) { - str+="\n"; - } - str+=residue.left(i); - if(i==(int)residue.length()) { - return str; - } - residue=residue.right(residue.length()-i-1); - } - } - } - } - } - return label_text; -} diff --git a/lib/rdlabel.h b/lib/rdlabel.h deleted file mode 100644 index e48c2286..00000000 --- a/lib/rdlabel.h +++ /dev/null @@ -1,57 +0,0 @@ -// rdlabel.h -// -// An label widget with word wrap. -// -// (C) Copyright 2002,2016 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. -// -// - -#ifndef RDLABEL_H -#define RDLABEL_H - -#include -#include -#include -#include -#include -#include -#include - -class RDLabel : public QLabel -{ - Q_OBJECT - - public: - RDLabel(QWidget *parent=0,Qt::WFlags f=0); - RDLabel(const QString &text,QWidget *parent,Qt::WFlags f=0); - RDLabel(QWidget *buddy,const QString &text,QWidget *parent,Qt::WFlags f=0); - QString text() const; - void setFont(const QFont &font); - bool wordWrapEnabled() const; - void setWordWrapEnabled(bool state); - - public slots: - void setText(const QString &string); - - private: - QString WrapText(); - QString label_text; - QFont label_font; - bool label_wrap; -}; - - -#endif // RDLABEL_H diff --git a/lib/rdlog_line.cpp b/lib/rdlog_line.cpp index 05987c1e..7e666b40 100644 --- a/lib/rdlog_line.cpp +++ b/lib/rdlog_line.cpp @@ -1619,7 +1619,12 @@ QString RDLogLine::resolveWildcards(QString pattern,int log_id) else { pattern.replace("%x",QString().sprintf("%d",log_id)); } - pattern.replace("%y",QString().sprintf("%d",year().year())); + if(year().isValid()) { + pattern.replace("%y",QString().sprintf("%d",year().year())); + } + else { + pattern.replace("%y",""); + } // %z Log Line Number return pattern; diff --git a/lib/rdlogplay.cpp b/lib/rdlogplay.cpp index f9ce4b7e..546beae7 100644 --- a/lib/rdlogplay.cpp +++ b/lib/rdlogplay.cpp @@ -2703,6 +2703,9 @@ void RDLogPlay::Playing(int id) if (isRefreshable()&&play_log->autoRefresh()) { refresh(); } + if((logline->timeType()==RDLogLine::Hard)&&(play_grace_timer->isActive())) { + play_grace_timer->stop(); + } LogPlayEvent(logline); emit transportChanged(); } diff --git a/lib/rdmacro.cpp b/lib/rdmacro.cpp index 170889d4..1b6525df 100644 --- a/lib/rdmacro.cpp +++ b/lib/rdmacro.cpp @@ -76,6 +76,7 @@ void RDMacro::setCommand(const QString &str) case RDMacro::GO: case RDMacro::JC: case RDMacro::JD: + case RDMacro::JZ: case RDMacro::LB: case RDMacro::LC: case RDMacro::LL: @@ -315,6 +316,7 @@ RDMacro RDMacro::fromString(const QString &str,RDMacro::Role role) case RDMacro::GO: case RDMacro::JC: case RDMacro::JD: + case RDMacro::JZ: case RDMacro::LB: case RDMacro::LC: case RDMacro::LL: diff --git a/lib/rdmacro.h b/lib/rdmacro.h index 66bfc2ec..f6ad76a3 100644 --- a/lib/rdmacro.h +++ b/lib/rdmacro.h @@ -2,7 +2,7 @@ // // A container class for a Rivendell Macro Language Command // -// (C) Copyright 2002-2018 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -36,13 +36,14 @@ class RDMacro enum Command {AG=0x4147,AL=0x414C,BO=0x424F,CC=0x4343,CE=0x4345,CL=0x434C, CP=0x4350,DL=0x444C,DP=0x4450,DS=0x4453,DX=0x4458,EX=0x4558, FS=0x4653,GE=0x4745,GI=0x4749,GO=0x474F,JC=0x4A43,JD=0x4A44, - LB=0x4C42,LC=0x4C43,LL=0x4C4C,LO=0x4C4F,MB=0x4D42,MD=0x4D44, - MN=0x4D4E,MT=0x4D54,NN=0x4E4E,PB=0x5042,PC=0x5043,PD=0x5044, - PE=0x5045,PL=0x504C,PM=0x504D,PN=0x504E,PP=0x5050,PS=0x5053, - PT=0x5054,PU=0x5055,PW=0x5057,PX=0x5058,RL=0x524C,RN=0x524E, - RS=0x5253,RR=0x5252,SA=0x5341,SC=0x5343,SD=0x5344,SG=0x5347, - SI=0x5349,SL=0x534C,SN=0x534e,SO=0x534F,SP=0x5350,SR=0x5352, - ST=0x5354,SX=0x5358,SY=0x5359,SZ=0x535A,TA=0x5441,UO=0x554F}; + JZ=0x4A5A,LB=0x4C42,LC=0x4C43,LL=0x4C4C,LO=0x4C4F,MB=0x4D42, + MD=0x4D44,MN=0x4D4E,MT=0x4D54,NN=0x4E4E,PB=0x5042,PC=0x5043, + PD=0x5044,PE=0x5045,PL=0x504C,PM=0x504D,PN=0x504E,PP=0x5050, + PS=0x5053,PT=0x5054,PU=0x5055,PW=0x5057,PX=0x5058,RL=0x524C, + RN=0x524E,RS=0x5253,RR=0x5252,SA=0x5341,SC=0x5343,SD=0x5344, + SG=0x5347,SI=0x5349,SL=0x534C,SN=0x534e,SO=0x534F,SP=0x5350, + SR=0x5352,ST=0x5354,SX=0x5358,SY=0x5359,SZ=0x535A,TA=0x5441, + UO=0x554F}; enum Role {Invalid=0,Cmd=1,Reply=2}; RDMacro(); RDMacro::Role role() const; diff --git a/lib/rdrenderer.cpp b/lib/rdrenderer.cpp index 80ad0b9e..0c83462f 100644 --- a/lib/rdrenderer.cpp +++ b/lib/rdrenderer.cpp @@ -496,17 +496,27 @@ bool RDRenderer::Render(const QString &outfile,RDLogEvent *log,RDSettings *s, sf_count_t frames=0; if((lls.at(i+1)->transType()==RDLogLine::Segue)&& (lls.at(i)->segueStartPoint()>=0)) { - frames=FramesFromMsec(lls.at(i)->segueStartPoint()- - lls.at(i)->startPoint()); - current_time= - current_time.addMSecs(lls.at(i)->segueStartPoint()- + if(lls.at(i)->segueStartPoint()>lls.at(i)->startPoint()) { + frames=FramesFromMsec(lls.at(i)->segueStartPoint()- lls.at(i)->startPoint()); + current_time= + current_time.addMSecs(lls.at(i)->segueStartPoint()- + lls.at(i)->startPoint()); + } + else { + frames=0; + } } else { - frames=FramesFromMsec(lls.at(i)->endPoint()- - lls.at(i)->startPoint()); - current_time=current_time.addMSecs(lls.at(i)->endPoint()- - lls.at(i)->startPoint()); + if(lls.at(i)->endPoint()>lls.at(i)->startPoint()) { + frames=FramesFromMsec(lls.at(i)->endPoint()- + lls.at(i)->startPoint()); + current_time=current_time.addMSecs(lls.at(i)->endPoint()- + lls.at(i)->startPoint()); + } + else { + frames=0; + } } pcm=new float[frames*s->channels()]; memset(pcm,0,frames*s->channels()*sizeof(float)); diff --git a/lib/rdreport.cpp b/lib/rdreport.cpp index 0c481f19..ca14d1ea 100644 --- a/lib/rdreport.cpp +++ b/lib/rdreport.cpp @@ -610,7 +610,7 @@ bool RDReport::generateReport(const QDate &startdate,const QDate &enddate, break; case RDReport::RadioTraffic: - ret=ExportRadioTraffic(filename,startdate,enddate,mixname); + ret=ExportRadioTraffic(filename,startdate,enddate,mixname,0); break; case RDReport::VisualTraffic: @@ -619,11 +619,15 @@ bool RDReport::generateReport(const QDate &startdate,const QDate &enddate, case RDReport::CounterPoint: case RDReport::WideOrbit: - ret=ExportRadioTraffic(filename,startdate,enddate,mixname); + ret=ExportRadioTraffic(filename,startdate,enddate,mixname,0); + break; + + case RDReport::CounterPoint2: + ret=ExportRadioTraffic(filename,startdate,enddate,mixname,1); break; case RDReport::Music1: - ret=ExportRadioTraffic(filename,startdate,enddate,mixname); + ret=ExportRadioTraffic(filename,startdate,enddate,mixname,0); break; case RDReport::MusicClassical: @@ -697,6 +701,9 @@ QString RDReport::filterText(RDReport::ExportFilter filter) case RDReport::CounterPoint: return QObject::tr("CounterPoint Traffic Reconciliation"); + case RDReport::CounterPoint2: + return QObject::tr("CounterPoint Traffic Reconciliation v2"); + case RDReport::MrMaster: return QObject::tr("Mr. Master Reconciliation"); @@ -724,9 +731,10 @@ QString RDReport::filterText(RDReport::ExportFilter filter) case RDReport::CutLog: return QObject::tr("Cut Log"); - default: - return QObject::tr("Unknown"); + case RDReport::LastFilter: + break; } + return QObject::tr("Unknown"); } @@ -758,6 +766,7 @@ bool RDReport::multipleDaysAllowed(RDReport::ExportFilter filter) case RDReport::RadioTraffic: case RDReport::VisualTraffic: case RDReport::CounterPoint: + case RDReport::CounterPoint2: case RDReport::LastFilter: case RDReport::MrMaster: case RDReport::Music1: @@ -789,6 +798,7 @@ bool RDReport::multipleMonthsAllowed(RDReport::ExportFilter filter) case RDReport::RadioTraffic: case RDReport::VisualTraffic: case RDReport::CounterPoint: + case RDReport::CounterPoint2: case RDReport::LastFilter: case RDReport::MrMaster: case RDReport::Music1: diff --git a/lib/rdreport.h b/lib/rdreport.h index 2f4c0c8d..2d8d4db6 100644 --- a/lib/rdreport.h +++ b/lib/rdreport.h @@ -2,7 +2,7 @@ // // Abstract a Rivendell Report Descriptor // -// (C) Copyright 2002-2006,2017 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -37,7 +37,7 @@ class RDReport CounterPoint=7,Music1=8,MusicSummary=9,WideOrbit=10, NprSoundExchange=11,MusicPlayout=12,NaturalLog=13, MusicClassical=14,MrMaster=15,SpinCount=16,CutLog=17, - LastFilter=18}; + CounterPoint2=18,LastFilter=19}; enum ExportOs {Linux=0,Windows=1}; enum ExportType {Generic=0,Traffic=1,Music=2}; enum StationType {TypeOther=0,TypeAm=1,TypeFm=2,TypeLast=3}; @@ -112,7 +112,8 @@ class RDReport bool ExportNprSoundEx(const QString &filename,const QDate &startdate, const QDate &enddate,const QString &mixtable); bool ExportRadioTraffic(const QString &filename,const QDate &startdate, - const QDate &enddate,const QString &mixtable); + const QDate &enddate,const QString &mixtable, + int version); bool ExportMusicClassical(const QString &filename,const QDate &startdate, const QDate &enddate,const QString &mixtable); bool ExportMusicPlayout(const QString &filename,const QDate &startdate, diff --git a/lib/rdslotbox.cpp b/lib/rdslotbox.cpp index 17ba9767..27b92239 100644 --- a/lib/rdslotbox.cpp +++ b/lib/rdslotbox.cpp @@ -111,9 +111,9 @@ RDSlotBox::RDSlotBox(RDPlayDeck *deck,RDAirPlayConf *conf,QWidget *parent) // // Position Slider // - line_position_bar=new Q3ProgressBar(this); + line_position_bar=new QProgressBar(this); line_position_bar->setGeometry(115,69,sizeHint().width()-190,13); - line_position_bar->setPercentageVisible(false); + line_position_bar->setTextVisible(false); line_position_bar->hide(); // @@ -347,8 +347,8 @@ void RDSlotBox::setCart(RDLogLine *logline) line_down_label-> setText(RDGetTimeLength(line_logline->effectiveLength()- line_logline->playPosition(),true,true)); - line_position_bar->setTotalSteps(line_logline->effectiveLength()); - line_position_bar->setProgress(line_logline->playPosition()); + line_position_bar->setMaximum(line_logline->effectiveLength()); + line_position_bar->setValue(line_logline->playPosition()); if(logline->cutNumber()>=0) { line_cut_label-> setText(QString().sprintf("%03u",logline->cutNumber())); @@ -435,13 +435,13 @@ void RDSlotBox::setTimer(int msecs) if(line_logline==NULL) { line_up_label->setText(RDGetTimeLength(0,true,true)); line_down_label->setText(RDGetTimeLength(0,true,true)); - line_position_bar->setProgress(0); + line_position_bar->setValue(0); } else { line_up_label->setText(RDGetTimeLength(msecs,true,true)); line_down_label-> setText(RDGetTimeLength(line_logline->effectiveLength()-msecs,true,true)); - line_position_bar->setProgress(msecs); + line_position_bar->setValue(msecs); } } diff --git a/lib/rdslotbox.h b/lib/rdslotbox.h index 556de69e..7ba70a45 100644 --- a/lib/rdslotbox.h +++ b/lib/rdslotbox.h @@ -2,7 +2,7 @@ // // Cart slot label widget for RDCartSlot // -// (C) Copyright 2012-2019 Fred Gleason +// (C) Copyright 2012-2020 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 @@ -21,18 +21,17 @@ #ifndef RDSLOTBOX_H #define RDSLOTBOX_H -#include #include #include -#include #include #include +#include +#include #include #include #include -#include #include #include #include @@ -90,7 +89,7 @@ class RDSlotBox : public RDWidget QLabel *line_talktime_label; QLabel *line_up_label; QLabel *line_down_label; - Q3ProgressBar *line_position_bar; + QProgressBar *line_position_bar; QTime line_end_time; int log_id; RDLogLine *line_logline; diff --git a/lib/rdsocket.cpp b/lib/rdsocket.cpp index b85c88fc..79cb532d 100644 --- a/lib/rdsocket.cpp +++ b/lib/rdsocket.cpp @@ -1,8 +1,8 @@ // rdsocket.cpp // -// A QSocket object with connection-ID. +// A QTcpSocket object with connection-ID. // -// (C) Copyright 2002,2016 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -21,22 +21,22 @@ #include #include #include -#include -#include +#include "rdsocket.h" RDSocket::RDSocket(int id,QObject *parent) - : Q3Socket(parent) + : QTcpSocket(parent) { id_num=id; connect(this,SIGNAL(hostFound()),this,SLOT(hostFoundData())); connect(this,SIGNAL(connected()),this,SLOT(connectedData())); - connect(this,SIGNAL(connectionClosed()),this,SLOT(connectionClosedData())); + connect(this,SIGNAL(disconnected()),this,SLOT(connectionClosedData())); connect(this,SIGNAL(delayedCloseFinished()), this,SLOT(delayedCloseFinishedData())); connect(this,SIGNAL(readyRead()),this,SLOT(readyReadData())); connect(this,SIGNAL(bytesWritten(int)),this,SLOT(bytesWrittenData(int))); - connect(this,SIGNAL(error(int)),this,SLOT(errorData(int))); + connect(this,SIGNAL(error(QAbstractSocket::SocketError)), + this,SLOT(errorData(QAbstractSocket::SocketError))); } @@ -76,7 +76,7 @@ void RDSocket::bytesWrittenData(int nbytes) } -void RDSocket::errorData(int error) +void RDSocket::errorData(QAbstractSocket::SocketError error) { emit errorID(error,id_num); } diff --git a/lib/rdsocket.h b/lib/rdsocket.h index 453a5336..d1c45f71 100644 --- a/lib/rdsocket.h +++ b/lib/rdsocket.h @@ -2,7 +2,7 @@ // // A QSocket object with connection-ID. // -// (C) Copyright 2002,2016 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -22,9 +22,9 @@ #define RDSOCKET_H #include -#include +#include -class RDSocket : public Q3Socket +class RDSocket : public QTcpSocket { Q_OBJECT public: @@ -37,7 +37,7 @@ class RDSocket : public Q3Socket void delayedCloseFinishedID(int id); void readyReadID(int id); void bytesWrittenID(int nbytes,int id); - void errorID(int error,int id); + void errorID(QAbstractSocket::SocketError error,int id); private slots: void hostFoundData(); @@ -46,7 +46,7 @@ class RDSocket : public Q3Socket void delayedCloseFinishedData(); void readyReadData(); void bytesWrittenData(int nbytes); - void errorData(int error); + void errorData(QAbstractSocket::SocketError error); private: int id_num; diff --git a/lib/rdttydevice.cpp b/lib/rdttydevice.cpp index 40df6b3d..d23ee8b6 100644 --- a/lib/rdttydevice.cpp +++ b/lib/rdttydevice.cpp @@ -55,6 +55,8 @@ bool RDTTYDevice::open(QIODevice::OpenMode mode) int flags=O_NONBLOCK|O_NOCTTY; struct termios term; + QIODevice::open(mode); + tty_mode=mode; if((mode&QIODevice::ReadWrite)==QIODevice::ReadWrite) { flags|=O_RDWR; diff --git a/rdadmin/edit_dropbox.cpp b/rdadmin/edit_dropbox.cpp index e2918a6a..dee21f09 100644 --- a/rdadmin/edit_dropbox.cpp +++ b/rdadmin/edit_dropbox.cpp @@ -20,18 +20,19 @@ #include -#include -#include +#include #include #include -#include -#include -#include + #include -#include #include +#include +#include +#include +#include +#include +#include #include -#include #include #include @@ -44,8 +45,6 @@ EditDropbox::EditDropbox(int id,bool duplicate,QWidget *parent) : RDDialog(parent) { - setModal(true); - QString sql; RDSqlQuery *q; @@ -506,7 +505,9 @@ QSizePolicy EditDropbox::sizePolicy() const void EditDropbox::selectPathData() { QString path=box_path_edit->text(); - path=Q3FileDialog::getExistingDirectory(path,this); + path=QFileDialog::getExistingDirectory(this,"RDAdmin - "+ + tr("Select Directory"),path, + QFileDialog::ShowDirsOnly); if(!path.isEmpty()) { box_path_edit->setText(path); } @@ -538,7 +539,8 @@ void EditDropbox::selectCartData() void EditDropbox::selectLogPathData() { QString path=box_log_path_edit->text(); - path=Q3FileDialog::getSaveFileName(path,QString::null,this); + path=QFileDialog::getSaveFileName(this,"RDAdmin - "+tr("Select Log File"), + path,"Text files (*.txt);;All files (*)"); if(!path.isEmpty()) { box_log_path_edit->setText(path); } diff --git a/rdadmin/edit_rdairplay.cpp b/rdadmin/edit_rdairplay.cpp index 8c06770f..07193100 100644 --- a/rdadmin/edit_rdairplay.cpp +++ b/rdadmin/edit_rdairplay.cpp @@ -2,7 +2,7 @@ // // Edit an RDAirPlay Configuration // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -18,19 +18,19 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#include -#include -#include -#include +#include #include #include -#include -#include -#include + #include -#include +#include +#include +#include +#include #include -#include +#include +#include +#include #include #include @@ -1188,8 +1188,9 @@ void EditRDAirPlay::editHotKeys() void EditRDAirPlay::selectSkinData() { QString filename=air_skin_edit->text(); - filename=Q3FileDialog::getOpenFileName(filename,RD_IMAGE_FILE_FILTER,this,"", - tr("Select Image File")); + filename=QFileDialog::getOpenFileName(this,"RDAdmin - "+ + tr("Select Image File"),filename, + RD_IMAGE_FILE_FILTER); if(!filename.isNull()) { air_skin_edit->setText(filename); } diff --git a/rdadmin/edit_rdpanel.cpp b/rdadmin/edit_rdpanel.cpp index 537f494c..ba202617 100644 --- a/rdadmin/edit_rdpanel.cpp +++ b/rdadmin/edit_rdpanel.cpp @@ -2,7 +2,7 @@ // // Edit an RDPanel Configuration // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -18,7 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#include +#include #include #include @@ -427,8 +427,9 @@ QSizePolicy EditRDPanel::sizePolicy() const void EditRDPanel::selectSkinData() { QString filename=air_skin_edit->text(); - filename=Q3FileDialog::getOpenFileName(filename,RD_IMAGE_FILE_FILTER,this,"", - tr("Select Image File")); + filename=QFileDialog::getOpenFileName(this,"RDAdmin - "+ + tr("Select Image File"),filename, + RD_IMAGE_FILE_FILTER); if(!filename.isNull()) { air_skin_edit->setText(filename); } diff --git a/rdadmin/edit_settings.cpp b/rdadmin/edit_settings.cpp index 98ff828c..6c0c9ef4 100644 --- a/rdadmin/edit_settings.cpp +++ b/rdadmin/edit_settings.cpp @@ -2,7 +2,7 @@ // // Edit Rivendell System-Wide Configuration // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -18,10 +18,11 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#include #include +#include #include +#include #include #include @@ -255,7 +256,9 @@ void EditSettings::duplicatesCheckedData(bool state) void EditSettings::saveData() { QString filename=RDGetHomeDir(); - filename=Q3FileDialog::getSaveFileName(filename,"Text Files *.txt",this); + filename=QFileDialog::getSaveFileName(this,"RDAdmin - "+tr("Save text file"), + filename, + "Text files (*.txt);;All files (*.*)"); if(filename.isNull()) { return; } @@ -304,7 +307,8 @@ void EditSettings::okData() if(edit_duplicate_carts_box->isChecked()!= edit_system->allowDuplicateCartTitles()) { QLabel *msg=new QLabel(this); - Q3ProgressDialog *pd=new Q3ProgressDialog(this); + QProgressDialog *pd=new QProgressDialog(this); + pd->setWindowTitle("RDAdmin - "+tr("Progress")); pd->setLabel(msg); pd->setCancelButton(NULL); pd->setMinimumDuration(2); @@ -318,7 +322,8 @@ void EditSettings::okData() int count=0; int step=0; int step_size=q->size()/10; - pd->setProgress(0,10); + pd->setMaximum(10); + pd->setValue(0); while(q->next()) { sql=QString("select NUMBER from CART where ")+ "(TITLE=\""+RDEscapeString(q->value(1).toString())+"\")&&"+ @@ -330,7 +335,7 @@ void EditSettings::okData() delete q1; count++; if(count>=step_size) { - pd->setProgress(++step); + pd->setValue(++step); count=0; qApp->processEvents(); } @@ -369,7 +374,7 @@ void EditSettings::okData() sql="alter table CART drop index TITLE_IDX"; q=new RDSqlQuery(sql); delete q; - sql="alter table CART modify column TITLE char(255) unique"; + sql="alter table CART modify column TITLE varchar(191) unique"; q=new RDSqlQuery(sql); delete q; edit_system->setAllowDuplicateCartTitles(false); @@ -378,7 +383,7 @@ void EditSettings::okData() sql="alter table CART drop index TITLE"; q=new RDSqlQuery(sql); delete q; - sql="alter table CART modify column TITLE char(255)"; + sql="alter table CART modify column TITLE varchar(191)"; q=new RDSqlQuery(sql); delete q; sql="alter table CART add index TITLE_IDX(TITLE)"; diff --git a/rdadmin/info_dialog.cpp b/rdadmin/info_dialog.cpp index 46af6c98..d130e240 100644 --- a/rdadmin/info_dialog.cpp +++ b/rdadmin/info_dialog.cpp @@ -2,7 +2,7 @@ // // Display System Information for Rivendell // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -20,9 +20,10 @@ #include -#include -#include +#include + #include +#include #include "info_dialog.h" #include "license.h" @@ -38,8 +39,6 @@ InfoDialog::InfoDialog(QWidget *parent) : RDDialog(parent) { - setModal(true); - // // Fix the Window Size // @@ -113,7 +112,7 @@ InfoDialog::InfoDialog(QWidget *parent) // // Disclaimer // - label=new RDLabel(this); + label=new QLabel(this); label->setGeometry(10,104,sizeHint().width()-20,60); label->setFont(subLabelFont()); label->setWordWrap(true); diff --git a/rdadmin/list_feeds.cpp b/rdadmin/list_feeds.cpp index 420d824a..06c9ec34 100644 --- a/rdadmin/list_feeds.cpp +++ b/rdadmin/list_feeds.cpp @@ -221,11 +221,10 @@ void ListFeeds::deleteData() RDPodcast *cast; sql=QString().sprintf("select ID from PODCASTS where FEED_ID=%d",item->id()); q=new RDSqlQuery(sql); - QProgressDialog *pd=new QProgressDialog(tr("Deleting Audio..."), - tr("Cancel"),0,q->size()+1,this); - pd->setCaption(tr("Deleting")); + QProgressDialog *pd=new QProgressDialog(tr("Deleting Audio..."),tr("Cancel"), + 0,q->size()+1,this); + pd->setWindowTitle("RDAdmin - "+tr("Deleting")); pd->setValue(0); - pd->show(); qApp->processEvents(); sleep(1); while(q->next()) { diff --git a/rdadmin/rdadmin.cpp b/rdadmin/rdadmin.cpp index 041f009a..37ab30a5 100644 --- a/rdadmin/rdadmin.cpp +++ b/rdadmin/rdadmin.cpp @@ -135,8 +135,8 @@ MainWidget::MainWidget(RDConfig *config,RDWidget *parent) // // Cart Dialog // - admin_cart_dialog= - new RDCartDialog(&admin_filter,&admin_group,&admin_schedcode,this); + admin_cart_dialog=new RDCartDialog(&admin_filter,&admin_group, + &admin_schedcode,"RDAdmin",this); // // User Labels diff --git a/rdadmin/rdadmin_cs.ts b/rdadmin/rdadmin_cs.ts index 54c482a2..18745ef8 100644 --- a/rdadmin/rdadmin_cs.ts +++ b/rdadmin/rdadmin_cs.ts @@ -1310,6 +1310,14 @@ files, causing any whose files remain to be imported again. Log events in Syslog + + Select Directory + + + + Select Log File + + EditEncoder @@ -3725,6 +3733,14 @@ Přepsat? Multicast Address for Notifications + + Save text file + + + + Progress + + EditStation diff --git a/rdadmin/rdadmin_de.ts b/rdadmin/rdadmin_de.ts index 30383fcc..aed2ba4d 100644 --- a/rdadmin/rdadmin_de.ts +++ b/rdadmin/rdadmin_de.ts @@ -1226,6 +1226,14 @@ files, causing any whose files remain to be imported again. Log events in Syslog + + Select Directory + + + + Select Log File + + EditEncoder @@ -3585,6 +3593,14 @@ Overwrite? Multicast Address for Notifications + + Save text file + + + + Progress + + EditStation diff --git a/rdadmin/rdadmin_es.ts b/rdadmin/rdadmin_es.ts index 413a44e4..bd82c045 100644 --- a/rdadmin/rdadmin_es.ts +++ b/rdadmin/rdadmin_es.ts @@ -1312,6 +1312,14 @@ files, causing any whose files remain to be imported again. Log events in Syslog + + Select Directory + + + + Select Log File + + EditEncoder @@ -3736,6 +3744,14 @@ Overwrite? Multicast Address for Notifications + + Save text file + + + + Progress + + EditStation diff --git a/rdadmin/rdadmin_fr.ts b/rdadmin/rdadmin_fr.ts index df41914a..a849ea4f 100644 --- a/rdadmin/rdadmin_fr.ts +++ b/rdadmin/rdadmin_fr.ts @@ -929,6 +929,14 @@ files, causing any whose files remain to be imported again. Log events in Syslog + + Select Directory + + + + Select Log File + + EditEndpoint @@ -2999,6 +3007,14 @@ Overwrite? Multicast Address for Notifications + + Save text file + + + + Progress + + EditStation diff --git a/rdadmin/rdadmin_nb.ts b/rdadmin/rdadmin_nb.ts index 22d86785..bddf1824 100644 --- a/rdadmin/rdadmin_nb.ts +++ b/rdadmin/rdadmin_nb.ts @@ -1208,6 +1208,14 @@ files, causing any whose files remain to be imported again. Log events in Syslog + + Select Directory + + + + Select Log File + + EditEncoder @@ -3523,6 +3531,14 @@ Overwrite? Multicast Address for Notifications + + Save text file + + + + Progress + + EditStation diff --git a/rdadmin/rdadmin_nn.ts b/rdadmin/rdadmin_nn.ts index 22d86785..bddf1824 100644 --- a/rdadmin/rdadmin_nn.ts +++ b/rdadmin/rdadmin_nn.ts @@ -1208,6 +1208,14 @@ files, causing any whose files remain to be imported again. Log events in Syslog + + Select Directory + + + + Select Log File + + EditEncoder @@ -3523,6 +3531,14 @@ Overwrite? Multicast Address for Notifications + + Save text file + + + + Progress + + EditStation diff --git a/rdadmin/rdadmin_pt_BR.ts b/rdadmin/rdadmin_pt_BR.ts index 7130132f..11a969bb 100644 --- a/rdadmin/rdadmin_pt_BR.ts +++ b/rdadmin/rdadmin_pt_BR.ts @@ -1197,6 +1197,14 @@ files, causing any whose files remain to be imported again. Log events in Syslog + + Select Directory + + + + Select Log File + + EditEncoder @@ -3572,6 +3580,14 @@ Overwrite? Multicast Address for Notifications + + Save text file + + + + Progress + + EditStation diff --git a/rdairplay/loglinebox.cpp b/rdairplay/loglinebox.cpp index 92f1c287..1d8c0e67 100644 --- a/rdairplay/loglinebox.cpp +++ b/rdairplay/loglinebox.cpp @@ -2,7 +2,7 @@ // // On Air Playout Utility for Rivendell. // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -139,9 +139,9 @@ LogLineBox::LogLineBox(RDAirPlayConf *conf,QWidget *parent) // // Position Slider // - line_position_bar=new Q3ProgressBar(this); + line_position_bar=new QProgressBar(this); line_position_bar->setGeometry(75,66,sizeHint().width()-150,13); - line_position_bar->setPercentageVisible(false); + line_position_bar->setTextVisible(false); line_position_bar->hide(); // @@ -186,11 +186,11 @@ LogLineBox::LogLineBox(RDAirPlayConf *conf,QWidget *parent) // // Marker Comment // - line_comment_label=new RDLabel(this); + line_comment_label=new QLabel(this); line_comment_label->setGeometry(5,18,sizeHint().width()-10,62); line_comment_label->setFont(line_font); line_comment_label->setAlignment(Qt::AlignTop|Qt::AlignLeft); - line_comment_label->setWordWrapEnabled(true); + line_comment_label->setWordWrap(true); line_comment_label->hide(); // @@ -539,8 +539,8 @@ void LogLineBox::setEvent(int line,RDLogLine::TransType next_type, line_down_label-> setText(RDGetTimeLength(line_logline->effectiveLength()- line_logline->playPosition(),true,true)); - line_position_bar->setTotalSteps(line_logline->effectiveLength()); - line_position_bar->setProgress(line_logline->playPosition()); + line_position_bar->setMaximum(line_logline->effectiveLength()); + line_position_bar->setValue(line_logline->playPosition()); if(logline->cutNumber()>=0) { line_cut_label-> setText(QString().sprintf("%03u",logline->cutNumber())); @@ -687,7 +687,7 @@ void LogLineBox::setTimer(int msecs) line_up_label->setText(RDGetTimeLength(msecs,true,true)); line_down_label-> setText(RDGetTimeLength(line_logline->effectiveLength()-msecs,true,true)); - line_position_bar->setProgress(msecs); + line_position_bar->setValue(msecs); } diff --git a/rdairplay/loglinebox.h b/rdairplay/loglinebox.h index e6171bc4..49638fcd 100644 --- a/rdairplay/loglinebox.h +++ b/rdairplay/loglinebox.h @@ -21,13 +21,12 @@ #ifndef LOGLINEBOX_H #define LOGLINEBOX_H -#include - +#include #include +#include #include #include -#include #include #include #include @@ -96,8 +95,8 @@ class LogLineBox : public RDWidget QLabel *line_talktime_label; QLabel *line_up_label; QLabel *line_down_label; - RDLabel *line_comment_label; - Q3ProgressBar *line_position_bar; + QLabel *line_comment_label; + QProgressBar *line_position_bar; QTimer *line_countdown_timer; QTime line_end_time; int log_id; diff --git a/rdairplay/rdairplay.cpp b/rdairplay/rdairplay.cpp index 970d5639..b017800e 100644 --- a/rdairplay/rdairplay.cpp +++ b/rdairplay/rdairplay.cpp @@ -2,7 +2,7 @@ // // The On Air Playout Utility for Rivendell. // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -290,8 +290,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent) connect(air_log[i],SIGNAL(reloaded()),reload_mapper,SLOT(map())); rename_mapper->setMapping(air_log[i],i); connect(air_log[i],SIGNAL(renamed()),rename_mapper,SLOT(map())); - connect(air_log[i],SIGNAL(refreshStatusChanged(bool)), - this,SLOT(refreshStatusChangedData(bool))); connect(air_log[i],SIGNAL(channelStarted(int,int,int,int)), this,SLOT(logChannelStartedData(int,int,int,int))); connect(air_log[i],SIGNAL(channelStopped(int,int,int,int)), @@ -340,8 +338,8 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent) // // Cart Picker // - rdcart_dialog= - new RDCartDialog(&air_add_filter,&air_add_group,&air_add_schedcode,this); + rdcart_dialog=new RDCartDialog(&air_add_filter,&air_add_group, + &air_add_schedcode,"RDAirPlay",this); // // Wall Clock @@ -395,12 +393,12 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent) // // Message Label // - air_message_label=new RDLabel(this); + air_message_label=new QLabel(this); air_message_label->setGeometry(sizeHint().width()-425,70, MESSAGE_WIDGET_WIDTH,air_stereo_meter->sizeHint().height()); air_message_label->setStyleSheet("background-color: "+ QColor(LOGLINEBOX_BACKGROUND_COLOR).name()); - air_message_label->setWordWrapEnabled(true); + air_message_label->setWordWrap(true); air_message_label->setLineWidth(1); air_message_label->setMidLineWidth(1); air_message_label->setFrameStyle(Q3Frame::Box|Q3Frame::Raised); @@ -496,17 +494,6 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent) air_copy_button->setFocusPolicy(Qt::NoFocus); connect(air_copy_button,SIGNAL(clicked()),this,SLOT(copyButtonData())); - // - // Refresh Indicator - // - air_refresh_label=new RDLabel(this); - air_refresh_label->setGeometry(390,sizeHint().height()-65,120,60); - air_refresh_label->setFont(bigButtonFont()); - QPalette p=palette(); - p.setColor(QColorGroup::Foreground,Qt::red); - air_refresh_label->setPalette(p); - air_refresh_label->setAlignment(Qt::AlignCenter); - // // Meter Timer // @@ -1803,17 +1790,6 @@ void MainWidget::timeModeData(RDAirPlayConf::TimeMode mode) } -void MainWidget::refreshStatusChangedData(bool active) -{ - if(active) { - air_refresh_label->setText(tr("LOG\nREFRESHING")); - } - else { - air_refresh_label->setText(""); - } -} - - void MainWidget::clearSplashData() { air_splash_screen->hide(); diff --git a/rdairplay/rdairplay.h b/rdairplay/rdairplay.h index 6b8ed4ba..ae547dbe 100644 --- a/rdairplay/rdairplay.h +++ b/rdairplay/rdairplay.h @@ -2,7 +2,7 @@ // // The On Air Playout Utility for Rivendell. // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -96,7 +96,6 @@ class MainWidget : public RDWidget void masterTimerData(); void transportChangedData(); void timeModeData(RDAirPlayConf::TimeMode mode); - void refreshStatusChangedData(bool active); void clearSplashData(); void keyPressEvent(QKeyEvent *e); void keyReleaseEvent(QKeyEvent *e); @@ -153,7 +152,7 @@ class MainWidget : public RDWidget QString air_add_filter; QString air_add_group; QString air_add_schedcode; - RDLabel *air_message_label; + QLabel *air_message_label; int air_source_id; int air_meter_card[3]; int air_meter_port[3]; @@ -169,7 +168,6 @@ class MainWidget : public RDWidget bool air_start_start[RDAIRPLAY_LOG_QUANTITY]; RDAirPlayConf::ExitCode rdairplay_previous_exit_code; QDateTime air_startup_datetime; - RDLabel *air_refresh_label; QPixmap *air_refresh_pixmap; QString air_editor_cmd; QSplashScreen *air_splash_screen; diff --git a/rdairplay/rdairplay_cs.ts b/rdairplay/rdairplay_cs.ts index 0ba56228..ef465a3b 100644 --- a/rdairplay/rdairplay_cs.ts +++ b/rdairplay/rdairplay_cs.ts @@ -675,7 +675,7 @@ panel LOG REFRESHING - ZÁPIS + ZÁPIS OBNOVEN diff --git a/rdairplay/rdairplay_de.ts b/rdairplay/rdairplay_de.ts index d1ca8cc5..32134478 100644 --- a/rdairplay/rdairplay_de.ts +++ b/rdairplay/rdairplay_de.ts @@ -675,7 +675,7 @@ Panel LOG REFRESHING - LOG + LOG AKTUALISIERT diff --git a/rdairplay/rdairplay_es.ts b/rdairplay/rdairplay_es.ts index d7c34d7b..20fa577f 100644 --- a/rdairplay/rdairplay_es.ts +++ b/rdairplay/rdairplay_es.ts @@ -679,7 +679,7 @@ sonidos LOG REFRESHING - LEYENDO + LEYENDO LISTA diff --git a/rdairplay/rdairplay_fr.ts b/rdairplay/rdairplay_fr.ts index 77d655ad..cb71f053 100644 --- a/rdairplay/rdairplay_fr.ts +++ b/rdairplay/rdairplay_fr.ts @@ -679,7 +679,7 @@ de sons LOG REFRESHING - MISE A JOUR + MISE A JOUR DU LOG diff --git a/rdairplay/rdairplay_nb.ts b/rdairplay/rdairplay_nb.ts index 3f706134..260f5cd0 100644 --- a/rdairplay/rdairplay_nb.ts +++ b/rdairplay/rdairplay_nb.ts @@ -685,7 +685,7 @@ panel LOG REFRESHING - LOGGEN + LOGGEN LASTAR PÅ NYTT diff --git a/rdairplay/rdairplay_nn.ts b/rdairplay/rdairplay_nn.ts index 3f706134..260f5cd0 100644 --- a/rdairplay/rdairplay_nn.ts +++ b/rdairplay/rdairplay_nn.ts @@ -685,7 +685,7 @@ panel LOG REFRESHING - LOGGEN + LOGGEN LASTAR PÅ NYTT diff --git a/rdairplay/rdairplay_pt_BR.ts b/rdairplay/rdairplay_pt_BR.ts index 7fa74823..ae731f10 100644 --- a/rdairplay/rdairplay_pt_BR.ts +++ b/rdairplay/rdairplay_pt_BR.ts @@ -681,7 +681,7 @@ de Sons LOG REFRESHING - ATUALIZANDO + ATUALIZANDO LISTA diff --git a/rdcartslots/rdcartslots.cpp b/rdcartslots/rdcartslots.cpp index c5ef9fec..20c72d71 100644 --- a/rdcartslots/rdcartslots.cpp +++ b/rdcartslots/rdcartslots.cpp @@ -90,8 +90,8 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) // // Dialogs // - panel_cart_dialog= - new RDCartDialog(&panel_filter,&panel_group,&panel_schedcode,this); + panel_cart_dialog=new RDCartDialog(&panel_filter,&panel_group, + &panel_schedcode,"RDCartSlots",this); panel_slot_dialog=new RDSlotDialog(tr("RDCartSlots"),this); panel_cue_dialog=new RDCueEditDialog(rda->cae(),rda->station()->cueCard(), rda->station()->cuePort(), diff --git a/rdcatch/rdcatch.cpp b/rdcatch/rdcatch.cpp index 7bb8d14d..cb24b1a8 100644 --- a/rdcatch/rdcatch.cpp +++ b/rdcatch/rdcatch.cpp @@ -329,8 +329,8 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) // // Cart Picker // - catch_cart_dialog= - new RDCartDialog(&catch_filter,&catch_group,&catch_schedcode,this); + catch_cart_dialog=new RDCartDialog(&catch_filter,&catch_group, + &catch_schedcode,"RDCatch",this); // // Cart List diff --git a/rdlibrary/audio_cart.cpp b/rdlibrary/audio_cart.cpp index 43921b5a..6126b1cc 100644 --- a/rdlibrary/audio_cart.cpp +++ b/rdlibrary/audio_cart.cpp @@ -600,7 +600,7 @@ void AudioCart::importCutData() RDImportAudio *import=new RDImportAudio(cutname,rdcart_import_path, &settings,&rdcart_import_metadata, &wavedata,cut_clipboard, - &import_active); + &import_active,"RDLibrary",this); import->enableAutotrim(rda->libraryConf()->defaultTrimState()); import->setAutotrimLevel(rda->libraryConf()->trimThreshold()); import->enableNormalization(rda->libraryConf()->ripperLevel()!=0); diff --git a/rdlibrary/rdlibrary.cpp b/rdlibrary/rdlibrary.cpp index 02edb170..830217a7 100644 --- a/rdlibrary/rdlibrary.cpp +++ b/rdlibrary/rdlibrary.cpp @@ -2,7 +2,7 @@ // // The Library Utility for Rivendell. // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -1109,12 +1109,12 @@ void MainWidget::resizeEvent(QResizeEvent *e) lib_filter_label->setGeometry(10,10,55,20); lib_group_label->setGeometry(10,40,55,20); lib_group_box->setGeometry(70,40,100,20); - lib_codes_label->setGeometry(165,40,130,20); - lib_codes_box->setGeometry(300,40,100,20); - lib_codes2_label->setGeometry(415,40,130,20); - lib_codes2_box->setGeometry(550,40,100,20); - lib_matches_label->setGeometry(670,40,100,20); - lib_matches_edit->setGeometry(775,40,65,20); + lib_codes_label->setGeometry(160,40,130,20); + lib_codes_box->setGeometry(295,40,100,20); + lib_codes2_label->setGeometry(410,40,130,20); + lib_codes2_box->setGeometry(545,40,100,20); + lib_matches_label->setGeometry(660,40,100,20); + lib_matches_edit->setGeometry(765,40,55,20); lib_showmatches_label->setGeometry(760,66,200,20); lib_showmatches_box->setGeometry(740,68,15,15); lib_allowdrag_label->setGeometry(580,66,130,20); diff --git a/rdlogedit/edit_logline.cpp b/rdlogedit/edit_logline.cpp index e4591529..4ced4480 100644 --- a/rdlogedit/edit_logline.cpp +++ b/rdlogedit/edit_logline.cpp @@ -47,7 +47,8 @@ EditLogLine::EditLogLine(RDLogLine *line,QString *filter,QString *group, // // Cart Picker // - edit_cart_dialog=new RDCartDialog(edit_filter,edit_group,edit_schedcode,this); + edit_cart_dialog=new RDCartDialog(edit_filter,edit_group,edit_schedcode, + "RDLogEdit",this); // // Overlap Box diff --git a/rdlogedit/render_dialog.cpp b/rdlogedit/render_dialog.cpp index 93d83cfa..31a02182 100644 --- a/rdlogedit/render_dialog.cpp +++ b/rdlogedit/render_dialog.cpp @@ -2,7 +2,7 @@ // // Render Log Dialog for Rivendell. // -// (C) Copyright 2017-2019 Fred Gleason +// (C) Copyright 2017-2020 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,8 +53,8 @@ RenderDialog::RenderDialog(RDStation *station,RDSystem *system,RDConfig *config, // Dialogs // render_progress_dialog= - new Q3ProgressDialog(tr("Rendering Log..."),tr("Cancel"),0,this,"",true); - render_progress_dialog->setWindowTitle("RDLogEdit - "+tr("Render Progress")); + new QProgressDialog(tr("Rendering Log..."),tr("Cancel"),0,0,this); + render_progress_dialog->setWindowTitle(tr("Render Progress")); // // Settings @@ -214,7 +214,7 @@ void RenderDialog::selectData() { if(render_to_box->currentItem()) { QString filename= - QFileDialog::getSaveFileName(this,"RDLogEdit - "+tr("Render Log"), + QFileDialog::getSaveFileName(this,tr("Render Log"), render_save_path,RD_AUDIO_FILE_FILTER); if(!filename.isEmpty()) { render_filename_edit->setText(filename); @@ -253,6 +253,13 @@ void RenderDialog::audiosettingsData() } +void RenderDialog::lineStartedData(int linno,int totallines) +{ + render_progress_dialog->setMaximum(totallines); + render_progress_dialog->setValue(linno); +} + + void RenderDialog::renderData() { QString err_msg; @@ -269,9 +276,8 @@ void RenderDialog::renderData() start_time=render_starttime_edit->time(); } RDRenderer *r=new RDRenderer(this); - connect(r,SIGNAL(lineStarted(int,int)), - render_progress_dialog,SLOT(setProgress(int,int))); - connect(render_progress_dialog,SIGNAL(cancelled()),r,SLOT(abort())); + connect(r,SIGNAL(lineStarted(int,int)),this,SLOT(lineStartedData(int,int))); + connect(render_progress_dialog,SIGNAL(canceled()),r,SLOT(abort())); if(render_to_box->currentItem()) { result= r->renderToFile(render_filename_edit->text(),render_log,render_settings, diff --git a/rdlogedit/render_dialog.h b/rdlogedit/render_dialog.h index 8366f44f..5d75e297 100644 --- a/rdlogedit/render_dialog.h +++ b/rdlogedit/render_dialog.h @@ -2,7 +2,7 @@ // // Log Rendering Dialog for Rivendell. // -// (C) Copyright 2017-2019 Fred Gleason +// (C) Copyright 2017-2020 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,6 +22,7 @@ #define RENDER_DIALOG_H #include +#include #include #include @@ -51,6 +52,7 @@ class RenderDialog : public RDDialog void selectData(); void starttimeSourceData(int item); void audiosettingsData(); + void lineStartedData(int linno,int totallines); void renderData(); void cancelData(); @@ -67,7 +69,7 @@ class RenderDialog : public RDDialog int render_first_line; int render_last_line; RDSettings *render_settings; - Q3ProgressDialog *render_progress_dialog; + QProgressDialog *render_progress_dialog; QLabel *render_to_label; QComboBox *render_to_box; QLabel *render_filename_label; diff --git a/rdlogedit/voice_tracker.cpp b/rdlogedit/voice_tracker.cpp index 29570ee5..869e6eff 100644 --- a/rdlogedit/voice_tracker.cpp +++ b/rdlogedit/voice_tracker.cpp @@ -2375,7 +2375,7 @@ bool VoiceTracker::ImportTrack(RDListViewItem *item) RDImportAudio *import= new RDImportAudio(edit_track_cuts[1]->cutName(),edit_import_path, edit_settings,&metadata,wdata,NULL,&global_import_running, - this); + "RDLogEdit",this); if(import->exec(true,false)<0) { delete import; delete wdata; diff --git a/rdpanel/rdpanel.cpp b/rdpanel/rdpanel.cpp index 85ea2fd0..b07bf29d 100644 --- a/rdpanel/rdpanel.cpp +++ b/rdpanel/rdpanel.cpp @@ -138,8 +138,8 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) // // Cart Picker // - panel_cart_dialog= - new RDCartDialog(&panel_filter,&panel_group,&panel_schedcode,this); + panel_cart_dialog=new RDCartDialog(&panel_filter,&panel_group, + &panel_schedcode,"RDPanel",this); // // Sound Panel Array diff --git a/ripcd/bt10x1.cpp b/ripcd/bt10x1.cpp index 0b59f1fd..e28e19bf 100644 --- a/ripcd/bt10x1.cpp +++ b/ripcd/bt10x1.cpp @@ -44,7 +44,7 @@ Bt10x1::Bt10x1(RDMatrix *matrix,QObject *parent) bt_device->setSpeed(tty->baudRate()); bt_device->setWordLength(tty->dataBits()); bt_device->setParity(tty->parity()); - bt_device->open(QIODevice::Unbuffered|QIODevice::ReadWrite); + bt_device->open(QIODevice::Unbuffered|QIODevice::WriteOnly); } delete tty; } diff --git a/ripcd/bt16x1.cpp b/ripcd/bt16x1.cpp index 30e5262a..ed0d0dfd 100644 --- a/ripcd/bt16x1.cpp +++ b/ripcd/bt16x1.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools 16x1 // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -44,7 +44,7 @@ Bt16x1::Bt16x1(RDMatrix *matrix,QObject *parent) bt_device->setSpeed(tty->baudRate()); bt_device->setWordLength(tty->dataBits()); bt_device->setParity(tty->parity()); - bt_device->open(QIODevice::Unbuffered|QIODevice::ReadWrite); + bt_device->open(QIODevice::Unbuffered|QIODevice::WriteOnly); } delete tty; } diff --git a/ripcd/bt8x2.cpp b/ripcd/bt8x2.cpp index e4dccf8d..69e2d3b2 100644 --- a/ripcd/bt8x2.cpp +++ b/ripcd/bt8x2.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools 8x2 // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -44,7 +44,7 @@ Bt8x2::Bt8x2(RDMatrix *matrix,QObject *parent) bt_device->setSpeed(tty->baudRate()); bt_device->setWordLength(tty->dataBits()); bt_device->setParity(tty->parity()); - bt_device->open(QIODevice::Unbuffered|QIODevice::ReadWrite); + bt_device->open(QIODevice::Unbuffered|QIODevice::WriteOnly); } delete tty; } diff --git a/ripcd/btacs82.cpp b/ripcd/btacs82.cpp index 9530619e..7e16755e 100644 --- a/ripcd/btacs82.cpp +++ b/ripcd/btacs82.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools ACS 8.2 // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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,6 +53,7 @@ BtAcs82::BtAcs82(RDMatrix *matrix,QObject *parent) // RDTty *tty=new RDTty(rda->station()->name(),matrix->port(RDMatrix::Primary)); bt_device=new RDTTYDevice(); + connect(bt_device,SIGNAL(readyRead()),this,SLOT(processStatus())); if(tty->active()) { bt_device->setName(tty->port()); bt_device->setSpeed(tty->baudRate()); @@ -71,13 +72,6 @@ BtAcs82::BtAcs82(RDMatrix *matrix,QObject *parent) bt_gpo_oneshot=new RDOneShot(this); connect(bt_gpo_oneshot,SIGNAL(timeout(void *)), this,SLOT(gpoOneshotData(int))); - - // - // The Poll Timer - // - QTimer *timer=new QTimer(this,"poll_timer"); - connect(timer,SIGNAL(timeout()),this,SLOT(processStatus())); - timer->start(BTACS82_POLL_INTERVAL); } diff --git a/ripcd/btacs82.h b/ripcd/btacs82.h index dae2ea90..c6caacdb 100644 --- a/ripcd/btacs82.h +++ b/ripcd/btacs82.h @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools ACS 8.2 // -// (C) Copyright 2002-2008,2016 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -30,7 +30,6 @@ #include #define BTACS82_UNIT_ID 0 -#define BTACS82_POLL_INTERVAL 100 #define BTACS82_GPIO_PINS 16 class BtAcs82 : public Switcher diff --git a/ripcd/btadms4422.cpp b/ripcd/btadms4422.cpp index 753911da..e4b7aa68 100644 --- a/ripcd/btadms4422.cpp +++ b/ripcd/btadms4422.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools ADMS 44.22 // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -54,6 +54,7 @@ BtAdms4422::BtAdms4422(RDMatrix *matrix,QObject *parent) // RDTty *tty=new RDTty(rda->station()->name(),matrix->port(RDMatrix::Primary)); bt_device=new RDTTYDevice(); + connect(bt_device,SIGNAL(readyRead()),this,SLOT(processStatus())); if(tty->active()) { bt_device->setName(tty->port()); bt_device->setSpeed(tty->baudRate()); @@ -79,13 +80,6 @@ BtAdms4422::BtAdms4422(RDMatrix *matrix,QObject *parent) bt_gpo_oneshot=new RDOneShot(this); connect(bt_gpo_oneshot,SIGNAL(timeout(void *)), this,SLOT(gpoOneshotData(int))); - - // - // The Poll Timer - // - QTimer *timer=new QTimer(this); - connect(timer,SIGNAL(timeout()),this,SLOT(processStatus())); - timer->start(BTADMS4422_POLL_INTERVAL); } diff --git a/ripcd/btadms4422.h b/ripcd/btadms4422.h index af619caa..6fe8e31f 100644 --- a/ripcd/btadms4422.h +++ b/ripcd/btadms4422.h @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools ADMS 44.22 // -// (C) Copyright 2002-2016 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -30,7 +30,6 @@ #include #define BTADMS4422_UNIT_ID 0 -#define BTADMS4422_POLL_INTERVAL 100 #define BTADMS4422_GPI_PINS 16 class BtAdms4422 : public Switcher diff --git a/ripcd/btgpi16.cpp b/ripcd/btgpi16.cpp index 9a9ac02c..ed15b0b2 100644 --- a/ripcd/btgpi16.cpp +++ b/ripcd/btgpi16.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools GPI-16 // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -51,6 +51,7 @@ BtGpi16::BtGpi16(RDMatrix *matrix,QObject *parent) // RDTty *tty=new RDTty(rda->station()->name(),matrix->port(RDMatrix::Primary)); bt_device=new RDTTYDevice(); + connect(bt_device,SIGNAL(readyRead()),this,SLOT(processStatus())); if(tty->active()) { bt_device->setName(tty->port()); bt_device->setSpeed(tty->baudRate()); @@ -62,13 +63,6 @@ BtGpi16::BtGpi16(RDMatrix *matrix,QObject *parent) } } delete tty; - - // - // The Poll Timer - // - QTimer *timer=new QTimer(this,"poll_timer"); - connect(timer,SIGNAL(timeout()),this,SLOT(processStatus())); - timer->start(BTGPI16_POLL_INTERVAL); } diff --git a/ripcd/btgpi16.h b/ripcd/btgpi16.h index 1d1edf34..03c6818b 100644 --- a/ripcd/btgpi16.h +++ b/ripcd/btgpi16.h @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools GPI-16 // -// (C) Copyright 2002-2005,2010,2014,2016 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -30,7 +30,6 @@ #include #define BTGPI16_UNIT_ID 0 -#define BTGPI16_POLL_INTERVAL 100 #define BTGPI16_GPIO_PINS 16 class BtGpi16 : public Switcher @@ -48,16 +47,11 @@ class BtGpi16 : public Switcher private slots: void processStatus(); - // void gpiOneshotData(int value); - // void gpoOneshotData(int value); private: RDTTYDevice *bt_device; - // RDOneShot *bt_gpi_oneshot; - // RDOneShot *bt_gpo_oneshot; int bt_matrix; int bt_gpis; - // int bt_gpos; int bt_istate; bool bt_gpi_state[BTGPI16_GPIO_PINS]; bool bt_gpi_mask[BTGPI16_GPIO_PINS]; diff --git a/ripcd/btsentinel4web.cpp b/ripcd/btsentinel4web.cpp index 806e817a..d15d853e 100644 --- a/ripcd/btsentinel4web.cpp +++ b/ripcd/btsentinel4web.cpp @@ -2,7 +2,7 @@ // // Rivendell switcher driver for the BroadcastTools Sentinel4Web AES switcher // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -36,9 +36,10 @@ BtSentinel4Web::BtSentinel4Web(RDMatrix *matrix,QObject *parent) // // Socket // - bt_socket=new Q3Socket(this); + bt_socket=new QTcpSocket(this); connect(bt_socket,SIGNAL(connected()),this,SLOT(connectedData())); - connect(bt_socket,SIGNAL(error(int)),this,SLOT(errorData(int))); + connect(bt_socket,SIGNAL(error(QAbstractSocket::SocketError)), + this,SLOT(errorData(QAbstractSocket::SocketError))); connect(bt_socket,SIGNAL(readyRead()),this,SLOT(readyReadData())); // @@ -139,7 +140,7 @@ void BtSentinel4Web::connectedData() } -void BtSentinel4Web::errorData(int err) +void BtSentinel4Web::errorData(QAbstractSocket::SocketError err) { watchdogData(); } @@ -167,9 +168,10 @@ void BtSentinel4Web::watchdogData() void BtSentinel4Web::watchdogResetData() { delete bt_socket; - bt_socket=new Q3Socket(this); + bt_socket=new QTcpSocket(this); connect(bt_socket,SIGNAL(connected()),this,SLOT(connectedData())); - connect(bt_socket,SIGNAL(error(int)),this,SLOT(errorData(int))); + connect(bt_socket,SIGNAL(error(QAbstractSocket::SocketError)), + this,SLOT(errorData(QAbstractSocket::SocketError))); connect(bt_socket,SIGNAL(readyRead()),this,SLOT(readyReadData())); bt_socket->connectToHost(bt_address.toString(),bt_port); diff --git a/ripcd/btsentinel4web.h b/ripcd/btsentinel4web.h index 2b30030c..cf6db4d5 100644 --- a/ripcd/btsentinel4web.h +++ b/ripcd/btsentinel4web.h @@ -2,7 +2,7 @@ // // Rivendell switcher driver for the BroadcastTools Sentinel4Web AES switcher // -// (C) Copyright 2002-2013,2016 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -25,8 +25,8 @@ #include -#include #include +#include #include #include @@ -56,13 +56,13 @@ class BtSentinel4Web : public Switcher private slots: void connectedData(); - void errorData(int err); + void errorData(QAbstractSocket::SocketError err); void readyReadData(); void watchdogData(); void watchdogResetData(); private: - Q3Socket *bt_socket; + QTcpSocket *bt_socket; QHostAddress bt_address; uint16_t bt_port; QTimer *bt_watchdog_timer; diff --git a/ripcd/btsrc16.cpp b/ripcd/btsrc16.cpp index 0dc27ded..2c20e37b 100644 --- a/ripcd/btsrc16.cpp +++ b/ripcd/btsrc16.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools SRC-16 // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -51,6 +51,7 @@ BtSrc16::BtSrc16(RDMatrix *matrix,QObject *parent) // RDTty *tty=new RDTty(rda->station()->name(),matrix->port(RDMatrix::Primary)); bt_device=new RDTTYDevice(); + connect(bt_device,SIGNAL(readyRead()),this,SLOT(processStatus())); if(tty->active()) { bt_device->setName(tty->port()); bt_device->setSpeed(tty->baudRate()); @@ -67,13 +68,6 @@ BtSrc16::BtSrc16(RDMatrix *matrix,QObject *parent) connect(bt_gpi_oneshot,SIGNAL(timeout(int)),this,SLOT(gpiOneshotData(int))); bt_gpo_oneshot=new RDOneShot(this); connect(bt_gpo_oneshot,SIGNAL(timeout(int)),this,SLOT(gpoOneshotData(int))); - - // - // The Poll Timer - // - QTimer *timer=new QTimer(this,"poll_timer"); - connect(timer,SIGNAL(timeout()),this,SLOT(processStatus())); - timer->start(BTSRC16_POLL_INTERVAL); } diff --git a/ripcd/btsrc16.h b/ripcd/btsrc16.h index b59d1c81..935778dd 100644 --- a/ripcd/btsrc16.h +++ b/ripcd/btsrc16.h @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools SRC-16 // -// (C) Copyright 2002-2005,2010,2016 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -30,7 +30,6 @@ #include #define BTSRC16_UNIT_ID 0 -#define BTSRC16_POLL_INTERVAL 100 #define BTSRC16_GPIO_PINS 16 class BtSrc16 : public Switcher diff --git a/ripcd/btsrc8iii.cpp b/ripcd/btsrc8iii.cpp index d20f05f1..3491278a 100644 --- a/ripcd/btsrc8iii.cpp +++ b/ripcd/btsrc8iii.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools SRC-8 III // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -51,6 +51,7 @@ BtSrc8Iii::BtSrc8Iii(RDMatrix *matrix,QObject *parent) // RDTty *tty=new RDTty(rda->station()->name(),matrix->port(RDMatrix::Primary)); bt_device=new RDTTYDevice(); + connect(bt_device,SIGNAL(readyRead()),this,SLOT(processStatus())); if(tty->active()) { bt_device->setName(tty->port()); bt_device->setSpeed(tty->baudRate()); @@ -67,13 +68,6 @@ BtSrc8Iii::BtSrc8Iii(RDMatrix *matrix,QObject *parent) connect(bt_gpi_oneshot,SIGNAL(timeout(int)),this,SLOT(gpiOneshotData(int))); bt_gpo_oneshot=new RDOneShot(this); connect(bt_gpo_oneshot,SIGNAL(timeout(int)),this,SLOT(gpoOneshotData(int))); - - // - // The Poll Timer - // - QTimer *timer=new QTimer(this,"poll_timer"); - connect(timer,SIGNAL(timeout()),this,SLOT(processStatus())); - timer->start(BTSRC8III_POLL_INTERVAL); } diff --git a/ripcd/btsrc8iii.h b/ripcd/btsrc8iii.h index 5107f0c5..63a4dadb 100644 --- a/ripcd/btsrc8iii.h +++ b/ripcd/btsrc8iii.h @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools SRC-8 III // -// (C) Copyright 2002-2005,2010,2016 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -30,7 +30,6 @@ #include #define BTSRC8III_UNIT_ID 0 -#define BTSRC8III_POLL_INTERVAL 100 #define BTSRC8III_GPIO_PINS 8 class BtSrc8Iii : public Switcher diff --git a/ripcd/btss124.cpp b/ripcd/btss124.cpp index 0f815a7b..1c9ca3ac 100644 --- a/ripcd/btss124.cpp +++ b/ripcd/btss124.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools SS 12.4 // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -47,7 +47,7 @@ BtSs124::BtSs124(RDMatrix *matrix,QObject *parent) bt_device->setSpeed(tty->baudRate()); bt_device->setWordLength(tty->dataBits()); bt_device->setParity(tty->parity()); - bt_device->open(QIODevice::Unbuffered|QIODevice::ReadWrite); + bt_device->open(QIODevice::Unbuffered|QIODevice::WriteOnly); } delete tty; } diff --git a/ripcd/btss164.cpp b/ripcd/btss164.cpp index e22fdaca..5612efb2 100644 --- a/ripcd/btss164.cpp +++ b/ripcd/btss164.cpp @@ -53,6 +53,7 @@ BtSs164::BtSs164(RDMatrix *matrix,QObject *parent) // RDTty *tty=new RDTty(rda->station()->name(),matrix->port(RDMatrix::Primary)); bt_device=new RDTTYDevice(); + connect(bt_device,SIGNAL(readyRead()),this,SLOT(processStatus())); if(tty->active()) { bt_device->setName(tty->port()); bt_device->setSpeed(tty->baudRate()); @@ -69,13 +70,6 @@ BtSs164::BtSs164(RDMatrix *matrix,QObject *parent) connect(bt_gpi_oneshot,SIGNAL(timeout(int)),this,SLOT(gpiOneshotData(int))); bt_gpo_oneshot=new RDOneShot(this); connect(bt_gpo_oneshot,SIGNAL(timeout(int)),this,SLOT(gpoOneshotData(int))); - - // - // The Poll Timer - // - QTimer *timer=new QTimer(this,"poll_timer"); - connect(timer,SIGNAL(timeout()),this,SLOT(processStatus())); - timer->start(BTSS164_POLL_INTERVAL); } diff --git a/ripcd/btss21.cpp b/ripcd/btss21.cpp index 00c8e9fc..6014c82e 100644 --- a/ripcd/btss21.cpp +++ b/ripcd/btss21.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools SS 2.1 // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -48,7 +48,7 @@ BtSs21::BtSs21(RDMatrix *matrix,QObject *parent) bt_device->setSpeed(tty->baudRate()); bt_device->setWordLength(tty->dataBits()); bt_device->setParity(tty->parity()); - bt_device->open(QIODevice::IO_ReadWrite); + bt_device->open(QIODevice::IO_WriteOnly); } delete tty; } diff --git a/ripcd/btss41mlr.cpp b/ripcd/btss41mlr.cpp index 6fecbfeb..6d6867ea 100644 --- a/ripcd/btss41mlr.cpp +++ b/ripcd/btss41mlr.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools SS 4.1 MLR // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -54,6 +54,7 @@ BtSs41Mlr::BtSs41Mlr(RDMatrix *matrix,QObject *parent) // RDTty *tty=new RDTty(rda->station()->name(),matrix->port(RDMatrix::Primary)); bt_device=new RDTTYDevice(); + connect(bt_device,SIGNAL(readyRead()),this,SLOT(readyReadData())); if(tty->active()) { bt_device->setName(tty->port()); bt_device->setSpeed(tty->baudRate()); @@ -70,13 +71,6 @@ BtSs41Mlr::BtSs41Mlr(RDMatrix *matrix,QObject *parent) connect(bt_gpi_oneshot,SIGNAL(timeout(int)),this,SLOT(gpiOneshotData(int))); bt_gpo_oneshot=new RDOneShot(this); connect(bt_gpo_oneshot,SIGNAL(timeout(int)),this,SLOT(gpoOneshotData(int))); - - // - // The Poll Timer - // - QTimer *timer=new QTimer(this,"poll_timer"); - connect(timer,SIGNAL(timeout()),this,SLOT(readyReadData())); - timer->start(BTSS41MLR_POLL_INTERVAL); } diff --git a/ripcd/btss41mlr.h b/ripcd/btss41mlr.h index 871fabc8..5f416f94 100644 --- a/ripcd/btss41mlr.h +++ b/ripcd/btss41mlr.h @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools SS 4.1 MLR // -// (C) Copyright 2002-2016 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -30,7 +30,6 @@ #include #define BTSS41MLR_UNIT_ID 0 -#define BTSS41MLR_POLL_INTERVAL 100 #define BTSS41MLR_GPIO_PINS 16 class BtSs41Mlr : public Switcher diff --git a/ripcd/btss42.cpp b/ripcd/btss42.cpp index 20957628..0593afbd 100644 --- a/ripcd/btss42.cpp +++ b/ripcd/btss42.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools SS 4.2 // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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,6 +53,7 @@ BtSs42::BtSs42(RDMatrix *matrix,QObject *parent) // RDTty *tty=new RDTty(rda->station()->name(),matrix->port(RDMatrix::Primary)); bt_device=new RDTTYDevice(); + connect(bt_device,SIGNAL(readyRead()),this,SLOT(processStatus())); if(tty->active()) { bt_device->setName(tty->port()); bt_device->setSpeed(tty->baudRate()); @@ -69,13 +70,6 @@ BtSs42::BtSs42(RDMatrix *matrix,QObject *parent) connect(bt_gpi_oneshot,SIGNAL(timeout(int)),this,SLOT(gpiOneshotData(int))); bt_gpo_oneshot=new RDOneShot(this); connect(bt_gpo_oneshot,SIGNAL(timeout(int)),this,SLOT(gpoOneshotData(int))); - - // - // The Poll Timer - // - QTimer *timer=new QTimer(this,"poll_timer"); - connect(timer,SIGNAL(timeout()),this,SLOT(processStatus())); - timer->start(BTSS42_POLL_INTERVAL); } diff --git a/ripcd/btss42.h b/ripcd/btss42.h index 34023c7d..76a732fd 100644 --- a/ripcd/btss42.h +++ b/ripcd/btss42.h @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools SS 4.2 // -// (C) Copyright 2002-2005,2016 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -30,7 +30,6 @@ #include #define BTSS42_UNIT_ID 0 -#define BTSS42_POLL_INTERVAL 100 #define BTSS42_GPIO_PINS 16 class BtSs42 : public Switcher diff --git a/ripcd/btss44.cpp b/ripcd/btss44.cpp index e58b5096..e3d41cf5 100644 --- a/ripcd/btss44.cpp +++ b/ripcd/btss44.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools SS 4.4 // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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,6 +53,7 @@ BtSs44::BtSs44(RDMatrix *matrix,QObject *parent) // RDTty *tty=new RDTty(rda->station()->name(),matrix->port(RDMatrix::Primary)); bt_device=new RDTTYDevice(); + connect(bt_device,SIGNAL(readyRead()),this,SLOT(processStatus())); if(tty->active()) { bt_device->setName(tty->port()); bt_device->setSpeed(tty->baudRate()); @@ -69,13 +70,6 @@ BtSs44::BtSs44(RDMatrix *matrix,QObject *parent) connect(bt_gpi_oneshot,SIGNAL(timeout(int)),this,SLOT(gpiOneshotData(int))); bt_gpo_oneshot=new RDOneShot(this); connect(bt_gpo_oneshot,SIGNAL(timeout(int)),this,SLOT(gpoOneshotData(int))); - - // - // The Poll Timer - // - QTimer *timer=new QTimer(this,"poll_timer"); - connect(timer,SIGNAL(timeout()),this,SLOT(processStatus())); - timer->start(BTSS44_POLL_INTERVAL); } diff --git a/ripcd/btss44.h b/ripcd/btss44.h index 5dd43159..e7e95425 100644 --- a/ripcd/btss44.h +++ b/ripcd/btss44.h @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools SS 4.4 // -// (C) Copyright 2002-2005,2009,2016 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -30,7 +30,6 @@ #include #define BTSS44_UNIT_ID 0 -#define BTSS44_POLL_INTERVAL 100 #define BTSS44_GPIO_PINS 16 class BtSs44 : public Switcher diff --git a/ripcd/btss82.cpp b/ripcd/btss82.cpp index f9af55ed..31047673 100644 --- a/ripcd/btss82.cpp +++ b/ripcd/btss82.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools SS 8.2 // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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,6 +53,7 @@ BtSs82::BtSs82(RDMatrix *matrix,QObject *parent) // RDTty *tty=new RDTty(rda->station()->name(),matrix->port(RDMatrix::Primary)); bt_device=new RDTTYDevice(); + connect(bt_device,SIGNAL(readyRead()),this,SLOT(processStatus())); if(tty->active()) { bt_device->setName(tty->port()); bt_device->setSpeed(tty->baudRate()); @@ -69,13 +70,6 @@ BtSs82::BtSs82(RDMatrix *matrix,QObject *parent) connect(bt_gpi_oneshot,SIGNAL(timeout(int)),this,SLOT(gpiOneshotData(int))); bt_gpo_oneshot=new RDOneShot(this); connect(bt_gpo_oneshot,SIGNAL(timeout(int)),this,SLOT(gpoOneshotData(int))); - - // - // The Poll Timer - // - QTimer *timer=new QTimer(this,"poll_timer"); - connect(timer,SIGNAL(timeout()),this,SLOT(processStatus())); - timer->start(BTSS82_POLL_INTERVAL); } diff --git a/ripcd/btss82.h b/ripcd/btss82.h index 3d2c889a..d5e3b6e9 100644 --- a/ripcd/btss82.h +++ b/ripcd/btss82.h @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the BroadcastTools SS 8.2 // -// (C) Copyright 2002-2004,2016 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -30,7 +30,6 @@ #include #define BTSS82_UNIT_ID 0 -#define BTSS82_POLL_INTERVAL 100 #define BTSS82_GPIO_PINS 16 class BtSs82 : public Switcher diff --git a/ripcd/btu41mlrweb.cpp b/ripcd/btu41mlrweb.cpp index 5ff7cc82..7a805615 100644 --- a/ripcd/btu41mlrweb.cpp +++ b/ripcd/btu41mlrweb.cpp @@ -2,7 +2,7 @@ // // Rivendell switcher driver for the BroadcastTools Universal 4.1 MLR>>Web // -// (C) Copyright 2017-2019 Fred Gleason +// (C) Copyright 2017-2020 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 @@ -34,10 +34,11 @@ BtU41MlrWeb::BtU41MlrWeb(RDMatrix *matrix,QObject *parent) bt_gpi_states[i]=false; } - bt_socket=new Q3Socket(this); + bt_socket=new QTcpSocket(this); connect(bt_socket,SIGNAL(connected()),this,SLOT(connectedData())); connect(bt_socket,SIGNAL(readyRead()),this,SLOT(readyReadData())); - connect(bt_socket,SIGNAL(error(int)),this,SLOT(errorData(int))); + connect(bt_socket,SIGNAL(error(QAbstractSocket::SocketError)), + this,SLOT(errorData(QAbstractSocket::SocketError))); bt_socket->connectToHost(bt_ip_address.toString(),bt_ip_port); bt_keepalive_timer=new QTimer(this); @@ -148,7 +149,7 @@ void BtU41MlrWeb::readyReadData() } -void BtU41MlrWeb::errorData(int err) +void BtU41MlrWeb::errorData(QAbstractSocket::SocketError err) { watchdogData(); } diff --git a/ripcd/btu41mlrweb.h b/ripcd/btu41mlrweb.h index 5572903d..38085292 100644 --- a/ripcd/btu41mlrweb.h +++ b/ripcd/btu41mlrweb.h @@ -2,7 +2,7 @@ // // Rivendell switcher driver for the BroadcastTools Universal 4.1 MLR>>Web // -// (C) Copyright 2017 Fred Gleason +// (C) Copyright 2017-2020 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 @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include @@ -56,14 +56,14 @@ class BtU41MlrWeb : public Switcher private slots: void connectedData(); void readyReadData(); - void errorData(int err); + void errorData(QAbstractSocket::SocketError err); void keepaliveData(); void watchdogData(); private: void ProcessCommand(const QString &cmd); void SendCommand(const QString &cmd); - Q3Socket *bt_socket; + QTcpSocket *bt_socket; QTimer *bt_watchdog_timer; bool bt_watchdog_active; QHostAddress bt_ip_address; diff --git a/ripcd/harlond.cpp b/ripcd/harlond.cpp index 2e957766..8374cf5e 100644 --- a/ripcd/harlond.cpp +++ b/ripcd/harlond.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the Harlond Virtual Mixer // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -58,7 +58,7 @@ Harlond::Harlond(RDMatrix *matrix,QObject *parent) // // Initialize TCP/IP Connection // - bt_socket=new Q3Socket(this); + bt_socket=new QTcpSocket(this); connect(bt_socket,SIGNAL(connected()),this,SLOT(socketConnectedData())); connect(bt_socket,SIGNAL(disconnected()),this,SLOT(socketDisconnectedData())); connect(bt_socket,SIGNAL(readyRead()),this,SLOT(socketReadyReadData())); @@ -231,15 +231,15 @@ void Harlond::socketReadyReadData() } -void Harlond::socketErrorData(int err) +void Harlond::socketErrorData(QAbstractSocket::SocketError err) { bt_watchdog_timer->start(HARLOND_RECONNECT_INTERVAL,true); switch(err) { - case Q3Socket::ErrConnectionRefused: + case QAbstractSocket::ConnectionRefusedError: rda->syslog(LOG_WARNING, "connection to harlond device at %s:%d refused, attempting reconnect", (const char *)bt_ip_address.toString().toUtf8(), - bt_tcp_port); + bt_tcp_port); break; default: @@ -255,7 +255,7 @@ void Harlond::socketErrorData(int err) void Harlond::watchdogTimeoutData() { - if(bt_socket->state()!=Q3Socket::Connected) { + if(bt_socket->state()!=QAbstractSocket::Connected) { bt_socket->connectToHost(bt_ip_address.toString(),bt_tcp_port); } } diff --git a/ripcd/harlond.h b/ripcd/harlond.h index 8883924b..416ed5dc 100644 --- a/ripcd/harlond.h +++ b/ripcd/harlond.h @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the Harlond Virtual Mixer // -// (C) Copyright 2002-2012,2016 Fred Gleason +// (C) Copyright 2002-2020 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,8 +26,8 @@ #include #include +#include #include -#include #include #include @@ -55,7 +55,7 @@ class Harlond : public Switcher void socketConnectedData(); void socketDisconnectedData(); void socketReadyReadData(); - void socketErrorData(int err); + void socketErrorData(QAbstractSocket::SocketError err); void watchdogTimeoutData(); private: @@ -68,7 +68,7 @@ class Harlond : public Switcher bool AddCrosspoint(int input,int output); bool RemoveCrosspoint(int input,int output); QString GetBussCode(int output); - Q3Socket *bt_socket; + QTcpSocket *bt_socket; QString bt_recv_buffer; QTimer *bt_watchdog_timer; QHostAddress bt_ip_address; diff --git a/ripcd/local_macros.cpp b/ripcd/local_macros.cpp index 4a9b3ad4..3d1acff1 100644 --- a/ripcd/local_macros.cpp +++ b/ripcd/local_macros.cpp @@ -2,7 +2,7 @@ // // Local RML Macros for the Rivendell Interprocess Communication Daemon // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -96,19 +96,22 @@ void MainObject::gpoStateData(int matrix,unsigned line,bool state) void MainObject::ttyTrapData(int cartnum) { + rda->syslog(LOG_DEBUG,"executing trap cart %06d",cartnum); ExecCart(cartnum); } -void MainObject::ttyScanData() + +void MainObject::ttyReadyReadData(int num) { char buf[256]; int n; - for(int i=0;iread(buf,255))>0) { - ripcd_tty_trap[i]->scan(buf,n); + if(ripcd_tty_dev[num]!=NULL) { + while((n=ripcd_tty_dev[num]->read(buf,255))>0) { + buf[n]=0; + if(ripcd_tty_trap[num]!=NULL) { + ripcd_tty_trap[num]->scan(buf,n); } } } @@ -206,6 +209,10 @@ void MainObject::LoadLocalMacros() ripcd_tty_dev[tty_port]-> setParity((RDTTYDevice::Parity)q->value(4).toInt()); if(ripcd_tty_dev[tty_port]->open(QIODevice::ReadWrite)) { + connect(ripcd_tty_dev[tty_port],SIGNAL(readyRead()), + ripcd_tty_ready_read_mapper,SLOT(map())); + ripcd_tty_ready_read_mapper-> + setMapping(ripcd_tty_dev[tty_port],tty_port); ripcd_tty_term[tty_port]=(RDTty::Termination)q->value(5).toInt(); ripcd_tty_inuse[tty_port]=true; ripcd_tty_trap[tty_port]=new RDCodeTrap(this); @@ -219,9 +226,6 @@ void MainObject::LoadLocalMacros() } } delete q; - QTimer *timer=new QTimer(this,"tty_scan_timer"); - connect(timer,SIGNAL(timeout()),this,SLOT(ttyScanData())); - timer->start(RIPCD_TTY_READ_INTERVAL); } @@ -489,6 +493,57 @@ void MainObject::RunLocalMacros(RDMacro *rml_in) #endif // JACK break; + case RDMacro::JZ: +#ifdef JACK + if(rml->argQuantity()!=0) { + if(rml->echoRequested()) { + rml->acknowledge(false); + sendRml(rml); + } + return; + } + if(ripcd_jack_client!=NULL) { + const char **outputs=jack_get_ports(ripcd_jack_client,NULL, + JACK_DEFAULT_AUDIO_TYPE, + JackPortIsOutput); + if(outputs) { + int i=0; + while(outputs[i]!=0) { + jack_port_t *oport=jack_port_by_name(ripcd_jack_client,outputs[i]); + const char **inputs= + jack_port_get_all_connections(ripcd_jack_client,oport); + if(inputs) { + int j=0; + while(inputs[j]!=0) { + if((err=jack_disconnect(ripcd_jack_client,outputs[i],inputs[j]))==0) { + rda->syslog(LOG_DEBUG, + "executed JACK port disconnection \"%s %s\"", + inputs[j],outputs[i]); + } + else { + rda->syslog(LOG_WARNING, + "JACK port disconnection \"%s %s\" failed, err: %d", + inputs[j],outputs[i],err); + } + j++; + } + } + i++; + } + } + if(rml->echoRequested()) { + rml->acknowledge(true); + sendRml(rml); + } + } +#else + if(rml->echoRequested()) { + rml->acknowledge(false); + sendRml(rml); + } +#endif // JACK + break; + case RDMacro::LO: if(rml->argQuantity()>2) { if(rml->echoRequested()) { @@ -631,7 +686,7 @@ void MainObject::RunLocalMacros(RDMacro *rml_in) sendRml(rml); } break; - + case RDMacro::SI: tty_port=rml->arg(0).toInt(); if((tty_port<0)||(tty_port>MAX_TTYS)||(rml->argQuantity()!=3)) { @@ -652,6 +707,8 @@ void MainObject::RunLocalMacros(RDMacro *rml_in) str+=rml->arg(rml->argQuantity()-1); ripcd_tty_trap[tty_port]->addTrap(rml->arg(1).toInt(), str,str.length()); + rda->syslog(LOG_DEBUG,"added trap \"%s\" to tty port %d", + (const char *)str.toUtf8(),rml->arg(1).toInt()); rml->acknowledge(true); sendRml(rml); return; @@ -793,6 +850,7 @@ void MainObject::RunLocalMacros(RDMacro *rml_in) // if(ripcd_tty_dev[tty_port]!=NULL) { ripcd_tty_dev[tty_port]->close(); + ripcd_tty_ready_read_mapper->disconnect(ripcd_tty_dev[tty_port]); delete ripcd_tty_dev[tty_port]; ripcd_tty_dev[tty_port]=NULL; ripcd_tty_inuse[tty_port]=false; diff --git a/ripcd/modbus.cpp b/ripcd/modbus.cpp index c5797404..9d5e4617 100644 --- a/ripcd/modbus.cpp +++ b/ripcd/modbus.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for Modbus TCP // -// (C) Copyright 2017-2019 Fred Gleason +// (C) Copyright 2017-2020 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,10 +41,11 @@ Modbus::Modbus(RDMatrix *matrix,QObject *parent) modbus_ip_address=matrix->ipAddress(RDMatrix::Primary); modbus_ip_port=matrix->ipPort(RDMatrix::Primary); - modbus_socket=new Q3Socket(this); + modbus_socket=new QTcpSocket(this); connect(modbus_socket,SIGNAL(connected()),this,SLOT(connectedData())); connect(modbus_socket,SIGNAL(readyRead()),this,SLOT(readyReadData())); - connect(modbus_socket,SIGNAL(error(int)),this,SLOT(errorData(int))); + connect(modbus_socket,SIGNAL(error(QAbstractSocket::SocketError)), + this,SLOT(errorData(QAbstractSocket::SocketError))); modbus_socket->connectToHost(modbus_ip_address.toString(),modbus_ip_port); modbus_poll_timer=new QTimer(this); @@ -301,7 +302,7 @@ void Modbus::readyReadData() } -void Modbus::errorData(int err) +void Modbus::errorData(QAbstractSocket::SocketError err) { watchdogData(); } diff --git a/ripcd/modbus.h b/ripcd/modbus.h index 2a28d611..8b966f14 100644 --- a/ripcd/modbus.h +++ b/ripcd/modbus.h @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for Modbus TCP // -// (C) Copyright 2017 Fred Gleason +// (C) Copyright 2017-2020 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 @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include @@ -53,7 +53,7 @@ class Modbus : public Switcher private slots: void connectedData(); void readyReadData(); - void errorData(int err); + void errorData(QAbstractSocket::SocketError err); void pollInputs(); void resetStateData(int line); void watchdogData(); @@ -65,7 +65,7 @@ class Modbus : public Switcher int modbus_istate; int modbus_input_bytes; std::vector modbus_input_states; - Q3Socket *modbus_socket; + QTcpSocket *modbus_socket; QTimer *modbus_poll_timer; QTimer *modbus_watchdog_timer; bool modbus_watchdog_active; diff --git a/ripcd/quartz1.cpp b/ripcd/quartz1.cpp index c8180dfd..61a708dc 100644 --- a/ripcd/quartz1.cpp +++ b/ripcd/quartz1.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the Quartz Type 1 Switcher Protocol // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -55,61 +55,62 @@ Quartz1::Quartz1(RDMatrix *matrix,QObject *parent) // // Reconnection Timers // - QSignalMapper *mapper=new QSignalMapper(this,"reconnect_mapper"); + QSignalMapper *mapper=new QSignalMapper(this); connect(mapper,SIGNAL(mapped(int)),this,SLOT(ipConnect(int))); for(int i=0;i<2;i++) { - sas_reconnect_timer[i]=new QTimer(this,"sas_reconnect_timer"); - mapper->setMapping(sas_reconnect_timer[i],i); - connect(sas_reconnect_timer[i],SIGNAL(timeout()),mapper,SLOT(map())); + sas_reconnect_timer[i]=new QTimer(this); + mapper->setMapping(sas_reconnect_timer[i],i); + connect(sas_reconnect_timer[i],SIGNAL(timeout()),mapper,SLOT(map())); } // // Initialize the connections // - QSignalMapper *connected_mapper=new QSignalMapper(this,"connected_mapper"); + QSignalMapper *connected_mapper=new QSignalMapper(this); connect(connected_mapper,SIGNAL(mapped(int)),this,SLOT(connectedData(int))); - QSignalMapper *closed_mapper=new QSignalMapper(this,"closed_mapper"); + QSignalMapper *closed_mapper=new QSignalMapper(this); connect(closed_mapper,SIGNAL(mapped(int)), this,SLOT(connectionClosedData(int))); for(int i=0;i<2;i++) { - switch(sas_porttype[i]) { - case RDMatrix::TtyPort: - tty=new RDTty(rda->station()->name(),sas_port[i]); - sas_device[i]=new RDTTYDevice(); - if(tty->active()) { - sas_device[i]->setName(tty->port()); - sas_device[i]->setSpeed(tty->baudRate()); - sas_device[i]->setWordLength(tty->dataBits()); - sas_device[i]->setParity(tty->parity()); - sas_device[i]->open(QIODevice::Unbuffered|QIODevice::ReadWrite); - } - delete tty; - - case RDMatrix::TcpPort: - sas_socket[i]=new Q3Socket(this,"sas_socket"); - connected_mapper->setMapping(sas_socket[i],i); - connect(sas_socket[i],SIGNAL(connected()), - connected_mapper,SLOT(map())); - closed_mapper->setMapping(sas_socket[i],i); - connect(sas_socket[i],SIGNAL(connectionClosed()), - closed_mapper,SLOT(map())); - switch(i) { - case 0: - connect(sas_socket[i],SIGNAL(error(int)), - this,SLOT(error0Data(int))); - break; - - case 1: - connect(sas_socket[i],SIGNAL(error(int)), - this,SLOT(error1Data(int))); - break; - } - ipConnect(i); - break; - - case RDMatrix::NoPort: - break; + switch(sas_porttype[i]) { + case RDMatrix::TtyPort: + tty=new RDTty(rda->station()->name(),sas_port[i]); + sas_device[i]=new RDTTYDevice(); + if(tty->active()) { + sas_device[i]->setName(tty->port()); + sas_device[i]->setSpeed(tty->baudRate()); + sas_device[i]->setWordLength(tty->dataBits()); + sas_device[i]->setParity(tty->parity()); + sas_device[i]->open(QIODevice::Unbuffered| + QIODevice::WriteOnly); } + delete tty; + + case RDMatrix::TcpPort: + sas_socket[i]=new QTcpSocket(this); + connected_mapper->setMapping(sas_socket[i],i); + connect(sas_socket[i],SIGNAL(connected()), + connected_mapper,SLOT(map())); + closed_mapper->setMapping(sas_socket[i],i); + connect(sas_socket[i],SIGNAL(disconnected()), + closed_mapper,SLOT(map())); + switch(i) { + case 0: + connect(sas_socket[i],SIGNAL(error(QAbstractSocket::SocketError)), + this,SLOT(error0Data(QAbstractSocket::SocketError))); + break; + + case 1: + connect(sas_socket[i],SIGNAL(error(QAbstractSocket::SocketError)), + this,SLOT(error1Data(QAbstractSocket::SocketError))); + break; + } + ipConnect(i); + break; + + case RDMatrix::NoPort: + break; + } } } @@ -209,41 +210,42 @@ void Quartz1::connectionClosedData(int conn) } -void Quartz1::errorData(int conn,int err) +void Quartz1::errorData(int conn,QAbstractSocket::SocketError err) { - switch((Q3Socket::Error)err) { - case Q3Socket::ErrConnectionRefused: - rda->syslog(LOG_WARNING, + switch(err) { + case QAbstractSocket::ConnectionRefusedError: + rda->syslog(LOG_WARNING, "connection to Quartz1 device at %s:%d refused, attempting reconnect", - (const char *)sas_ipaddress[conn].toString().toUtf8(), - sas_ipport[conn]); - sas_reconnect_timer[conn]->start(QUARTZ1_RECONNECT_INTERVAL,true); - break; + (const char *)sas_ipaddress[conn].toString().toUtf8(), + sas_ipport[conn]); + sas_reconnect_timer[conn]->start(QUARTZ1_RECONNECT_INTERVAL,true); + break; - case Q3Socket::ErrHostNotFound: - rda->syslog(LOG_WARNING, + case QAbstractSocket::HostNotFoundError: + rda->syslog(LOG_WARNING, "error on connection to Quartz1 device at %s:%d: Host Not Found", - (const char *)sas_ipaddress[conn].toString().toUtf8(), - sas_ipport[conn]); - break; + (const char *)sas_ipaddress[conn].toString().toUtf8(), + sas_ipport[conn]); + break; - case Q3Socket::ErrSocketRead: - rda->syslog(LOG_WARNING, - "error on connection to Quartz1 device at %s:%d: Socket Read Error", - (const char *)sas_ipaddress[conn].toString().toUtf8(), - sas_ipport[conn]); - break; + default: + rda->syslog(LOG_WARNING, + "error %d on connection to Quartz1 device at %s:%d", + err, + (const char *)sas_ipaddress[conn].toString().toUtf8(), + sas_ipport[conn]); + break; } } -void Quartz1::error0Data(int err) +void Quartz1::error0Data(QAbstractSocket::SocketError err) { errorData(0,err); } -void Quartz1::error1Data(int err) +void Quartz1::error1Data(QAbstractSocket::SocketError err) { errorData(1,err); } diff --git a/ripcd/quartz1.h b/ripcd/quartz1.h index 3c238939..b79c0cec 100644 --- a/ripcd/quartz1.h +++ b/ripcd/quartz1.h @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the Quartz Type 1 Switcher Protocol // -// (C) Copyright 2002-2004,2008,2016 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -21,8 +21,8 @@ #ifndef QUARTZ1_H #define QUARTZ1_H -#include #include +#include #include #include @@ -51,14 +51,14 @@ class Quartz1 : public Switcher void ipConnect(int conn); void connectedData(int conn); void connectionClosedData(int conn); - void errorData(int conn,int err); - void error0Data(int err); - void error1Data(int err); + void errorData(int conn,QAbstractSocket::SocketError err); + void error0Data(QAbstractSocket::SocketError err); + void error1Data(QAbstractSocket::SocketError err); private: void SendCommand(const char *str); RDTTYDevice *sas_device[2]; - Q3Socket *sas_socket[2]; + QTcpSocket *sas_socket[2]; char sas_buffer[2][QUARTZ1_MAX_LENGTH]; unsigned sas_ptr[2]; QHostAddress sas_ipaddress[2]; diff --git a/ripcd/ripcd.cpp b/ripcd/ripcd.cpp index 192ff856..feedd86a 100644 --- a/ripcd/ripcd.cpp +++ b/ripcd/ripcd.cpp @@ -2,7 +2,7 @@ // // Rivendell Interprocess Communication Daemon // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -125,6 +125,13 @@ MainObject::MainObject(QObject *parent) connect(ripc_macro_timer[i],SIGNAL(timeout()),mapper,SLOT(map())); } + // + // TTY Ready Read Mapper + // + ripcd_tty_ready_read_mapper=new QSignalMapper(this); + connect(ripcd_tty_ready_read_mapper,SIGNAL(mapped(int)), + this,SLOT(ttyReadyReadData(int))); + ripcd_host_addr=rda->station()->address(); // diff --git a/ripcd/ripcd.h b/ripcd/ripcd.h index 3ad2324e..a79cd1db 100644 --- a/ripcd/ripcd.h +++ b/ripcd/ripcd.h @@ -2,7 +2,7 @@ // // Rivendell Interprocess Communication Daemon // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -55,7 +55,6 @@ // #define RIPCD_MAX_LENGTH 256 #define RIPCD_RML_READ_INTERVAL 100 -#define RIPCD_TTY_READ_INTERVAL 100 #define RIPCD_USAGE "[-d]\n\nSupplying the '-d' flag will set 'debug' mode, causing ripcd(8) to stay\nin the foreground and print debugging info on standard output.\n" class MainObject : public QObject @@ -77,7 +76,7 @@ class MainObject : public QObject void gpiStateData(int matrix,unsigned line,bool state); void gpoStateData(int matrix,unsigned line,bool state); void ttyTrapData(int cartnum); - void ttyScanData(); + void ttyReadyReadData(int num); void macroTimerData(int num); void readyReadData(int conn_id); void killData(int conn_id); @@ -130,6 +129,7 @@ class MainObject : public QObject bool ripcd_tty_inuse[MAX_TTYS]; int ripcd_switcher_tty[MAX_MATRICES][2]; RDTTYDevice *ripcd_tty_dev[MAX_TTYS]; + QSignalMapper *ripcd_tty_ready_read_mapper; RDTty::Termination ripcd_tty_term[MAX_TTYS]; RDCodeTrap *ripcd_tty_trap[MAX_TTYS]; bool ripc_onair_flag; diff --git a/ripcd/rossnkscp.cpp b/ripcd/rossnkscp.cpp index 698bae8c..a82ac549 100644 --- a/ripcd/rossnkscp.cpp +++ b/ripcd/rossnkscp.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the Ross NK switchers via the SCP/A // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -46,7 +46,7 @@ RossNkScp::RossNkScp(RDMatrix *matrix,QObject *parent) ross_device->setSpeed(tty->baudRate()); ross_device->setWordLength(tty->dataBits()); ross_device->setParity(tty->parity()); - ross_device->open(QIODevice::Unbuffered|QIODevice::ReadWrite); + ross_device->open(QIODevice::Unbuffered|QIODevice::WriteOnly); } delete tty; } diff --git a/ripcd/sas16000.cpp b/ripcd/sas16000.cpp index be41c667..9843352d 100644 --- a/ripcd/sas16000.cpp +++ b/ripcd/sas16000.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the SAS USI Protocol (2 digit) // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -52,7 +52,7 @@ Sas16000::Sas16000(RDMatrix *matrix,QObject *parent) sas_device->setSpeed(tty->baudRate()); sas_device->setWordLength(tty->dataBits()); sas_device->setParity(tty->parity()); - sas_device->open(QIODevice::Unbuffered|QIODevice::ReadWrite); + sas_device->open(QIODevice::Unbuffered|QIODevice::WriteOnly); } delete tty; } @@ -117,8 +117,8 @@ void Sas16000::processCommand(RDMacro *cmd) void Sas16000::SendCommand(char *str) { - rda->syslog(LOG_INFO,"sending USI cmd: %s", - (const char *)PrettifyCommand(str)); + rda->syslog(LOG_DEBUG,"sending USI cmd: %s", + PrettifyCommand(str).toUtf8().constData()); sas_device->write(str,strlen(str)); } diff --git a/ripcd/sas16000.h b/ripcd/sas16000.h index 5a2518e8..ea40d3ea 100644 --- a/ripcd/sas16000.h +++ b/ripcd/sas16000.h @@ -23,7 +23,6 @@ #include -#include #include #include diff --git a/ripcd/sas32000.cpp b/ripcd/sas32000.cpp index 7218a41d..45ced9d7 100644 --- a/ripcd/sas32000.cpp +++ b/ripcd/sas32000.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the SAS32000 // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -44,14 +44,14 @@ Sas32000::Sas32000(RDMatrix *matrix,QObject *parent) sas_device->setSpeed(tty->baudRate()); sas_device->setWordLength(tty->dataBits()); sas_device->setParity(tty->parity()); - sas_device->open(QIODevice::Unbuffered|QIODevice::ReadWrite); + sas_device->open(QIODevice::Unbuffered|QIODevice::WriteOnly); } delete tty; // // Queue Timer // - sas_timer=new QTimer(this,"sas_timer"); + sas_timer=new QTimer(this); connect(sas_timer,SIGNAL(timeout()),this,SLOT(runQueue())); } diff --git a/ripcd/sas64000.cpp b/ripcd/sas64000.cpp index 0b1c6b43..aa5e6a5c 100644 --- a/ripcd/sas64000.cpp +++ b/ripcd/sas64000.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the SAS64000 // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -44,7 +44,7 @@ Sas64000::Sas64000(RDMatrix *matrix,QObject *parent) sas_device->setSpeed(tty->baudRate()); sas_device->setWordLength(tty->dataBits()); sas_device->setParity(tty->parity()); - sas_device->open(QIODevice::Unbuffered|QIODevice::ReadWrite); + sas_device->open(QIODevice::Unbuffered|QIODevice::WriteOnly); } delete tty; } diff --git a/ripcd/sas64000gpi.cpp b/ripcd/sas64000gpi.cpp index d2408f20..c563209a 100644 --- a/ripcd/sas64000gpi.cpp +++ b/ripcd/sas64000gpi.cpp @@ -1,9 +1,8 @@ // sas64000gpi.cpp // -// A Rivendell switcher driver for the SAS64000 connected via -// a GPI-1600 +// A Rivendell switcher driver for the SAS64000 connected via a GPI-1600 // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -48,7 +47,7 @@ Sas64000Gpi::Sas64000Gpi(RDMatrix *matrix,QObject *parent) sas_device->setSpeed(tty->baudRate()); sas_device->setWordLength(tty->dataBits()); sas_device->setParity(tty->parity()); - sas_device->open(QIODevice::Unbuffered|QIODevice::ReadWrite); + sas_device->open(QIODevice::Unbuffered|QIODevice::WriteOnly); } delete tty; diff --git a/ripcd/sas64000gpi.h b/ripcd/sas64000gpi.h index 797898a7..d9db61aa 100644 --- a/ripcd/sas64000gpi.h +++ b/ripcd/sas64000gpi.h @@ -1,9 +1,8 @@ // sas64000gpi.h // -// A Rivendell switcher driver for the SAS64000 connected via -// a GPI-1600 +// A Rivendell switcher driver for the SAS64000 connected via a GPI-1600 // -// (C) Copyright 2002-2004,2016 Fred Gleason +// (C) Copyright 2002-2020 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 diff --git a/ripcd/sasusi.cpp b/ripcd/sasusi.cpp index ba4e28a7..cd48a9cb 100644 --- a/ripcd/sasusi.cpp +++ b/ripcd/sasusi.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the SAS USI Protocol // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -88,18 +88,19 @@ SasUsi::SasUsi(RDMatrix *matrix,QObject *parent) sas_device->setSpeed(tty->baudRate()); sas_device->setWordLength(tty->dataBits()); sas_device->setParity(tty->parity()); - sas_device->open(QIODevice::Unbuffered|QIODevice::ReadWrite); + sas_device->open(QIODevice::Unbuffered|QIODevice::WriteOnly); } delete tty; case RDMatrix::TcpPort: - sas_socket=new Q3Socket(this); + sas_socket=new QTcpSocket(this); connect(sas_socket,SIGNAL(connected()),this,SLOT(connectedData())); - connect(sas_socket,SIGNAL(connectionClosed()), + connect(sas_socket,SIGNAL(disconnected()), this,SLOT(connectionClosedData())); connect(sas_socket,SIGNAL(readyRead()), this,SLOT(readyReadData())); - connect(sas_socket,SIGNAL(error(int)),this,SLOT(errorData(int))); + connect(sas_socket,SIGNAL(error(QAbstractSocket::SocketError)), + this,SLOT(errorData(Q))); ipConnect(); break; @@ -388,30 +389,30 @@ void SasUsi::readyReadData() } -void SasUsi::errorData(int err) +void SasUsi::errorData(QAbstractSocket::SocketError err) { - switch((Q3Socket::Error)err) { - case Q3Socket::ErrConnectionRefused: - rda->syslog(LOG_WARNING, - "connection to SasUsi device at %s:%d refused, attempting reconnect", - (const char *)sas_ipaddress.toString().toUtf8(), - sas_ipport); - sas_reconnect_timer->start(SASUSI_RECONNECT_INTERVAL,true); - break; + switch(err) { + case QAbstractSocket::ConnectionRefusedError: + rda->syslog(LOG_WARNING, + "connection to SasUsi device at %s:%d refused, attempting reconnect", + (const char *)sas_ipaddress.toString().toUtf8(), + sas_ipport); + sas_reconnect_timer->start(SASUSI_RECONNECT_INTERVAL,true); + break; - case Q3Socket::ErrHostNotFound: - rda->syslog(LOG_WARNING, - "error on connection to SasUsi device at %s:%d: Host Not Found", - (const char *)sas_ipaddress.toString().toUtf8(), - sas_ipport); - break; + case QAbstractSocket::HostNotFoundError: + rda->syslog(LOG_WARNING, + "error on connection to SasUsi device at %s:%d: Host Not Found", + (const char *)sas_ipaddress.toString().toUtf8(), + sas_ipport); + break; - case Q3Socket::ErrSocketRead: - rda->syslog(LOG_WARNING, - "error on connection to SasUsi device at %s:%d: Socket Read Error", - (const char *)sas_ipaddress.toString().toUtf8(), - sas_ipport); - break; + default: + rda->syslog(LOG_WARNING, + "received network error %d on connection to SasUsi device at %s:%d", + (const char *)sas_ipaddress.toString().toUtf8(), + sas_ipport); + break; } } diff --git a/ripcd/sasusi.h b/ripcd/sasusi.h index 86f8243c..a544cba5 100644 --- a/ripcd/sasusi.h +++ b/ripcd/sasusi.h @@ -23,8 +23,9 @@ #include -#include +//#include #include +#include #include #include @@ -54,7 +55,7 @@ class SasUsi : public Switcher void connectedData(); void connectionClosedData(); void readyReadData(); - void errorData(int err); + void errorData(QAbstractSocket::SocketError err); private: void SendCommand(char *str); @@ -62,7 +63,8 @@ class SasUsi : public Switcher void ExecuteMacroCart(unsigned cartnum); QString PrettifyCommand(const char *cmd) const; RDTTYDevice *sas_device; - Q3Socket *sas_socket; + QTcpSocket *sas_socket; + // Q3Socket *sas_socket; char sas_buffer[SASUSI_MAX_LENGTH]; unsigned sas_ptr; QHostAddress sas_ipaddress; diff --git a/ripcd/starguide3.cpp b/ripcd/starguide3.cpp index 7ab1332d..17f3bd97 100644 --- a/ripcd/starguide3.cpp +++ b/ripcd/starguide3.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the StarGuide III Satellite Receiver // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -73,7 +73,7 @@ StarGuide3::StarGuide3(RDMatrix *matrix,QObject *parent) sg_device->setSpeed(tty->baudRate()); sg_device->setWordLength(tty->dataBits()); sg_device->setParity(tty->parity()); - sg_device->open(QIODevice::Unbuffered|QIODevice::ReadWrite); + sg_device->open(QIODevice::Unbuffered|QIODevice::WriteOnly); } delete tty; } diff --git a/ripcd/swauthority.cpp b/ripcd/swauthority.cpp index 28692ac8..8c1b0bf4 100644 --- a/ripcd/swauthority.cpp +++ b/ripcd/swauthority.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for systems using Software Authority Protocol // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -61,13 +61,14 @@ SoftwareAuthority::SoftwareAuthority(RDMatrix *matrix,QObject *parent) // // Initialize the connection // - swa_socket=new Q3Socket(this); + swa_socket=new QTcpSocket(this); connect(swa_socket,SIGNAL(connected()),this,SLOT(connectedData())); connect(swa_socket,SIGNAL(connectionClosed()), this,SLOT(connectionClosedData())); connect(swa_socket,SIGNAL(readyRead()), this,SLOT(readyReadData())); - connect(swa_socket,SIGNAL(error(int)),this,SLOT(errorData(int))); + connect(swa_socket,SIGNAL(error(QAbstractSocket::SocketError)), + this,SLOT(errorData(QAbstractSocket::SocketError))); ipConnect(); } @@ -203,30 +204,31 @@ void SoftwareAuthority::readyReadData() } -void SoftwareAuthority::errorData(int err) +void SoftwareAuthority::errorData(QAbstractSocket::SocketError err) { - switch((Q3Socket::Error)err) { - case Q3Socket::ErrConnectionRefused: - rda->syslog(LOG_WARNING, - "connection to SoftwareAuthority device at %s:%d refused, attempting reconnect", - (const char *)swa_ipaddress.toString().toUtf8(), - swa_ipport); - swa_reconnect_timer->start(SWAUTHORITY_RECONNECT_INTERVAL,true); - break; + switch(err) { + case QAbstractSocket::ConnectionRefusedError: + rda->syslog(LOG_WARNING, + "connection to SoftwareAuthority device at %s:%d refused, attempting reconnect", + (const char *)swa_ipaddress.toString().toUtf8(), + swa_ipport); + swa_reconnect_timer->start(SWAUTHORITY_RECONNECT_INTERVAL,true); + break; - case Q3Socket::ErrHostNotFound: - rda->syslog(LOG_WARNING, - "error on connection to SoftwareAuthority device at %s:%d: Host Not Found", - (const char *)swa_ipaddress.toString().toUtf8(), - swa_ipport); - break; + case QAbstractSocket::HostNotFoundError: + rda->syslog(LOG_WARNING, + "error on connection to SoftwareAuthority device at %s:%d: Host Not Found", + (const char *)swa_ipaddress.toString().toUtf8(), + swa_ipport); + break; - case Q3Socket::ErrSocketRead: - rda->syslog(LOG_WARNING, - "error on connection to SoftwareAuthority device at %s:%d: Socket Read Error", - (const char *)swa_ipaddress.toString().toUtf8(), - swa_ipport); - break; + default: + rda->syslog(LOG_WARNING, + "error %d on connection to SoftwareAuthority device at %s:%d", + err, + (const char *)swa_ipaddress.toString().toUtf8(), + swa_ipport); + break; } } diff --git a/ripcd/swauthority.h b/ripcd/swauthority.h index 6bb9536e..1b14ce26 100644 --- a/ripcd/swauthority.h +++ b/ripcd/swauthority.h @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for systems using Software Authority Protocol // -// (C) Copyright 2002-2016 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -24,8 +24,8 @@ #include #include -#include #include +#include #include #include @@ -54,7 +54,7 @@ class SoftwareAuthority : public Switcher void connectedData(); void connectionClosedData(); void readyReadData(); - void errorData(int err); + void errorData(QAbstractSocket::SocketError err); private: void SendCommand(const char *str); @@ -62,7 +62,7 @@ class SoftwareAuthority : public Switcher void ExecuteMacroCart(unsigned cartnum); QString PrettifyCommand(const char *cmd) const; QString BundleString(int offset,bool state); - Q3Socket *swa_socket; + QTcpSocket *swa_socket; char swa_buffer[SWAUTHORITY_MAX_LENGTH]; unsigned swa_ptr; QHostAddress swa_ipaddress; diff --git a/ripcd/unity4000.cpp b/ripcd/unity4000.cpp index 299d7271..136ce8bc 100644 --- a/ripcd/unity4000.cpp +++ b/ripcd/unity4000.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for the UNITY4000 // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -72,7 +72,7 @@ Unity4000::Unity4000(RDMatrix *matrix,QObject *parent) unity_device->setSpeed(tty->baudRate()); unity_device->setWordLength(tty->dataBits()); unity_device->setParity(tty->parity()); - unity_device->open(QIODevice::Unbuffered|QIODevice::ReadWrite); + unity_device->open(QIODevice::Unbuffered|QIODevice::WriteOnly); } delete tty; } diff --git a/ripcd/vguest.cpp b/ripcd/vguest.cpp index 8334df39..e5291a72 100644 --- a/ripcd/vguest.cpp +++ b/ripcd/vguest.cpp @@ -235,7 +235,7 @@ VGuest::VGuest(RDMatrix *matrix,QObject *parent) vguest_device[i]->setSpeed(tty->baudRate()); vguest_device[i]->setWordLength(tty->dataBits()); vguest_device[i]->setParity(tty->parity()); - vguest_device[i]->open(QIODevice::Unbuffered|QIODevice::ReadWrite); + vguest_device[i]->open(QIODevice::Unbuffered|QIODevice::WriteOnly); } delete tty; } @@ -248,8 +248,9 @@ VGuest::VGuest(RDMatrix *matrix,QObject *parent) this,SLOT(connectionClosedData(int))); connect(vguest_socket[i],SIGNAL(readyReadID(int)), this,SLOT(readyReadData(int))); - connect(vguest_socket[i],SIGNAL(errorID(int,int)), - this,SLOT(errorData(int,int))); + connect(vguest_socket[i], + SIGNAL(errorID(QAbstractSocket::SocketError,int)), + this,SLOT(errorData(QAbstractSocket::SocketError,int))); ipConnect(i); } } @@ -533,42 +534,43 @@ void VGuest::readyReadData(int id) } -void VGuest::errorData(int err,int id) +void VGuest::errorData(QAbstractSocket::SocketError err,int id) { int interval=VGUEST_RECONNECT_MIN_INTERVAL; - switch((Q3Socket::Error)err) { - case Q3Socket::ErrConnectionRefused: - interval=GetHoldoff(); - if(!vguest_error_notified[id]) { - rda->syslog(LOG_WARNING, + switch(err) { + case QAbstractSocket::ConnectionRefusedError: + interval=GetHoldoff(); + if(!vguest_error_notified[id]) { + rda->syslog(LOG_WARNING, "connection to vGuest device at %s:%d refused, attempting reconnect", - (const char *)vguest_ipaddress[id].toString().toUtf8(), - vguest_ipport[id]); - vguest_error_notified[id]=true; - } - vguest_reconnect_timer[id]->start(interval,true); - break; + (const char *)vguest_ipaddress[id].toString().toUtf8(), + vguest_ipport[id]); + vguest_error_notified[id]=true; + } + vguest_reconnect_timer[id]->start(interval,true); + break; - case Q3Socket::ErrHostNotFound: - if(!vguest_error_notified[id]) { - rda->syslog(LOG_WARNING, + case QAbstractSocket::HostNotFoundError: + if(!vguest_error_notified[id]) { + rda->syslog(LOG_WARNING, "error on connection to vGuest device at %s:%d: Host Not Found", - (const char *)vguest_ipaddress[id].toString().toUtf8(), - vguest_ipport[id]); - vguest_error_notified[id]=true; - } - break; + (const char *)vguest_ipaddress[id].toString().toUtf8(), + vguest_ipport[id]); + vguest_error_notified[id]=true; + } + break; - case Q3Socket::ErrSocketRead: - if(!vguest_error_notified[id]) { - rda->syslog(LOG_WARNING, - "error on connection to vGuest device at %s:%d: Socket Read Error", - (const char *)vguest_ipaddress[id].toString().toUtf8(), - vguest_ipport[id]); - vguest_error_notified[id]=true; - } - break; + default: + if(!vguest_error_notified[id]) { + rda->syslog(LOG_WARNING, + "error %d on connection to vGuest device at %s:%d: Socket Read Error", + err, + (const char *)vguest_ipaddress[id].toString().toUtf8(), + vguest_ipport[id]); + vguest_error_notified[id]=true; + } + break; } } @@ -594,7 +596,6 @@ void VGuest::pingData(int id) void VGuest::pingResponseData(int id) { - vguest_socket[id]->clearPendingData(); vguest_socket[id]->close(); rda->syslog(LOG_WARNING,"vGuest connection to "+ vguest_ipaddress[id].toString()+ diff --git a/ripcd/vguest.h b/ripcd/vguest.h index f26d645c..716f6fae 100644 --- a/ripcd/vguest.h +++ b/ripcd/vguest.h @@ -62,7 +62,7 @@ class VGuest : public Switcher void connectedData(int id); void connectionClosedData(int id); void readyReadData(int id); - void errorData(int err,int id); + void errorData(QAbstractSocket::SocketError err,int id); void gpioOneshotData(int value); void pingData(int id); void pingResponseData(int id); diff --git a/ripcd/wheatnet_lio.cpp b/ripcd/wheatnet_lio.cpp index aa00c44a..6af6c595 100644 --- a/ripcd/wheatnet_lio.cpp +++ b/ripcd/wheatnet_lio.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for WheatNet LIO // -// (C) Copyright 2017-2019 Fred Gleason +// (C) Copyright 2017-2020 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 @@ -34,10 +34,11 @@ WheatnetLio::WheatnetLio(RDMatrix *matrix,QObject *parent) lio_ip_port=matrix->ipPort(RDMatrix::Primary); lio_card=matrix->card(); - lio_socket=new Q3Socket(this); + lio_socket=new QTcpSocket(this); connect(lio_socket,SIGNAL(connected()),this,SLOT(connectedData())); connect(lio_socket,SIGNAL(readyRead()),this,SLOT(readyReadData())); - connect(lio_socket,SIGNAL(error(int)),this,SLOT(errorData(int))); + connect(lio_socket,SIGNAL(error(QAbstractSocket::SocketError)), + this,SLOT(errorData(QAbstractSocket::SocketError))); lio_socket->connectToHost(lio_ip_address.toString(),lio_ip_port); lio_poll_timer=new QTimer(this); @@ -204,7 +205,7 @@ void WheatnetLio::readyReadData() } -void WheatnetLio::errorData(int err) +void WheatnetLio::errorData(QAbstractSocket::SocketError err) { watchdogData(); } diff --git a/ripcd/wheatnet_lio.h b/ripcd/wheatnet_lio.h index f71531d6..bb17ee5a 100644 --- a/ripcd/wheatnet_lio.h +++ b/ripcd/wheatnet_lio.h @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for Wheatnet LIO devices // -// (C) Copyright 2017 Fred Gleason +// (C) Copyright 2017-2020 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 @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include @@ -52,7 +52,7 @@ class WheatnetLio : public Switcher private slots: void connectedData(); void readyReadData(); - void errorData(int err); + void errorData(QAbstractSocket::SocketError err); void resetStateData(int line); void pollData(); void watchdogData(); @@ -63,7 +63,7 @@ class WheatnetLio : public Switcher void ProcessLioevent(int chan,QString &cmd); void ProcessCommand(const QString &cmd); void SendCommand(const QString &cmd); - Q3Socket *lio_socket; + QTcpSocket *lio_socket; QTimer *lio_watchdog_timer; bool lio_watchdog_active; QHostAddress lio_ip_address; diff --git a/ripcd/wheatnet_slio.cpp b/ripcd/wheatnet_slio.cpp index 87589a57..c779e207 100644 --- a/ripcd/wheatnet_slio.cpp +++ b/ripcd/wheatnet_slio.cpp @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for WheatNet SLIO // -// (C) Copyright 2017-2019 Fred Gleason +// (C) Copyright 2017-2020 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 @@ -33,10 +33,11 @@ WheatnetSlio::WheatnetSlio(RDMatrix *matrix,QObject *parent) slio_ip_address=matrix->ipAddress(RDMatrix::Primary); slio_ip_port=matrix->ipPort(RDMatrix::Primary); - slio_socket=new Q3Socket(this); + slio_socket=new QTcpSocket(this); connect(slio_socket,SIGNAL(connected()),this,SLOT(connectedData())); connect(slio_socket,SIGNAL(readyRead()),this,SLOT(readyReadData())); - connect(slio_socket,SIGNAL(error(int)),this,SLOT(errorData(int))); + connect(slio_socket,SIGNAL(error(QAbstractSocket::SocketError)), + this,SLOT(errorData(QAbstractSocket::SocketError))); slio_socket->connectToHost(slio_ip_address.toString(),slio_ip_port); slio_poll_timer=new QTimer(this); @@ -201,7 +202,7 @@ void WheatnetSlio::readyReadData() } -void WheatnetSlio::errorData(int err) +void WheatnetSlio::errorData(QAbstractSocket::SocketError err) { watchdogData(); } diff --git a/ripcd/wheatnet_slio.h b/ripcd/wheatnet_slio.h index 6dfa6807..97a5e2a9 100644 --- a/ripcd/wheatnet_slio.h +++ b/ripcd/wheatnet_slio.h @@ -2,7 +2,7 @@ // // A Rivendell switcher driver for Wheatnet SLIO devices // -// (C) Copyright 2017 Fred Gleason +// (C) Copyright 2017-2020 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 @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include @@ -52,7 +52,7 @@ class WheatnetSlio : public Switcher private slots: void connectedData(); void readyReadData(); - void errorData(int err); + void errorData(QAbstractSocket::SocketError err); void resetStateData(int line); void pollData(); void watchdogData(); @@ -63,7 +63,7 @@ class WheatnetSlio : public Switcher void ProcessSlioevent(int chan,QString &cmd); void ProcessCommand(const QString &cmd); void SendCommand(const QString &cmd); - Q3Socket *slio_socket; + QTcpSocket *slio_socket; QTimer *slio_watchdog_timer; bool slio_watchdog_active; QHostAddress slio_ip_address; diff --git a/tests/Makefile.am b/tests/Makefile.am index 11624094..18684612 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -39,6 +39,7 @@ noinst_PROGRAMS = audio_convert_test\ getpids_test\ log_unlink_test\ mcast_recv_test\ + metadata_wildcard_test\ notification_test\ rdxml_parse_test\ readcd_test\ @@ -87,6 +88,10 @@ dist_log_unlink_test_SOURCES = log_unlink_test.cpp log_unlink_test.h nodist_log_unlink_test_SOURCES = moc_log_unlink_test.cpp log_unlink_test_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT4_LIBS@ @MUSICBRAINZ_LIBS@ -lQt3Support +dist_metadata_wildcard_test_SOURCES = metadata_wildcard_test.cpp metadata_wildcard_test.h +nodist_metadata_wildcard_test_SOURCES = moc_metadata_wildcard_test.cpp +metadata_wildcard_test_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT4_LIBS@ @MUSICBRAINZ_LIBS@ -lQt3Support + dist_mcast_recv_test_SOURCES = mcast_recv_test.cpp mcast_recv_test.h nodist_mcast_recv_test_SOURCES = moc_mcast_recv_test.cpp mcast_recv_test_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT4_LIBS@ @MUSICBRAINZ_LIBS@ -lQt3Support diff --git a/tests/metadata_wildcard_test.cpp b/tests/metadata_wildcard_test.cpp new file mode 100644 index 00000000..ac8359c4 --- /dev/null +++ b/tests/metadata_wildcard_test.cpp @@ -0,0 +1,99 @@ +// metadata_wildcard_test.cpp +// +// Test the Rivendell multicast receiver routines +// +// (C) Copyright 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 "metadata_wildcard_test.h" + +MainObject::MainObject(QObject *parent) + : QObject(parent) +{ + unsigned cartnum=0; + int cutnum=-1; + QString code; + bool ok=false; + QString err_msg; + + // + // Open the Database + // + rda=new RDApplication("metadata_wildcard_test","metadata_wildcard_test", + METADATA_WILDCARD_TEST_USAGE,this); + if(!rda->open(&err_msg)) { + fprintf(stderr,"metadata_wildcard_test: %s\n",(const char *)err_msg.toUtf8()); + exit(1); + } + for(unsigned i=0;icmdSwitch()->keys();i++) { + if(rda->cmdSwitch()->key(i)=="--cart") { + cartnum=rda->cmdSwitch()->value(i).toUInt(&ok); + if((!ok)||(cartnum==0)||(cartnum>RD_MAX_CART_NUMBER)) { + fprintf(stderr,"metadata_wildcard_test: invalid cart number\n"); + exit(1); + } + rda->cmdSwitch()->setProcessed(i,true); + } + if(rda->cmdSwitch()->key(i)=="--cut") { + cutnum=rda->cmdSwitch()->value(i).toInt(&ok); + if((!ok)||(cutnum<=0)||(cartnum>RD_MAX_CUT_NUMBER)) { + fprintf(stderr,"metadata_wildcard_test: invalid cut number\n"); + exit(1); + } + rda->cmdSwitch()->setProcessed(i,true); + } + if(rda->cmdSwitch()->key(i)=="--code") { + code=rda->cmdSwitch()->value(i); + rda->cmdSwitch()->setProcessed(i,true); + } + if(!rda->cmdSwitch()->processed(i)) { + fprintf(stderr,"metadata_wildcard_test: unknown option \"%s\"\n", + (const char *)rda->cmdSwitch()->value(i)); + exit(256); + } + } + if(cartnum==0) { + fprintf(stderr,"metadata_wildcard_test: you must provide a --cart\n"); + exit(1); + } + if(code.isEmpty()) { + fprintf(stderr,"metadata_wildcard_test: you must provide a --code\n"); + exit(1); + } + + printf("Result: %s\n", + (const char *)RDLogLine::resolveWildcards(cartnum,code,cutnum).toUtf8()); + + exit(0); +} + + +int main(int argc,char *argv[]) +{ + QApplication a(argc,argv,false); + new MainObject(); + return a.exec(); +} diff --git a/tests/metadata_wildcard_test.h b/tests/metadata_wildcard_test.h new file mode 100644 index 00000000..eddae108 --- /dev/null +++ b/tests/metadata_wildcard_test.h @@ -0,0 +1,38 @@ +// metadata_wildcard_test.h +// +// Test the Rivendell multicast receiver routines +// +// (C) Copyright 2018-2020 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 METADATA_WILDCARD_TEST_H +#define METADATA_WILDCARD_TEST_H + +#include + +#include + +#define METADATA_WILDCARD_TEST_USAGE "[options]\n\nTest the Rivendell metadata wildcard routines\n\nOptions are:\n--cart=\n Cart number.\n\n--cut=\n Cut number [optional].\n\n--code=\n Encoded string to resolve.\n" + +class MainObject : public QObject +{ + Q_OBJECT; + public: + MainObject(QObject *parent=0); +}; + + +#endif // METADATA_WILDCARD_TEST_H diff --git a/utils/rddbconfig/mysql_login.cpp b/utils/rddbconfig/mysql_login.cpp index ca1f204b..b361a3f0 100644 --- a/utils/rddbconfig/mysql_login.cpp +++ b/utils/rddbconfig/mysql_login.cpp @@ -2,7 +2,7 @@ // // mySQL Administrative Login widget for RDDbConfig // -// (C) Copyright 2002-2019 Fred Gleason +// (C) Copyright 2002-2020 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 @@ -18,10 +18,9 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // +#include #include -#include - #include "mysql_login.h" MySqlLogin::MySqlLogin(QString *username,QString *password, QWidget *parent) @@ -35,7 +34,7 @@ MySqlLogin::MySqlLogin(QString *username,QString *password, QWidget *parent) // // Message Label // - RDLabel *label=new RDLabel(tr("Enter your MySQL administrator username and password\nThe Hostname and Database are found in /etc/rd.conf"),this); + QLabel *label=new QLabel(tr("Enter your MySQL administrator username and password\nThe Hostname and Database are found in /etc/rd.conf"),this); label->setFont(labelFont()); label->setGeometry(10,10,sizeHint().width()-20,30); label->setAlignment(Qt::AlignCenter); diff --git a/utils/rddbconfig/rddbconfig.cpp b/utils/rddbconfig/rddbconfig.cpp index 28633bb7..317e08f2 100644 --- a/utils/rddbconfig/rddbconfig.cpp +++ b/utils/rddbconfig/rddbconfig.cpp @@ -25,12 +25,13 @@ #include #include -#include +#include #include -#include +#include #include #include +#include #include #include @@ -298,9 +299,10 @@ void MainWidget::backupData() (const char *)rd_config->mysqlDbname())); return; } - - filename=Q3FileDialog::getSaveFileName("rivendell.sql", - "MySQL (*.sql)",this,"open file dialog","Enter the MySQL Backup Filename"); + filename=QFileDialog::getSaveFileName(this,"RDDbConfig - "+ + tr("Enter the MySQL Backup Filename"), + RDHomeDir(), + "MySQL files (*.sql);;All files (*.*)"); if (!filename.isEmpty()) { QProcess backupProcess(this); @@ -340,10 +342,11 @@ void MainWidget::restoreData() tr("Could not open Rivendell database.")); return; } - - filename=Q3FileDialog::getOpenFileName("", - "MySQL (*.sql);;All Files(*)",this,"open file dialog", - "Choose the MySQL Backup File to Restore"); + filename= + QFileDialog::getOpenFileName(this,"RDDbConfig - "+ + tr("Choose the MySQL Backup File to Restore"), + RDHomeDir(), + "MySQL files (*.sql);;All files (*.*)"); if(!filename.isEmpty()) { if (QMessageBox::question(this,tr("Restore Entire Database"),tr("Are you sure you want to restore your entire Rivendell database?"),(QMessageBox::No|QMessageBox::Yes)) != QMessageBox::Yes) { diff --git a/utils/rddbmgr/check.cpp b/utils/rddbmgr/check.cpp index e67c0e23..bed3c601 100644 --- a/utils/rddbmgr/check.cpp +++ b/utils/rddbmgr/check.cpp @@ -41,6 +41,9 @@ #include "rddbmgr.h" +#define RDDBMGR_CHARSET_STRING "pRiKaZiDatFoO" +#define RDDBMGR_COLLATION_STRING "pRiKaZiDatBaR" + bool MainObject::Check(QString *err_msg) { if(GetCurrentSchema()!=RD_VERSION_DATABASE) { @@ -222,6 +225,7 @@ void MainObject::RewriteTable(const QString &tblname, const QString &new_charset, const QString &new_collation) { + QString err_msg; QProcess *proc=NULL; QStringList args; QString tempdir=RDTempDir(); @@ -229,7 +233,9 @@ void MainObject::RewriteTable(const QString &tblname, return; } QString filename=tempdir+"/table.sql"; - QString temp_filename=tempdir+"/table-temp.sql"; + QString temp1_filename=tempdir+"/table-temp1.sql"; + QString temp2_filename=tempdir+"/table-temp2.sql"; + QString temp3_filename=tempdir+"/table-temp3.sql"; QString out_filename=tempdir+"/table-out.sql"; /* printf("table \"%s\" using: %s\n", @@ -256,28 +262,36 @@ void MainObject::RewriteTable(const QString &tblname, delete proc; // - // Modify COLLATION + // Stage 1 // - args.clear(); - args.push_back("s/"+old_collation+"/"+new_collation+"/g"); - args.push_back(filename); - proc=new QProcess(this); - proc->setStandardOutputFile(temp_filename); - proc->start("sed",args); - proc->waitForFinished(-1); - delete proc; + if(!RewriteFile(filename,old_collation, + temp1_filename,RDDBMGR_COLLATION_STRING, + &err_msg)) { + fprintf(stderr,"rddbmgr: %s\n",err_msg.toUtf8().constData()); + exit(1); + } + if(!RewriteFile(temp1_filename,old_charset, + temp2_filename,RDDBMGR_CHARSET_STRING, + &err_msg)) { + fprintf(stderr,"rddbmgr: %s\n",err_msg.toUtf8().constData()); + exit(1); + } // - // Modify CHARSET + // Stage 2 // - args.clear(); - args.push_back("s/"+old_charset+"/"+new_charset+"/g"); - args.push_back(temp_filename); - proc=new QProcess(this); - proc->setStandardOutputFile(out_filename); - proc->start("sed",args); - proc->waitForFinished(-1); - delete proc; + if(!RewriteFile(temp2_filename,RDDBMGR_COLLATION_STRING, + temp3_filename,new_collation, + &err_msg)) { + fprintf(stderr,"rddbmgr: %s\n",err_msg.toUtf8().constData()); + exit(1); + } + if(!RewriteFile(temp3_filename,RDDBMGR_CHARSET_STRING, + out_filename,new_charset, + &err_msg)) { + fprintf(stderr,"rddbmgr: %s\n",err_msg.toUtf8().constData()); + exit(1); + } // // Push Back Modified Table @@ -293,18 +307,76 @@ void MainObject::RewriteTable(const QString &tblname, proc->setStandardInputFile(out_filename); proc->start("mysql",args); proc->waitForFinished(-1); + if(proc->exitStatus()!=QProcess::NormalExit) { + fprintf(stderr, + "rddbmgr: \"mysql %s\" crashed when rewriting table \"%s\"\n", + args.join(" ").toUtf8().constData(),tblname.toUtf8().constData()); + fprintf(stderr,"rddbmgr: source SQL data in \"%s\"\n", + out_filename.toUtf8().constData()); + exit(1); + } + if(proc->exitCode()!=0) { + fprintf(stderr, + "rddbmgr: \"mysql %s\" returned exit code %d [%s] when rewriting table \"%s\"\n", + args.join(" ").toUtf8().constData(), + proc->exitCode(),proc->readAllStandardError().constData(), + tblname.toUtf8().constData()); + fprintf(stderr,"rddbmgr: source SQL data in \"%s\"\n", + out_filename.toUtf8().constData()); + exit(1); + } delete proc; // // Clean Up // unlink(filename.toUtf8()); - unlink(temp_filename.toUtf8()); + unlink(temp1_filename.toUtf8()); + unlink(temp2_filename.toUtf8()); + unlink(temp3_filename.toUtf8()); unlink(out_filename.toUtf8()); rmdir(tempdir); } +bool MainObject::RewriteFile(const QString &old_filename, + const QString &old_str, + const QString &new_filename, + const QString &new_str, + QString *err_msg) +{ + QStringList args; + QProcess *proc=NULL; + + args.clear(); + args.push_back(QString("s/")+old_str+"/"+new_str+"/g"); + args.push_back(old_filename); + proc=new QProcess(this); + proc->setStandardOutputFile(new_filename); + proc->start("sed",args); + proc->waitForFinished(-1); + if(proc->exitStatus()!=QProcess::NormalExit) { + *err_msg=QString("\"sed ")+args.join(" ")+"\" "+ + "crashed when rewriting file \""+old_filename+"\" "+ + "to \""+new_filename+"\""; + delete proc; + return false; + } + if(proc->exitCode()!=0) { + *err_msg=QString("\"sed ")+args.join(" ")+"\" "+ + "returned exit code "+QString().sprintf("%d",proc->exitCode())+ + "["+QString::fromUtf8(proc->readAllStandardError())+"] "+ + " when rewriting file \""+old_filename+"\" "+ + "to \""+new_filename+"\""; + delete proc; + return false; + } + delete proc; + + return true; +} + + void MainObject::RelinkAudio(const QString &srcdir) const { QString sql; diff --git a/utils/rddbmgr/modify.cpp b/utils/rddbmgr/modify.cpp index d23b4625..a9673338 100644 --- a/utils/rddbmgr/modify.cpp +++ b/utils/rddbmgr/modify.cpp @@ -87,7 +87,7 @@ bool MainObject::ModifyCharset(const QString &charset, while(q->next()) { QStringList f0=q->value(1).toString().split("_"); QString prev_charset=f0.at(0); - if(q->value(1).toString().toLower()!=collation) { + if(q->value(1).toString().toLower()!=charset) { RewriteTable(q->value(0).toString(), prev_charset,q->value(1).toString(),charset,collation); } diff --git a/utils/rddbmgr/rddbmgr.h b/utils/rddbmgr/rddbmgr.h index c469d23e..cd19d473 100644 --- a/utils/rddbmgr/rddbmgr.h +++ b/utils/rddbmgr/rddbmgr.h @@ -2,7 +2,7 @@ // // Rivendell database management utility // -// (C) Copyright 2018 Fred Gleason +// (C) Copyright 2018-2020 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,8 +22,6 @@ #define RDDBMGR_H #include -//Added by qt3to4: -#include #include #include @@ -47,6 +45,9 @@ class MainObject : public QObject const QString &old_collation, const QString &new_charset, const QString &new_collation); + bool RewriteFile(const QString &old_filename,const QString &old_str, + const QString &new_filename,const QString &new_str, + QString *err_msg); void RelinkAudio(const QString &srcdir) const; void CheckOrphanedTracks() const; void CheckCutCounts() const; diff --git a/utils/rddiscimport/rddiscimport.cpp b/utils/rddiscimport/rddiscimport.cpp index 65fd6da4..f3848aff 100644 --- a/utils/rddiscimport/rddiscimport.cpp +++ b/utils/rddiscimport/rddiscimport.cpp @@ -2,7 +2,7 @@ // // A Qt-based application for importing TM Century GoldDisc CDs // -// (C) Copyright 2013-2019 Fred Gleason +// (C) Copyright 2013-2020 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 @@ -18,9 +18,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -#include - #include +#include #include #include @@ -158,14 +157,14 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) dg_disc_label=new QLabel(tr("Disk Progress"),this); dg_disc_label->setFont(labelFont()); dg_disc_label->setDisabled(true); - dg_disc_bar=new Q3ProgressBar(this); + dg_disc_bar=new QProgressBar(this); dg_disc_bar->setDisabled(true); dg_track_label=new QLabel(tr("Track Progress"),this); dg_track_label->setFont(labelFont()); dg_track_label->setDisabled(true); - dg_track_bar=new Q3ProgressBar(this); - dg_track_bar->setTotalSteps(dg_ripper->totalSteps()+1); + dg_track_bar=new QProgressBar(this); + dg_track_bar->setMaximum(dg_ripper->totalSteps()+1); dg_track_bar->setDisabled(true); connect(dg_ripper,SIGNAL(progressChanged(int)), dg_track_bar,SLOT(setProgress(int))); @@ -287,9 +286,10 @@ void MainWidget::indexFileSelectedData() QString filename; int lines; - filename=Q3FileDialog::getOpenFileName(dg_indexfile_edit->text(), - "CSV Files *.csv",this,"", - tr("RDDiscImport - Open Index File")); + filename=QFileDialog::getOpenFileName(this,"RDDiscImport - "+ + tr("Open Index File"), + dg_indexfile_edit->text(), + "CSV files (*.csv);;All files (*.*)"); dg_metalibrary->clear(); if((lines=dg_metalibrary->load(filename))<0) { QMessageBox::warning(this,"RDDiscImport - "+tr("Read Error"), @@ -446,12 +446,12 @@ void MainWidget::ripData() // // Rip and Import // - dg_disc_bar->setTotalSteps(dg_player->tracks()); + dg_disc_bar->setMaximum(dg_player->tracks()); for(int i=0;itracks();i++) { if(dg_rip_enableds[i]) { MetaRecord *r=dg_metalibrary->track(dg_discid_edit->text(),i); if(r!=NULL) { - dg_disc_bar->setProgress(i); + dg_disc_bar->setValue(i); dg_track_label->setText(QString().sprintf("Track %d: ",i+1)+ r->title()+" - "+r->artist()); dg_ripper->rip(i); diff --git a/utils/rddiscimport/rddiscimport.h b/utils/rddiscimport/rddiscimport.h index 8401c477..4827dce6 100644 --- a/utils/rddiscimport/rddiscimport.h +++ b/utils/rddiscimport/rddiscimport.h @@ -2,7 +2,7 @@ // // A Qt-based application for importing TM Century GoldDisc CDs // -// (C) Copyright 2013-2019 Fred Gleason +// (C) Copyright 2013-2020 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 @@ -21,12 +21,12 @@ #ifndef RDDISCIMPORT_H #define RDDISCIMPORT_H -#include #include -#include #include +#include #include +#include #include #include @@ -78,9 +78,9 @@ class MainWidget : public RDWidget QLineEdit *dg_userdef_edit; RDListView *dg_track_list; QLabel *dg_disc_label; - Q3ProgressBar *dg_disc_bar; + QProgressBar *dg_disc_bar; QLabel *dg_track_label; - Q3ProgressBar *dg_track_bar; + QProgressBar *dg_track_bar; QLabel *dg_discid_label; QLineEdit *dg_discid_edit; QPushButton *dg_rip_button; diff --git a/utils/rddiscimport/rddiscimport_de.ts b/utils/rddiscimport/rddiscimport_de.ts index 99147cee..bbbadb5b 100644 --- a/utils/rddiscimport/rddiscimport_de.ts +++ b/utils/rddiscimport/rddiscimport_de.ts @@ -95,10 +95,6 @@ Rip Complete! - - RDDiscImport - Open Index File - - File Read @@ -155,5 +151,9 @@ Unknown command option + + Open Index File + + diff --git a/utils/rddiscimport/rddiscimport_es.ts b/utils/rddiscimport/rddiscimport_es.ts index 99147cee..bbbadb5b 100644 --- a/utils/rddiscimport/rddiscimport_es.ts +++ b/utils/rddiscimport/rddiscimport_es.ts @@ -95,10 +95,6 @@ Rip Complete! - - RDDiscImport - Open Index File - - File Read @@ -155,5 +151,9 @@ Unknown command option + + Open Index File + + diff --git a/utils/rddiscimport/rddiscimport_fr.ts b/utils/rddiscimport/rddiscimport_fr.ts index 99147cee..bbbadb5b 100644 --- a/utils/rddiscimport/rddiscimport_fr.ts +++ b/utils/rddiscimport/rddiscimport_fr.ts @@ -95,10 +95,6 @@ Rip Complete! - - RDDiscImport - Open Index File - - File Read @@ -155,5 +151,9 @@ Unknown command option + + Open Index File + + diff --git a/utils/rddiscimport/rddiscimport_nb.ts b/utils/rddiscimport/rddiscimport_nb.ts index 99147cee..bbbadb5b 100644 --- a/utils/rddiscimport/rddiscimport_nb.ts +++ b/utils/rddiscimport/rddiscimport_nb.ts @@ -95,10 +95,6 @@ Rip Complete! - - RDDiscImport - Open Index File - - File Read @@ -155,5 +151,9 @@ Unknown command option + + Open Index File + + diff --git a/utils/rddiscimport/rddiscimport_nn.ts b/utils/rddiscimport/rddiscimport_nn.ts index 99147cee..bbbadb5b 100644 --- a/utils/rddiscimport/rddiscimport_nn.ts +++ b/utils/rddiscimport/rddiscimport_nn.ts @@ -95,10 +95,6 @@ Rip Complete! - - RDDiscImport - Open Index File - - File Read @@ -155,5 +151,9 @@ Unknown command option + + Open Index File + + diff --git a/utils/rddiscimport/rddiscimport_pt_BR.ts b/utils/rddiscimport/rddiscimport_pt_BR.ts index 99147cee..bbbadb5b 100644 --- a/utils/rddiscimport/rddiscimport_pt_BR.ts +++ b/utils/rddiscimport/rddiscimport_pt_BR.ts @@ -95,10 +95,6 @@ Rip Complete! - - RDDiscImport - Open Index File - - File Read @@ -155,5 +151,9 @@ Unknown command option + + Open Index File + +