diff --git a/ChangeLog b/ChangeLog index c3b1ef45..526f276d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20203,3 +20203,10 @@ attempting to post a log with no events selected. 2020-08-11 Fred Gleason * Incremented the package version to 3.4.0rss3. +2020-08-11 Fred Gleason + * Dropped the 'ENCODERS', 'ENCODER_BITRATES', 'ENCODER_BITRATES' + and 'ENCODER_CHANNELS' tables from the database. + * Incremented the database version to 331. + * Removed the 'RDSettings::customCommandLine()', + 'RDSettings::setCustomCommandLine()' and + ' RDSettings::resolvedCustomCommandLine()' methods. diff --git a/docs/tables/Makefile.am b/docs/tables/Makefile.am index 3077cba4..87920c8d 100644 --- a/docs/tables/Makefile.am +++ b/docs/tables/Makefile.am @@ -40,10 +40,6 @@ EXTRA_DIST = audio_cards.txt\ dropbox_paths.txt\ dropbox_sched_codes.txt\ elr_lines.txt\ - encoder_bitrates.txt\ - encoder_channels.txt\ - encoder_samplerates.txt\ - encoders.txt\ event_lines.txt\ event_perms.txt\ events.txt\ diff --git a/docs/tables/encoder_bitrates.txt b/docs/tables/encoder_bitrates.txt deleted file mode 100644 index eb836f70..00000000 --- a/docs/tables/encoder_bitrates.txt +++ /dev/null @@ -1,11 +0,0 @@ - ENCODER_BITRATES Table Layout for Rivendell - -The ENCODER_BITRATES table holds data concerning the allowed bit rates -in bits/sec for each custom encoder format on the system. -Following is the layout of a record in the ENCODER_BITRATES table: - -FIELD NAME TYPE REMARKS -------------------------------------------------------------------- -ID int(11) -ENCODER_ID int(11) From ENCODERS.ID -BITRATE int(11) diff --git a/docs/tables/encoder_channels.txt b/docs/tables/encoder_channels.txt deleted file mode 100644 index 215acf24..00000000 --- a/docs/tables/encoder_channels.txt +++ /dev/null @@ -1,11 +0,0 @@ - ENCODER_CHANNELS Table Layout for Rivendell - -The ENCODER_CHANNELS table holds data concerning the allowed channel -count for each custom encoder format on the system. -Following is the layout of a record in the ENCODER_CHANNELS table: - -FIELD NAME TYPE REMARKS -------------------------------------------------------------------- -ID int(11) -ENCODER_ID int(11) From ENCODERS.ID -CHANNELS int(11) diff --git a/docs/tables/encoder_samplerates.txt b/docs/tables/encoder_samplerates.txt deleted file mode 100644 index 4594dd2b..00000000 --- a/docs/tables/encoder_samplerates.txt +++ /dev/null @@ -1,11 +0,0 @@ - ENCODER_SAMPLERATES Table Layout for Rivendell - -The ENCODER_SAMPLERATES table holds data concerning the allowed -sample rates in samples/sec for each custom encoder format on the system. -Following is the layout of a record in the ENCODER_SAMPLERATES table: - -FIELD NAME TYPE REMARKS -------------------------------------------------------------------- -ID int(11) -ENCODER_ID int(11) From ENCODERS.ID -SAMPLERATE int(11) diff --git a/docs/tables/encoders.txt b/docs/tables/encoders.txt deleted file mode 100644 index 2a314446..00000000 --- a/docs/tables/encoders.txt +++ /dev/null @@ -1,12 +0,0 @@ - ENCODERS Table Layout for Rivendell - -The EVENTS table holds data concerning each custom encoder format -on the system. - -FIELD NAME TYPE REMARKS -------------------------------------------------------------------- -ID int(11) -NAME varchar(32) -STATION_NAME varchar(64) From STATIONS.NAME -COMMAND_LINE varchar(255) -DEFAULT_EXTENSION varchar(16) diff --git a/lib/dbversion.h b/lib/dbversion.h index 01d10e68..853a99cb 100644 --- a/lib/dbversion.h +++ b/lib/dbversion.h @@ -24,7 +24,7 @@ /* * Current Database Version */ -#define RD_VERSION_DATABASE 330 +#define RD_VERSION_DATABASE 331 #endif // DBVERSION_H diff --git a/lib/rdsettings.cpp b/lib/rdsettings.cpp index ab386920..acef4db2 100644 --- a/lib/rdsettings.cpp +++ b/lib/rdsettings.cpp @@ -2,7 +2,7 @@ // // Audio Format Settings // -// (C) Copyright 2002-2015 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 @@ -184,24 +184,6 @@ QString RDSettings::description() case RDSettings::OggVorbis: desc=QString().sprintf("OggVorbis, Qual %d, ",set_quality); break; - - default: // Custom format - if(set_format_name.isEmpty()) { - sql=QString().sprintf("select NAME from ENCODERS where ID=%d", - set_format); - q=new RDSqlQuery(sql); - if(q->first()) { - set_format_name=q->value(0).toString(); - } - else { - set_format_name="Unknown"; - } - delete q; - } - desc=set_format_name+" "; - if(set_bit_rate>0) { - desc+=" "+QString().sprintf("%d kbit/sec, ",set_bit_rate/1000); - } } if(set_sample_rate>0) { desc+=QString().sprintf("%d samp/sec, ",set_sample_rate); @@ -223,42 +205,6 @@ QString RDSettings::description() } -QString RDSettings::customCommandLine() const -{ - return set_custom_command_line; -} - - -void RDSettings::setCustomCommandLine(const QString &str) -{ - set_custom_command_line=str; -} - - -QString RDSettings::resolvedCustomCommandLine(const QString &destfile) -{ - if(set_custom_command_line.isEmpty()) { - QString sql; - RDSqlQuery *q; - sql=QString().sprintf("select COMMAND_LINE from ENCODERS where ID=%d", - set_format); - q=new RDSqlQuery(sql); - if(q->first()) { - set_custom_command_line=q->value(0).toString(); - } - delete q; - } - QString ret=set_custom_command_line; - - ret.replace("%f",destfile); - ret.replace("%c",QString().sprintf("%u",set_channels)); - ret.replace("%r",QString().sprintf("%u",set_sample_rate)); - ret.replace("%b",QString().sprintf("%u",set_bit_rate)); - - return ret; -} - - QString RDSettings::pathName(const QString &stationname,QString pathname, RDSettings::Format fmt) { @@ -336,23 +282,7 @@ QString RDSettings::defaultExtension(const QString &stationname, return QString("ogg"); } - // - // Custom Format - // - QString sql; - RDSqlQuery *q; - QString ret; - - sql=QString("select DEFAULT_EXTENSION from ENCODERS where ")+ - QString().sprintf("ID=%d)&&",fmt)+ - "(STATION_NAME=\""+RDEscapeString(stationname)+"\")"; - q=new RDSqlQuery(sql); - if(q->first()) { - ret=q->value(0).toString(); - } - delete q; - - return ret; + return QString("dat"); } @@ -394,5 +324,5 @@ void RDSettings::clear() set_quality=0; set_normalization_level=0; set_autotrim_level=0; - set_custom_command_line=""; + // set_custom_command_line=""; } diff --git a/lib/rdsettings.h b/lib/rdsettings.h index aedb68c4..22d839aa 100644 --- a/lib/rdsettings.h +++ b/lib/rdsettings.h @@ -2,7 +2,7 @@ // // Audio Format Settings // -// (C) Copyright 2002-2015 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,9 +48,6 @@ class RDSettings int autotrimLevel() const; void setAutotrimLevel(int level); QString description(); - QString customCommandLine() const; - void setCustomCommandLine(const QString &str); - QString resolvedCustomCommandLine(const QString &destfile); static QString pathName(const QString &stationname,QString pathname, RDSettings::Format fmt); static QString defaultExtension(RDSettings::Format fmt); @@ -70,9 +67,7 @@ class RDSettings unsigned set_quality; int set_normalization_level; int set_autotrim_level; - QString set_custom_command_line; }; -#endif - +#endif // RDSETTINGS_H diff --git a/lib/rdstation.cpp b/lib/rdstation.cpp index c6eb241c..eefcc9e3 100644 --- a/lib/rdstation.cpp +++ b/lib/rdstation.cpp @@ -1978,28 +1978,6 @@ void RDStation::remove(const QString &name) "OWNER=\""+RDEscapeString(name)+"\")"; q=new RDSqlQuery(sql); delete q; - sql=QString("select ID from ENCODERS where ")+ - "STATION_NAME=\""+RDEscapeString(name)+"\""; - q=new RDSqlQuery(sql); - while(q->next()) { - sql=QString().sprintf("delete from ENCODER_CHANNELS where ENCODER_ID=%d", - q->value(0).toInt()); - q1=new RDSqlQuery(sql); - delete q1; - sql=QString().sprintf("delete from ENCODER_SAMPLERATES where ENCODER_ID=%d", - q->value(0).toInt()); - q1=new RDSqlQuery(sql); - delete q1; - sql=QString().sprintf("delete from ENCODER_BITRATES where ENCODER_ID=%d", - q->value(0).toInt()); - q1=new RDSqlQuery(sql); - delete q1; - } - delete q; - sql=QString("delete from ENCODERS where ")+ - "STATION_NAME=\""+RDEscapeString(name)+"\""; - q=new RDSqlQuery(sql); - delete q; sql=QString().sprintf("delete from RDHOTKEYS where ")+ "STATION_NAME=\""+RDEscapeString(name)+"\""; q=new RDSqlQuery(sql); diff --git a/rdcastmanager/list_casts.cpp b/rdcastmanager/list_casts.cpp index 1a1d8df6..b8bcb9e0 100644 --- a/rdcastmanager/list_casts.cpp +++ b/rdcastmanager/list_casts.cpp @@ -206,8 +206,9 @@ ListCasts::ListCasts(unsigned feed_id,bool is_super,QWidget *parent) connect(list_close_button,SIGNAL(clicked()),this,SLOT(closeData())); RefreshList(); - GetEncoderId(); + connect(rda->ripc(),SIGNAL(userChanged()),this,SLOT(userChangedData())); + userChangedData(); } @@ -440,10 +441,8 @@ void ListCasts::userChangedData() { bool is_superfeed=list_feed->isSuperfeed(); - list_cart_button->setEnabled(rda->user()->addPodcast()&& - (list_encoder_id>=0)&&(!is_superfeed)); - list_file_button->setEnabled(rda->user()->addPodcast()&& - (list_encoder_id>=0)&&(!is_superfeed)); + list_cart_button->setEnabled(rda->user()->addPodcast()&&(!is_superfeed)); + list_file_button->setEnabled(rda->user()->addPodcast()&&(!is_superfeed)); list_edit_button->setEnabled(rda->user()->editPodcast()&&(!is_superfeed)); list_delete_button-> setEnabled(rda->user()->deletePodcast()&&(!is_superfeed)); @@ -640,32 +639,3 @@ void ListCasts::RefreshItem(RDListViewItem *item) } delete q; } - - -void ListCasts::GetEncoderId() -{ - QString sql; - RDSqlQuery *q; - - list_encoder_id=-1; - RDFeed *feed=new RDFeed(list_feed_id,rda->config()); - int format=feed->uploadFormat(); - delete feed; - if((format>0)&&(format<100)) { // Built-in format - list_encoder_id=format; - return; - } - sql=QString().sprintf("select NAME from ENCODERS where ID=%d",format); - q=new RDSqlQuery(sql); - if(q->first()) { - sql=QString("select ID from ENCODERS where ")+ - "(NAME=\""+RDEscapeString(q->value(0).toString())+"\")&&"+ - "(STATION_NAME=\""+RDEscapeString(rda->station()->name())+"\")"; - delete q; - q=new RDSqlQuery(sql); - if(q->first()) { - list_encoder_id=q->value(0).toInt(); - } - } - delete q; -} diff --git a/rdcastmanager/list_casts.h b/rdcastmanager/list_casts.h index 3ab4e32e..9cd07a4c 100644 --- a/rdcastmanager/list_casts.h +++ b/rdcastmanager/list_casts.h @@ -73,7 +73,6 @@ class ListCasts : public RDDialog QPixmap *list_redball_map; QPixmap *list_whiteball_map; unsigned list_feed_id; - int list_encoder_id; QLabel *list_filter_label; QLineEdit *list_filter_edit; QLabel *list_unexpired_label; diff --git a/utils/rddbmgr/revertschema.cpp b/utils/rddbmgr/revertschema.cpp index 4e2123a4..d27f3a55 100644 --- a/utils/rddbmgr/revertschema.cpp +++ b/utils/rddbmgr/revertschema.cpp @@ -40,6 +40,68 @@ bool MainObject::RevertSchema(int cur_schema,int set_schema,QString *err_msg) // NEW SCHEMA REVERSIONS GO HERE... + // + // Revert 331 + // + if((cur_schema==331)&&(set_schemacur_schema)) { + DropTable("ENCODER_SAMPLERATES"); + DropTable("ENCODER_BITRATES"); + DropTable("ENCODER_CHANNELS"); + DropTable("ENCODERS"); + + WriteSchemaVersion(++cur_schema); + } + + // NEW SCHEMA UPDATES GO HERE...