2018-07-19 Fred Gleason <fredg@paravelsystems.com>

* Removed the 'RDEncoder' class.
	* Removed the 'RDEncoderList' class.
This commit is contained in:
Fred Gleason 2018-07-19 17:40:51 +00:00
parent 68cb66468e
commit 25e0868a42
10 changed files with 510 additions and 950 deletions

View File

@ -17184,3 +17184,6 @@
2018-07-19 Fred Gleason <fredg@paravelsystems.com>
* Cleaned up SQL quieries in 'web/rdfeed/' to ensure UTF-8
compatibility.
2018-07-19 Fred Gleason <fredg@paravelsystems.com>
* Removed the 'RDEncoder' class.
* Removed the 'RDEncoderList' class.

View File

@ -122,8 +122,6 @@ dist_librd_la_SOURCES = dbversion.h\
rdedit_audio.cpp rdedit_audio.h\
rdedit_panel_name.cpp rdedit_panel_name.h\
rdemptycart.cpp rdemptycart.h\
rdencoder.cpp rdencoder.h\
rdencoderlist.cpp rdencoderlist.h\
rdescape_string.cpp rdescape_string.h\
rdevent.cpp rdevent.h\
rdevent_line.cpp rdevent_line.h\

View File

@ -64,8 +64,6 @@ SOURCES += rddbheartbeat.cpp
SOURCES += rddebug.cpp
SOURCES += rddropbox.cpp
SOURCES += rdemptycart.cpp
SOURCES += rdencoder.cpp
SOURCES += rdencoderlist.cpp
SOURCES += rdescape_string.cpp
SOURCES += rdevent.cpp
SOURCES += rdevent_line.cpp
@ -209,8 +207,6 @@ HEADERS += rddbheartbeat.h
HEADERS += rddebug.h
HEADERS += rddropbox.h
HEADERS += rdemptycart.h
HEADERS += rdencoder.h
HEADERS += rdencoderlist.h
HEADERS += rdescape_string.h
HEADERS += rdevent.h
HEADERS += rdevent_line.h

View File

@ -1,140 +0,0 @@
// rdencoder.cpp
//
// Abstract a Rivendell Custom Encoder
//
// (C) Copyright 2008,2016 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
// 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 <rdencoder.h>
RDEncoder::RDEncoder()
{
clear();
}
QString RDEncoder::name() const
{
return encoder_name;
}
void RDEncoder::setName(const QString &str)
{
encoder_name=str;
}
int RDEncoder::id() const
{
return encoder_id;
}
void RDEncoder::setId(int id)
{
encoder_id=id;
}
QString RDEncoder::commandLine() const
{
return encoder_command_line;
}
void RDEncoder::setCommandLine(const QString &str)
{
encoder_command_line=str;
}
QString RDEncoder::defaultExtension() const
{
return encoder_default_extension;
}
void RDEncoder::setDefaultExtension(const QString &str)
{
encoder_default_extension=str;
}
int RDEncoder::allowedChannelsQuantity() const
{
return encoder_channels.size();
}
int RDEncoder::allowedChannel(unsigned n)
{
return encoder_channels[n];
}
void RDEncoder::addAllowedChannel(int val)
{
encoder_channels.push_back(val);
}
int RDEncoder::allowedSampleratesQuantity() const
{
return encoder_samplerates.size();
}
int RDEncoder::allowedSamplerate(unsigned n)
{
return encoder_samplerates[n];
}
void RDEncoder::addAllowedSamplerate(int val)
{
encoder_samplerates.push_back(val);
}
int RDEncoder::allowedBitratesQuantity() const
{
return encoder_bitrates.size();
}
int RDEncoder::allowedBitrate(unsigned n)
{
return encoder_bitrates[n];
}
void RDEncoder::addAllowedBitrate(int val)
{
encoder_bitrates.push_back(val);
}
void RDEncoder::clear()
{
encoder_name="";
encoder_id=-1;
encoder_command_line="";
encoder_default_extension="";
encoder_channels.clear();
encoder_samplerates.clear();
encoder_bitrates.clear();
}

View File

@ -1,62 +0,0 @@
// rdencoder.h
//
// Abstract a Rivendell Custom Encoder
//
// (C) Copyright 2008,2016 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
// 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 RDENCODER_H
#define RDENCODER_H
#include <vector>
#include <qstring.h>
class RDEncoder
{
public:
RDEncoder();
QString name() const;
void setName(const QString &str);
int id() const;
void setId(int id);
QString commandLine() const;
void setCommandLine(const QString &str);
QString defaultExtension() const;
void setDefaultExtension(const QString &str);
int allowedChannelsQuantity() const;
int allowedChannel(unsigned n);
void addAllowedChannel(int val);
int allowedSampleratesQuantity() const;
int allowedSamplerate(unsigned n);
void addAllowedSamplerate(int val);
int allowedBitratesQuantity() const;
int allowedBitrate(unsigned n);
void addAllowedBitrate(int val);
void clear();
private:
QString encoder_name;
int encoder_id;
QString encoder_command_line;
QString encoder_default_extension;
std::vector<int> encoder_channels;
std::vector<int> encoder_samplerates;
std::vector<int> encoder_bitrates;
};
#endif // RDENCODER_H

