mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-12 09:33:37 +02:00
2018-08-07 Fred Gleason <fredg@paravelsystems.com>
* Removed the 'pam_rd' plug-in. * Removed rdchunk(1). * Upgraded Qt3 to Qt4.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
##
|
||||
## Automake.am for rivendell/importers
|
||||
##
|
||||
## (C) Copyright 2002-2006,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
## (C) Copyright 2002-2006,2016-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License version 2 as
|
||||
@@ -20,8 +20,8 @@
|
||||
##
|
||||
## Use automake to process this into a Makefile.in
|
||||
|
||||
AM_CPPFLAGS = -Wall @QT_CXXFLAGS@ -I$(top_srcdir)/lib
|
||||
LIBS = @QT_LIBS@ -L$(top_srcdir)/lib
|
||||
AM_CPPFLAGS = -Wall -I$(top_srcdir)/lib @QT4_CFLAGS@ -DQT3_SUPPORT -I/usr/include/Qt3Support
|
||||
LIBS = -L$(top_srcdir)/lib
|
||||
MOC = @QT_MOC@
|
||||
|
||||
# The dependency for qt's Meta Object Compiler (moc)
|
||||
@@ -37,27 +37,27 @@ bin_PROGRAMS = nexgen_filter\
|
||||
|
||||
dist_nexgen_filter_SOURCES = nexgen_filter.cpp nexgen_filter.h
|
||||
nodist_nexgen_filter_SOURCES = moc_nexgen_filter.cpp
|
||||
nexgen_filter_LDADD = @LIB_RDLIBS@ @LIBVORBIS@
|
||||
nexgen_filter_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT4_LIBS@ -lQt3Support
|
||||
|
||||
dist_panel_copy_SOURCES = panel_copy.cpp panel_copy.h
|
||||
nodist_panel_copy_SOURCES = moc_panel_copy.cpp
|
||||
panel_copy_LDADD = @LIB_RDLIBS@ @LIBVORBIS@
|
||||
panel_copy_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT4_LIBS@ -lQt3Support
|
||||
|
||||
dist_rdcatch_copy_SOURCES = rdcatch_copy.cpp rdcatch_copy.h
|
||||
nodist_rdcatch_copy_SOURCES = moc_rdcatch_copy.cpp
|
||||
rdcatch_copy_LDADD = @LIB_RDLIBS@ @LIBVORBIS@
|
||||
rdcatch_copy_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT4_LIBS@ -lQt3Support
|
||||
|
||||
dist_rivendell_filter_SOURCES = rivendell_filter.cpp rivendell_filter.h
|
||||
nodist_rivendell_filter_SOURCES = moc_rivendell_filter.cpp
|
||||
rivendell_filter_LDADD = @LIB_RDLIBS@ @LIBVORBIS@
|
||||
rivendell_filter_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT4_LIBS@ -lQt3Support
|
||||
|
||||
dist_sas_filter_SOURCES = sas_filter.cpp sas_filter.h
|
||||
nodist_sas_filter_SOURCES = moc_sas_filter.cpp
|
||||
sas_filter_LDADD = @LIB_RDLIBS@ @LIBVORBIS@
|
||||
sas_filter_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT4_LIBS@ -lQt3Support
|
||||
|
||||
dist_wings_filter_SOURCES = wings_filter.cpp wings_filter.h
|
||||
nodist_wings_filter_SOURCES = moc_wings_filter.cpp
|
||||
wings_filter_LDADD = @LIB_RDLIBS@ @LIBVORBIS@
|
||||
wings_filter_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT4_LIBS@ -lQt3Support
|
||||
|
||||
EXTRA_DIST = export_slax
|
||||
|
||||
|
@@ -187,7 +187,7 @@ MainObject::MainObject(QObject *parent)
|
||||
//
|
||||
// Main Loop
|
||||
//
|
||||
for(unsigned i=0;i<xml_files.size();i++) {
|
||||
for(int i=0;i<xml_files.size();i++) {
|
||||
if(IsXmlFile(xml_files[i])) {
|
||||
if(audio_dir.isEmpty()) {
|
||||
fprintf(stderr,"unable to process \"%s\" [no --audio-dir specified]\n",
|
||||
@@ -290,7 +290,7 @@ void MainObject::ProcessArchive(const QString &filename)
|
||||
//
|
||||
// Clean Up
|
||||
//
|
||||
for(unsigned i=0;i<files.size();i++) {
|
||||
for(int i=0;i<files.size();i++) {
|
||||
unlink(files[i]);
|
||||
}
|
||||
rmdir(tempdir);
|
||||
@@ -369,10 +369,14 @@ void MainObject::ProcessXmlFile(const QString &xml,const QString &wavname,
|
||||
if(filter_delete_cuts) {
|
||||
delete_cuts_switch="--delete-cuts ";
|
||||
}
|
||||
if(system(QString().sprintf("rdimport --autotrim-level=0 --normalization-level=%d --to-cart=%d ",
|
||||
filter_normalization_level,cartnum)+
|
||||
+delete_cuts_switch+filter_group->name()+" "+
|
||||
filter_temp_audiofile)!=0) {
|
||||
QString cmd=QString("rdimport ")+
|
||||
"--autotrim-level=0 "+
|
||||
QString().sprintf("--normalization-level=%d ",filter_normalization_level)+
|
||||
QString().sprintf("--to-cart=%d ",cartnum)+
|
||||
delete_cuts_switch+
|
||||
filter_group->name()+" "+
|
||||
filter_temp_audiofile;
|
||||
if(system(cmd.toUtf8())!=0) {
|
||||
Print(QString().sprintf(" aborted.\n"));
|
||||
fprintf(stderr,"import of \"%s\" failed\n",(const char *)filename);
|
||||
WriteReject(xml);
|
||||
|
@@ -41,8 +41,8 @@ MainObject::MainObject(QObject *parent)
|
||||
QString src_station;
|
||||
QString dest_station;
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
RDSqlQuery *q1;
|
||||
QSqlQuery *q;
|
||||
QSqlQuery *q1;
|
||||
|
||||
//
|
||||
// Read Command Options
|
||||
@@ -100,41 +100,31 @@ MainObject::MainObject(QObject *parent)
|
||||
// Open Databases
|
||||
//
|
||||
src_db=QSqlDatabase::addDatabase("QMYSQL3","SRCDB");
|
||||
if(!src_db) {
|
||||
fprintf(stderr,"panel_copy: can't open source mySQL database\n");
|
||||
exit(1);
|
||||
}
|
||||
src_db->setDatabaseName(rd_config->mysqlDbname());
|
||||
src_db->setUserName(rd_config->mysqlUsername());
|
||||
src_db->setPassword(rd_config->mysqlPassword());
|
||||
src_db->setHostName(src_hostname);
|
||||
if(!src_db->open()) {
|
||||
src_db.setDatabaseName(rd_config->mysqlDbname());
|
||||
src_db.setUserName(rd_config->mysqlUsername());
|
||||
src_db.setPassword(rd_config->mysqlPassword());
|
||||
src_db.setHostName(src_hostname);
|
||||
if(!src_db.open()) {
|
||||
fprintf(stderr,"panel_copy: unable to connect to source mySQL server\n");
|
||||
src_db->removeDatabase(rd_config->mysqlDbname());
|
||||
exit(256);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
dest_db=QSqlDatabase::addDatabase("QMYSQL3","DESTDB");
|
||||
if(!dest_db) {
|
||||
fprintf(stderr,"panel_copy: can't open destination mySQL database\n");
|
||||
exit(1);
|
||||
}
|
||||
dest_db->setDatabaseName(rd_config->mysqlDbname());
|
||||
dest_db->setUserName(rd_config->mysqlUsername());
|
||||
dest_db->setPassword(rd_config->mysqlPassword());
|
||||
dest_db->setHostName(dest_hostname);
|
||||
if(!dest_db->open()) {
|
||||
dest_db.setDatabaseName(rd_config->mysqlDbname());
|
||||
dest_db.setUserName(rd_config->mysqlUsername());
|
||||
dest_db.setPassword(rd_config->mysqlPassword());
|
||||
dest_db.setHostName(dest_hostname);
|
||||
if(!dest_db.open()) {
|
||||
fprintf(stderr,
|
||||
"panel_copy: unable to connect to destination mySQL server\n");
|
||||
dest_db->removeDatabase(rd_config->mysqlDbname());
|
||||
exit(256);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
//
|
||||
// Check Database Versions
|
||||
//
|
||||
sql=QString("select DB from VERSION");
|
||||
q=new RDSqlQuery(sql,src_db);
|
||||
q=new QSqlQuery(sql,src_db);
|
||||
if(!q->first()) {
|
||||
fprintf(stderr,"panel_copy: unable to read source database version\n");
|
||||
exit(256);
|
||||
@@ -145,7 +135,7 @@ MainObject::MainObject(QObject *parent)
|
||||
}
|
||||
delete q;
|
||||
|
||||
q=new RDSqlQuery(sql,dest_db);
|
||||
q=new QSqlQuery(sql,dest_db);
|
||||
if(!q->first()) {
|
||||
fprintf(stderr,
|
||||
"panel_copy: unable to read destination database version\n");
|
||||
@@ -173,7 +163,7 @@ MainObject::MainObject(QObject *parent)
|
||||
// Delete current destination entries
|
||||
//
|
||||
sql="delete from PANELS";
|
||||
q=new RDSqlQuery(sql,dest_db);
|
||||
q=new QSqlQuery(sql,dest_db);
|
||||
delete q;
|
||||
|
||||
//
|
||||
@@ -189,7 +179,7 @@ MainObject::MainObject(QObject *parent)
|
||||
"CART,"+ // 06
|
||||
"DEFAULT_COLOR "+ // 07
|
||||
"from PANELS";
|
||||
q=new RDSqlQuery(sql,src_db);
|
||||
q=new QSqlQuery(sql,src_db);
|
||||
while(q->next()) {
|
||||
sql=QString("insert into PANELS set ")+
|
||||
QString().sprintf("TYPE=%d,",q->value(0).toInt())+
|
||||
@@ -200,7 +190,7 @@ MainObject::MainObject(QObject *parent)
|
||||
"LABEL=\""+RDEscapeString(q->value(5).toString())+"\","+
|
||||
QString().sprintf("CART=%d,",q->value(6).toInt())+
|
||||
"DEFAULT_COLOR=\""+RDEscapeString(q->value(7).toString())+"\"";
|
||||
q1=new RDSqlQuery(sql,dest_db);
|
||||
q1=new QSqlQuery(sql,dest_db);
|
||||
delete q1;
|
||||
}
|
||||
delete q;
|
||||
|
@@ -36,8 +36,8 @@ class MainObject : public QObject
|
||||
MainObject(QObject *parent=0);
|
||||
|
||||
private:
|
||||
QSqlDatabase *src_db;
|
||||
QSqlDatabase *dest_db;
|
||||
QSqlDatabase src_db;
|
||||
QSqlDatabase dest_db;
|
||||
RDConfig *rd_config;
|
||||
};
|
||||
|
||||
|
@@ -41,8 +41,8 @@ MainObject::MainObject(QObject *parent)
|
||||
QString src_station;
|
||||
QString dest_station;
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
RDSqlQuery *q1;
|
||||
QSqlQuery *q;
|
||||
QSqlQuery *q1;
|
||||
|
||||
//
|
||||
// Read Command Options
|
||||
@@ -120,17 +120,13 @@ MainObject::MainObject(QObject *parent)
|
||||
// Open Databases
|
||||
//
|
||||
src_db=QSqlDatabase::addDatabase("QMYSQL3");
|
||||
if(!src_db) {
|
||||
fprintf(stderr,"rdcatch_copy: can't open source mySQL database\n");
|
||||
exit(1);
|
||||
}
|
||||
src_db->setDatabaseName(rd_config->mysqlDbname());
|
||||
src_db->setUserName(rd_config->mysqlUsername());
|
||||
src_db->setPassword(rd_config->mysqlPassword());
|
||||
src_db->setHostName(src_hostname);
|
||||
if(!src_db->open()) {
|
||||
src_db.setDatabaseName(rd_config->mysqlDbname());
|
||||
src_db.setUserName(rd_config->mysqlUsername());
|
||||
src_db.setPassword(rd_config->mysqlPassword());
|
||||
src_db.setHostName(src_hostname);
|
||||
if(!src_db.open()) {
|
||||
fprintf(stderr,"rdcatch_copy: unable to connect to source mySQL server\n");
|
||||
src_db->removeDatabase(rd_config->mysqlDbname());
|
||||
src_db.removeDatabase(rd_config->mysqlDbname());
|
||||
exit(256);
|
||||
}
|
||||
|
||||
@@ -145,18 +141,13 @@ MainObject::MainObject(QObject *parent)
|
||||
}
|
||||
else {
|
||||
dest_db=QSqlDatabase::addDatabase("QMYSQL3");
|
||||
if(!dest_db) {
|
||||
fprintf(stderr,"rdcatch_copy: can't open destination mySQL database\n");
|
||||
exit(1);
|
||||
}
|
||||
dest_db->setDatabaseName(rd_config->mysqlDbname());
|
||||
dest_db->setUserName(rd_config->mysqlUsername());
|
||||
dest_db->setPassword(rd_config->mysqlPassword());
|
||||
dest_db->setHostName(dest_hostname);
|
||||
if(!dest_db->open()) {
|
||||
dest_db.setDatabaseName(rd_config->mysqlDbname());
|
||||
dest_db.setUserName(rd_config->mysqlUsername());
|
||||
dest_db.setPassword(rd_config->mysqlPassword());
|
||||
dest_db.setHostName(dest_hostname);
|
||||
if(!dest_db.open()) {
|
||||
fprintf(stderr,
|
||||
"rdcatch_copy: unable to connect to destination mySQL server\n");
|
||||
dest_db->removeDatabase(rd_config->mysqlDbname());
|
||||
exit(256);
|
||||
}
|
||||
}
|
||||
@@ -165,7 +156,7 @@ MainObject::MainObject(QObject *parent)
|
||||
// Check Database Versions
|
||||
//
|
||||
sql=QString("select DB from VERSION");
|
||||
q=new RDSqlQuery(sql,src_db);
|
||||
q=new QSqlQuery(sql,src_db);
|
||||
if(!q->first()) {
|
||||
fprintf(stderr,
|
||||
"rdcatch_copy: unable to read source database version\n");
|
||||
@@ -177,7 +168,7 @@ MainObject::MainObject(QObject *parent)
|
||||
}
|
||||
delete q;
|
||||
|
||||
q=new RDSqlQuery(sql,dest_db);
|
||||
q=new QSqlQuery(sql,dest_db);
|
||||
if(!q->first()) {
|
||||
fprintf(stderr,
|
||||
"rdcatch_copy: unable to read destination database version\n");
|
||||
@@ -194,7 +185,7 @@ MainObject::MainObject(QObject *parent)
|
||||
//
|
||||
sql=QString("select NAME from STATIONS where ")+
|
||||
"NAME=\""+RDEscapeString(src_station)+"\"";
|
||||
q=new RDSqlQuery(sql,src_db);
|
||||
q=new QSqlQuery(sql,src_db);
|
||||
if(!q->first()) {
|
||||
fprintf(stderr,
|
||||
"rdcatch_copy: source Rivendell host doesn't exist\n");
|
||||
@@ -204,7 +195,7 @@ MainObject::MainObject(QObject *parent)
|
||||
|
||||
sql=QString("select NAME from STATIONS where ")+
|
||||
"NAME=\""+RDEscapeString(dest_station)+"\"";
|
||||
q=new RDSqlQuery(sql,dest_db);
|
||||
q=new QSqlQuery(sql,dest_db);
|
||||
if(!q->first()) {
|
||||
fprintf(stderr,
|
||||
"rdcatch_copy: destination Rivendell host doesn't exist\n");
|
||||
@@ -229,7 +220,7 @@ MainObject::MainObject(QObject *parent)
|
||||
//
|
||||
sql=QString("delete from RECORDINGS where ")+
|
||||
"STATION_NAME\""+RDEscapeString(dest_station)+"\"";
|
||||
q=new RDSqlQuery(sql,dest_db);
|
||||
q=new QSqlQuery(sql,dest_db);
|
||||
delete q;
|
||||
|
||||
//
|
||||
@@ -279,7 +270,7 @@ MainObject::MainObject(QObject *parent)
|
||||
"URL_PASSWORD "+ // 40
|
||||
"from RECORDINGS where "+
|
||||
"STATION_NAME=\""+RDEscapeString(src_station)+"\"";
|
||||
q=new RDSqlQuery(sql,src_db);
|
||||
q=new QSqlQuery(sql,src_db);
|
||||
while(q->next()) {
|
||||
sql=QString("insert into RECORDINGS set ")+
|
||||
":IS_ACTIVE=\""+RDEscapeString(q->value(0).toString())+"\","+
|
||||
@@ -324,7 +315,7 @@ MainObject::MainObject(QObject *parent)
|
||||
"URL_USERNAME=\""+RDEscapeString(q->value(39).toString())+"\","+
|
||||
"URL_PASSWORD=\""+RDEscapeString(q->value(40).toString())+"\","+
|
||||
"STATION_NAME=\""+RDEscapeString(dest_station)+"\"";
|
||||
q1=new RDSqlQuery(sql,dest_db);
|
||||
q1=new QSqlQuery(sql,dest_db);
|
||||
delete q1;
|
||||
}
|
||||
delete q;
|
||||
|
@@ -40,8 +40,8 @@ class MainObject : public QObject
|
||||
MainObject(QObject *parent=0);
|
||||
|
||||
private:
|
||||
QSqlDatabase *src_db;
|
||||
QSqlDatabase *dest_db;
|
||||
QSqlDatabase src_db;
|
||||
QSqlDatabase dest_db;
|
||||
RDConfig *rd_config;
|
||||
};
|
||||
|
||||
|
@@ -26,6 +26,8 @@
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qdir.h>
|
||||
//Added by qt3to4:
|
||||
#include <QSqlQuery>
|
||||
|
||||
#include <rddb.h>
|
||||
#include <rd.h>
|
||||
@@ -54,8 +56,8 @@ MainObject::MainObject(QObject *parent)
|
||||
QString default_group;
|
||||
unsigned start_cartnum=0;
|
||||
unsigned end_cartnum=0;
|
||||
QSqlDatabase *filter_db;
|
||||
QSqlDatabase *ext_db;
|
||||
QSqlDatabase filter_db;
|
||||
QSqlDatabase ext_db;
|
||||
bool ok=false;
|
||||
bool found;
|
||||
QString start_datetime;
|
||||
@@ -85,18 +87,13 @@ MainObject::MainObject(QObject *parent)
|
||||
// Open Local Database
|
||||
//
|
||||
filter_db=QSqlDatabase::addDatabase(rdconfig->mysqlDriver(),"LOCAL_DB");
|
||||
if(!filter_db) {
|
||||
fprintf(stderr,"rivendell_filter: can't open local mySQL database\n");
|
||||
exit(1);
|
||||
}
|
||||
filter_db->setDatabaseName(rdconfig->mysqlDbname());
|
||||
filter_db->setUserName(rdconfig->mysqlUsername());
|
||||
filter_db->setPassword(rdconfig->mysqlPassword());
|
||||
filter_db->setHostName(rdconfig->mysqlHostname());
|
||||
if(!filter_db->open()) {
|
||||
filter_db.setDatabaseName(rdconfig->mysqlDbname());
|
||||
filter_db.setUserName(rdconfig->mysqlUsername());
|
||||
filter_db.setPassword(rdconfig->mysqlPassword());
|
||||
filter_db.setHostName(rdconfig->mysqlHostname());
|
||||
if(!filter_db.open()) {
|
||||
fprintf(stderr,
|
||||
"rivendell_filter: unable to connect to local mySQL Server\n");
|
||||
filter_db->removeDatabase(rdconfig->mysqlDbname());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -180,18 +177,13 @@ MainObject::MainObject(QObject *parent)
|
||||
// Open Remote Database
|
||||
//
|
||||
ext_db=QSqlDatabase::addDatabase(rdconfig->mysqlDriver(),"REMOTE_DB");
|
||||
if(!ext_db) {
|
||||
fprintf(stderr,"rivendell_filter: can't open remote mySQL database\n");
|
||||
exit(1);
|
||||
}
|
||||
ext_db->setDatabaseName(rdconfig->mysqlDbname());
|
||||
ext_db->setUserName(ext_username);
|
||||
ext_db->setPassword(ext_password);
|
||||
ext_db->setHostName(ext_hostname);
|
||||
if(!ext_db->open()) {
|
||||
ext_db.setDatabaseName(rdconfig->mysqlDbname());
|
||||
ext_db.setUserName(ext_username);
|
||||
ext_db.setPassword(ext_password);
|
||||
ext_db.setHostName(ext_hostname);
|
||||
if(!ext_db.open()) {
|
||||
fprintf(stderr,
|
||||
"rivendell_filter: unable to connect to remote mySQL Server\n");
|
||||
ext_db->removeDatabase(rdconfig->mysqlDbname());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user