View File

@ -1,91 +0,0 @@
// rdencoderlist.cpp
//
// Abstract a Rivendell Custom Encoder
//
// (C) Copyright 2008,2016 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
// 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 <rdescape_string.h>
#include <rddb.h>
#include <rdencoderlist.h>
RDEncoderList::RDEncoderList(const QString &stationname)
{
QString sql;
RDSqlQuery *q;
RDSqlQuery *q1;
sql=QString("select ")+
"ID,"+
"NAME,"+
"DEFAULT_EXTENSION,"+
"COMMAND_LINE "+
"from ENCODERS where STATION_NAME=\""+RDEscapeString(stationname)+"\"";
q=new RDSqlQuery(sql);
while(q->next()) {
list_encoders.push_back(new RDEncoder());
list_encoders.back()->setId(q->value(0).toInt());
list_encoders.back()->setName(q->value(1).toString());
list_encoders.back()->setDefaultExtension(q->value(2).toString());
list_encoders.back()->setCommandLine(q->value(3).toString());
sql=QString().sprintf("select CHANNELS from ENCODER_CHANNELS \
where ENCODER_ID=%d order by CHANNELS",
q->value(0).toInt());
q1=new RDSqlQuery(sql);
while(q1->next()) {
list_encoders.back()->addAllowedChannel(q1->value(0).toInt());
}
delete q1;
sql=QString().sprintf("select SAMPLERATES from ENCODER_SAMPLERATES \
where ENCODER_ID=%d order by SAMPLERATES",
q->value(0).toInt());
q1=new RDSqlQuery(sql);
while(q1->next()) {
list_encoders.back()->addAllowedSamplerate(q1->value(0).toInt());
}
delete q1;
sql=QString().sprintf("select BITRATES from ENCODER_BITRATES \
where ENCODER_ID=%d order by BITRATES",
q->value(0).toInt());
q1=new RDSqlQuery(sql);
while(q1->next()) {
list_encoders.back()->addAllowedBitrate(q1->value(0).toInt());
}
delete q1;
}
delete q;
}
RDEncoderList::~RDEncoderList()
{
for(unsigned i=0;i<list_encoders.size();i++) {
delete list_encoders[i];
}
list_encoders.clear();
}
unsigned RDEncoderList::encoderQuantity() const
{
return list_encoders.size();
}
RDEncoder *RDEncoderList::encoder(unsigned n)
{
return list_encoders[n];
}

View File

@ -1,43 +0,0 @@
// rdencoderlist.h
//
// Abstract a Rivendell Custom Encoder
//
// (C) Copyright 2008,2016 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
// 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 RDENCODERLIST_H
#define RDENCODERLIST_H
#include <vector>
#include <qstring.h>
#include <rdencoder.h>
class RDEncoderList
{
public:
RDEncoderList(const QString &stationname);
~RDEncoderList();
unsigned encoderQuantity() const;
RDEncoder *encoder(unsigned n);
private:
std::vector<RDEncoder *> list_encoders;
};
#endif // RDENCODERLIST_H

File diff suppressed because it is too large Load Diff

View File

@ -28,7 +28,6 @@
#include <qlabel.h>
#include <rdsettings.h>
#include <rdencoderlist.h>
class RDExportSettingsDialog : public QDialog
{
@ -50,7 +49,6 @@ class RDExportSettingsDialog : public QDialog
void ShowBitRates(RDSettings::Format fmt,int samprate,int bitrate,int qual);
void SetCurrentItem(QComboBox *box,int value);
RDSettings::Format GetFormat(QString str);
RDEncoderList *lib_encoders;
RDSettings *lib_settings;
QComboBox *lib_format_box;
QComboBox *lib_channels_box;

View File

@ -23,10 +23,8 @@
#include <qlabel.h>
#include <rd.h>
#include <rdencoderlist.h>
#include <view_adapters.h>
#include "view_adapters.h"
ViewAdapters::ViewAdapters(RDStation *rdstation,QWidget *parent)
: QDialog(parent,"",true)
@ -112,11 +110,6 @@ ViewAdapters::ViewAdapters(RDStation *rdstation,QWidget *parent)
}
text+=tr(" PCM16 Linear\n");
text+=tr(" PCM24 Linear\n");
RDEncoderList *encoders=new RDEncoderList(rdstation->name());
for(unsigned i=0;i<encoders->encoderQuantity();i++) {
text+=" "+encoders->encoder(i)->name()+" [Custom]\n";
}
delete encoders;
text+="\n";