Browse Source

2020-10-13 Fred Gleason <fredg@paravelsystems.com>

* Added an 'ENCODER_PRESETS' table to the database.
	* Incremented the database verssion to 343.
	* Added an 'Encoder Profiles' dialog to rdadmin(1).
	* Removed static content dependencies from the WebGet service.
	* Refactored the WebGet service to use Encoder Profiles.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
db-merging
Fred Gleason 3 years ago
parent
commit
f5905315eb
  1. 9
      ChangeLog
  2. 1
      docs/tables/Makefile.am
  3. 16
      docs/tables/encoder_presets.txt
  4. 2
      lib/dbversion.h
  5. 66
      lib/librd_cs.ts
  6. 66
      lib/librd_de.ts
  7. 66
      lib/librd_es.ts
  8. 76
      lib/librd_fr.ts
  9. 66
      lib/librd_nb.ts
  10. 66
      lib/librd_nn.ts
  11. 66
      lib/librd_pt_BR.ts
  12. 301
      lib/rdexport_settings_dialog.cpp
  13. 76
      lib/rdexport_settings_dialog.h
  14. 10
      lib/rdformpost.cpp
  15. 1
      lib/rdformpost.h
  16. 4
      lib/rdimport_audio.cpp
  17. 145
      lib/rdsettings.cpp
  18. 10
      lib/rdsettings.h
  19. 6
      rdadmin/Makefile.am
  20. 5
      rdadmin/edit_feed.cpp
  21. 4
      rdadmin/edit_replicator.cpp
  22. 47
      rdadmin/edit_system.cpp
  23. 20
      rdadmin/edit_system.h
  24. 200
      rdadmin/list_encoders.cpp
  25. 66
      rdadmin/list_encoders.h
  26. 10
      rdadmin/rdadmin.cpp
  27. 6
      rdadmin/rdadmin.pro
  28. 216
      rdadmin/rdadmin_cs.ts
  29. 246
      rdadmin/rdadmin_de.ts
  30. 220
      rdadmin/rdadmin_es.ts
  31. 262
      rdadmin/rdadmin_fr.ts
  32. 246
      rdadmin/rdadmin_nb.ts
  33. 246
      rdadmin/rdadmin_nn.ts
  34. 248
      rdadmin/rdadmin_pt_BR.ts
  35. 5
      rdcatch/edit_upload.cpp
  36. 4
      rdlogedit/render_dialog.cpp
  37. 9
      utils/rddbmgr/revertschema.cpp
  38. 2
      utils/rddbmgr/schemamap.cpp
  39. 22
      utils/rddbmgr/updateschema.cpp
  40. 9
      web/webget/Makefile.am
  41. 121
      web/webget/webget.cpp
  42. 1
      web/webget/webget.h
  43. 106
      web/webget/webget.html
  44. 187
      web/webget/webget.js

9
ChangeLog

@ -1,4 +1,4 @@
2002-4-28 Fred Gleason <fredg@wava.com>
22002-4-28 Fred Gleason <fredg@wava.com>
* Initial package creation
* Created basic structure for Core Audio Engine (ALSA). PW and DC
commands work.
@ -20456,6 +20456,11 @@
* Fixed a bug in rdairplay(1) where copying a log event using
the 'Copy' button would result in the new event always getting
a 'PLAY' transition.
2020-10-11 Fred Gleason <fredg@paravelsystems.com>
2020-10-11 Fred Gleason <fredg@paravelsystems.com>
* Fixed gcc(1) format-string warnings in 'lib/rdmulticaster.cpp'.
2020-10-13 Fred Gleason <fredg@paravelsystems.com>
* Added an 'ENCODER_PRESETS' table to the database.
* Incremented the database verssion to 343.
* Added an 'Encoder Profiles' dialog to rdadmin(1).
* Removed static content dependencies from the WebGet service.
* Refactored the WebGet service to use Encoder Profiles.

1
docs/tables/Makefile.am

@ -40,6 +40,7 @@ EXTRA_DIST = audio_cards.txt\
dropbox_paths.txt\
dropbox_sched_codes.txt\
elr_lines.txt\
encoder_presets.txt\
event_lines.txt\
event_perms.txt\
events.txt\

16
docs/tables/encoder_presets.txt

@ -0,0 +1,16 @@
ENCODER_PRESETS Table Layout for Rivendell
The ENCODER_PRESETS table holds data concerning predefined sets if
encoder settings for subsystems such as WebGet.
FIELD NAME TYPE REMARKS
---------------------------------------------------------------
ID int(10) unsigned
NAME varchar(64) Unique
FORMAT int(10) unsigned RDSettings::Format
CHANNELS int(10) unsigned
SAMPLE_RATE int(10) unsigned Samples/sec
BIT_RATE int(10) unsigned Bits/second
QUALITY int(11) unsigned
NORMALIZATION_LEVEL int(11) signed dBFS
AUTOTRIM_LEVEL int(11) signed dBFS

2
lib/dbversion.h

@ -24,7 +24,7 @@
/*
* Current Database Version
*/
#define RD_VERSION_DATABASE 342
#define RD_VERSION_DATABASE 343
#endif // DBVERSION_H

66
lib/librd_cs.ts

@ -841,6 +841,10 @@
<source>whitespace is not permitted in service names</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>new profile</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RDAddCart</name>
@ -1835,23 +1839,23 @@ Pล™epsat?</translation>
<name>RDExportSettingsDialog</name>
<message>
<source>Edit Export Settings</source>
<translation>Upravit nastavenรญ uloลพenรญ v jinรฉm formรกtu</translation>
<translation type="obsolete">Upravit nastavenรญ uloลพenรญ v jinรฉm formรกtu</translation>
</message>
<message>
<source>&amp;Channels:</source>
<translation>&amp;Kanรกly:</translation>
<translation type="obsolete">&amp;Kanรกly:</translation>
</message>
<message>
<source>&amp;Sample Rate:</source>
<translation>&amp;Vzorkovacรญ kmitoฤet:</translation>
<translation type="obsolete">&amp;Vzorkovacรญ kmitoฤet:</translation>
</message>
<message>
<source>&amp;Bitrate:</source>
<translation>&amp;Datovรฝ tok:</translation>
<translation type="obsolete">&amp;Datovรฝ tok:</translation>
</message>
<message>
<source>&amp;Quality:</source>
<translation>&amp;Kvalita:</translation>
<translation type="obsolete">&amp;Kvalita:</translation>
</message>
<message>
<source>&amp;OK</source>
@ -1981,6 +1985,58 @@ Pล™epsat?</translation>
<source>PCM24</source>
<translation type="unfinished">PCM24</translation>
</message>
<message>
<source>Edit Audio Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Channels</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sample Rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Bitrate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Quality</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>is already in use.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Normalization Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Autotrim Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>dBFS</source>
<translation type="unfinished">dbFS</translation>
</message>
</context>
<context>
<name>RDGetAth</name>

66
lib/librd_de.ts

@ -837,6 +837,10 @@
<source>whitespace is not permitted in service names</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>new profile</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RDAddCart</name>
@ -1826,23 +1830,23 @@ Overwrite?</source>
<name>RDExportSettingsDialog</name>
<message>
<source>Edit Export Settings</source>
<translation>Exporteinstellungen editieren</translation>
<translation type="obsolete">Exporteinstellungen editieren</translation>
</message>
<message>
<source>&amp;Channels:</source>
<translation>&amp;Kanรคle:</translation>
<translation type="obsolete">&amp;Kanรคle:</translation>
</message>
<message>
<source>&amp;Sample Rate:</source>
<translation>&amp;Sample Rate:</translation>
<translation type="obsolete">&amp;Sample Rate:</translation>
</message>
<message>
<source>&amp;Bitrate:</source>
<translation>&amp;Bitrate:</translation>
<translation type="obsolete">&amp;Bitrate:</translation>
</message>
<message>
<source>&amp;Quality:</source>
<translation>&amp;Qualitรคt:</translation>
<translation type="obsolete">&amp;Qualitรคt:</translation>
</message>
<message>
<source>&amp;OK</source>
@ -1972,6 +1976,58 @@ Overwrite?</source>
<source>PCM24</source>
<translation type="unfinished">PCM24</translation>
</message>
<message>
<source>Edit Audio Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Channels</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sample Rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Bitrate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Quality</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>is already in use.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Normalization Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Autotrim Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>dBFS</source>
<translation type="unfinished">dBFS</translation>
</message>
</context>
<context>
<name>RDGetAth</name>

66
lib/librd_es.ts

@ -837,6 +837,10 @@
<source>whitespace is not permitted in service names</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>new profile</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RDAddCart</name>
@ -1824,23 +1828,23 @@ Overwrite?</source>
<name>RDExportSettingsDialog</name>
<message>
<source>Edit Export Settings</source>
<translation>Editar parรกm. exportaciรณn</translation>
<translation type="obsolete">Editar parรกm. exportaciรณn</translation>
</message>
<message>
<source>&amp;Channels:</source>
<translation>&amp;Canales:</translation>
<translation type="obsolete">&amp;Canales:</translation>
</message>
<message>
<source>&amp;Sample Rate:</source>
<translation>Tasa de &amp;Muestreo:</translation>
<translation type="obsolete">Tasa de &amp;Muestreo:</translation>
</message>
<message>
<source>&amp;Bitrate:</source>
<translation>&amp;Tasa de bits:</translation>
<translation type="obsolete">&amp;Tasa de bits:</translation>
</message>
<message>
<source>&amp;Quality:</source>
<translation>&amp;Calidad:</translation>
<translation type="obsolete">&amp;Calidad:</translation>
</message>
<message>
<source>&amp;OK</source>
@ -1970,6 +1974,58 @@ Overwrite?</source>
<source>PCM24</source>
<translation type="unfinished">PCM24</translation>
</message>
<message>
<source>Edit Audio Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Channels</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sample Rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Bitrate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Quality</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>is already in use.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Normalization Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Autotrim Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>dBFS</source>
<translation type="unfinished">dBFS</translation>
</message>
</context>
<context>
<name>RDGetAth</name>

76
lib/librd_fr.ts

@ -807,6 +807,10 @@
<source>whitespace is not permitted in service names</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>new profile</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RDAddCart</name>
@ -1581,26 +1585,6 @@ Are you sure you want to save?</source>
</context>
<context>
<name>RDExportSettingsDialog</name>
<message>
<source>Edit Export Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;Channels:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;Sample Rate:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;Bitrate:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;Quality:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&amp;OK</source>
<translation type="unfinished">&amp;OK</translation>
@ -1729,6 +1713,58 @@ Are you sure you want to save?</source>
<source>PCM24</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Edit Audio Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Channels</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sample Rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Bitrate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Quality</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>is already in use.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Normalization Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Autotrim Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>dBFS</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RDGetAth</name>

66
lib/librd_nb.ts

@ -837,6 +837,10 @@
<source>whitespace is not permitted in service names</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>new profile</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RDAddCart</name>
@ -1824,23 +1828,23 @@ Skriv over?</translation>
<name>RDExportSettingsDialog</name>
<message>
<source>Edit Export Settings</source>
<translation>Rediger eksportinnstillingar</translation>
<translation type="obsolete">Rediger eksportinnstillingar</translation>
</message>
<message>
<source>&amp;Channels:</source>
<translation>&amp;Kanalar:</translation>
<translation type="obsolete">&amp;Kanalar:</translation>
</message>
<message>
<source>&amp;Sample Rate:</source>
<translation>&amp;Punktprรธverate:</translation>
<translation type="obsolete">&amp;Punktprรธverate:</translation>
</message>
<message>
<source>&amp;Bitrate:</source>
<translation>&amp;Bitrate:</translation>
<translation type="obsolete">&amp;Bitrate:</translation>
</message>
<message>
<source>&amp;Quality:</source>
<translation>&amp;Kvalitet:</translation>
<translation type="obsolete">&amp;Kvalitet:</translation>
</message>
<message>
<source>&amp;OK</source>
@ -1970,6 +1974,58 @@ Skriv over?</translation>
<source>PCM24</source>
<translation type="unfinished">PCM24</translation>
</message>
<message>
<source>Edit Audio Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Channels</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sample Rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Bitrate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Quality</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>is already in use.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Normalization Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Autotrim Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>dBFS</source>
<translation type="unfinished">dBFS</translation>
</message>
</context>
<context>
<name>RDGetAth</name>

66
lib/librd_nn.ts

@ -837,6 +837,10 @@
<source>whitespace is not permitted in service names</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>new profile</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RDAddCart</name>
@ -1824,23 +1828,23 @@ Skriv over?</translation>
<name>RDExportSettingsDialog</name>
<message>
<source>Edit Export Settings</source>
<translation>Rediger eksportinnstillingar</translation>
<translation type="obsolete">Rediger eksportinnstillingar</translation>
</message>
<message>
<source>&amp;Channels:</source>
<translation>&amp;Kanalar:</translation>
<translation type="obsolete">&amp;Kanalar:</translation>
</message>
<message>
<source>&amp;Sample Rate:</source>
<translation>&amp;Punktprรธverate:</translation>
<translation type="obsolete">&amp;Punktprรธverate:</translation>
</message>
<message>
<source>&amp;Bitrate:</source>
<translation>&amp;Bitrate:</translation>
<translation type="obsolete">&amp;Bitrate:</translation>
</message>
<message>
<source>&amp;Quality:</source>
<translation>&amp;Kvalitet:</translation>
<translation type="obsolete">&amp;Kvalitet:</translation>
</message>
<message>
<source>&amp;OK</source>
@ -1970,6 +1974,58 @@ Skriv over?</translation>
<source>PCM24</source>
<translation type="unfinished">PCM24</translation>
</message>
<message>
<source>Edit Audio Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Channels</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sample Rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Bitrate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Quality</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>is already in use.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Normalization Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Autotrim Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>dBFS</source>
<translation type="unfinished">dBFS</translation>
</message>
</context>
<context>
<name>RDGetAth</name>

66
lib/librd_pt_BR.ts

@ -837,6 +837,10 @@
<source>whitespace is not permitted in service names</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>new profile</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RDAddCart</name>
@ -1830,23 +1834,23 @@ Sobreescrever?</translation>
<name>RDExportSettingsDialog</name>
<message>
<source>Edit Export Settings</source>
<translation>Editar Configuraรงรฃo de Exportaรงรฃo</translation>
<translation type="obsolete">Editar Configuraรงรฃo de Exportaรงรฃo</translation>
</message>
<message>
<source>&amp;Channels:</source>
<translation>&amp;Canais:</translation>
<translation type="obsolete">&amp;Canais:</translation>
</message>
<message>
<source>&amp;Sample Rate:</source>
<translation>&amp;Taxa de Amostragem:</translation>
<translation type="obsolete">&amp;Taxa de Amostragem:</translation>
</message>
<message>
<source>&amp;Bitrate:</source>
<translation>&amp;Taxa de Bits:</translation>
<translation type="obsolete">&amp;Taxa de Bits:</translation>
</message>
<message>
<source>&amp;Quality:</source>
<translation>&amp;Qualidade:</translation>
<translation type="obsolete">&amp;Qualidade:</translation>
</message>
<message>
<source>&amp;OK</source>
@ -1976,6 +1980,58 @@ Sobreescrever?</translation>
<source>PCM24</source>
<translation type="unfinished">PCM24</translation>
</message>
<message>
<source>Edit Audio Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Format</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Channels</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Sample Rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Bitrate</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Quality</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duplicate Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>is already in use.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Normalization Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Autotrim Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>dBFS</source>
<translation type="unfinished">dBFS</translation>
</message>
</context>
<context>
<name>RDGetAth</name>

301
lib/rdexport_settings_dialog.cpp

@ -2,7 +2,7 @@
//
// Edit Audio Export Settings
//
// (C) Copyright 2002-2019 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2002-2020 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
@ -18,125 +18,223 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#include <qpushbutton.h>
#include <QMessageBox>
#include <QPushButton>
#include "rdescape_string.h"
#include "rdexport_settings_dialog.h"
RDExportSettingsDialog::RDExportSettingsDialog(RDSettings *settings,
RDExportSettingsDialog::RDExportSettingsDialog(const QString &caption,
QWidget *parent)
: RDDialog(parent)
{
lib_settings=settings;
lib_id=0;
lib_caption=caption;
lib_normalization_level_enabled=false;
lib_autotrim_level_enabled=false;
//
// Dialog Name
//
setWindowTitle(tr("Edit Export Settings"));
setMinimumSize(sizeHint());
setWindowTitle(caption+" - "+tr("Edit Audio Settings"));
//
// Default Format
// Name
//
lib_name_edit=new QLineEdit(this);
lib_name_label=new QLabel(lib_name_edit,tr("Name")+":",this);
lib_name_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
lib_name_label->setFont(labelFont());
//
// Format
//
lib_format_box=new QComboBox(this);
lib_format_box->setGeometry(100,10,150,19);
connect(lib_format_box,SIGNAL(activated(const QString &)),
this,SLOT(formatData(const QString &)));
QLabel *lib_format_label=new QLabel(lib_format_box,"Format:",this);
lib_format_label->setGeometry(25,10,70,19);
lib_format_label=new QLabel(lib_format_box,tr("Format")+":",this);
lib_format_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
lib_format_label->setFont(labelFont());
//
// Default Channels
// Channels
//
lib_channels_box=new QComboBox(this);
lib_channels_box->setGeometry(100,32,60,19);
QLabel *lib_channels_label=
new QLabel(lib_channels_box,tr("&Channels:"),this);
lib_channels_label->setGeometry(25,32,70,19);
lib_channels_label=
new QLabel(lib_channels_box,tr("Channels")+":",this);
lib_channels_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
lib_channels_label->setFont(labelFont());
//
// Default Sample Rate
// Sample Rate
//
lib_samprate_box=new QComboBox(this);
lib_samprate_box->setGeometry(100,54,100,19);
connect(lib_samprate_box,SIGNAL(activated(const QString &)),
this,SLOT(samprateData(const QString &)));
QLabel *lib_samprate_label=
new QLabel(lib_samprate_box,tr("&Sample Rate:"),this);
lib_samprate_label->setGeometry(25,54,75,19);
lib_samprate_label=
new QLabel(lib_samprate_box,tr("Sample Rate")+":",this);
lib_samprate_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
lib_samprate_label->setFont(labelFont());
//
// Default Bitrate
// Bitrate
//
lib_bitrate_box=new QComboBox(this);
lib_bitrate_box->setGeometry(100,76,100,19);
connect(lib_bitrate_box,SIGNAL(activated(const QString &)),
this,SLOT(bitrateData(const QString &)));
lib_bitrate_label=new QLabel(lib_bitrate_box,tr("&Bitrate:"),this);
lib_bitrate_label->setGeometry(25,76,70,19);
lib_bitrate_label=new QLabel(lib_bitrate_box,tr("Bitrate")+":",this);
lib_bitrate_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
lib_bitrate_label->setFont(labelFont());
//
// Quality
//
lib_quality_spin=new QSpinBox(this);
lib_quality_spin->setGeometry(100,98,50,19);
lib_quality_spin->setRange(0,10);
lib_quality_label=new QLabel(lib_quality_spin,tr("&Quality:"),this);
lib_quality_label->setGeometry(25,98,70,19);
lib_quality_label=new QLabel(lib_quality_spin,tr("Quality")+":",this);
lib_quality_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
lib_quality_label->setFont(labelFont());
//
// Ok Button
// Normalization Level
//
QPushButton *ok_button=new QPushButton(this);
ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
ok_button->setDefault(true);
ok_button->setFont(buttonFont());
ok_button->setText(tr("&OK"));
connect(ok_button,SIGNAL(clicked()),this,SLOT(okData()));
lib_normalization_level_spin=new QSpinBox(this);
lib_normalization_level_spin->setRange(-100,0);
lib_normalization_level_label=
new QLabel(lib_normalization_level_spin,tr("Normalization Level")+":",this);
lib_normalization_level_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
lib_normalization_level_label->setFont(labelFont());
lib_normalization_level_label->hide();
lib_normalization_level_spin->hide();
lib_normalization_level_unit_label=new QLabel(tr("dBFS"),this);
lib_normalization_level_unit_label->
setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
lib_normalization_level_unit_label->setFont(labelFont());
lib_normalization_level_label->hide();
lib_normalization_level_spin->hide();
lib_normalization_level_unit_label->hide();
//
// Cancel Button
// Autotrim Level
//
QPushButton *cancel_button=new QPushButton(this);
cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
80,50);
cancel_button->setFont(buttonFont());
cancel_button->setText(tr("&Cancel"));
connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
lib_autotrim_level_spin=new QSpinBox(this);
lib_autotrim_level_spin->setRange(-100,0);
lib_autotrim_level_label=
new QLabel(lib_autotrim_level_spin,tr("Autotrim Level")+":",this);
lib_autotrim_level_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
lib_autotrim_level_label->setFont(labelFont());
lib_autotrim_level_label->hide();
lib_autotrim_level_spin->hide();
lib_autotrim_level_unit_label=new QLabel(tr("dBFS"),this);
lib_autotrim_level_unit_label->
setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
lib_autotrim_level_unit_label->setFont(labelFont());
lib_autotrim_level_label->hide();
lib_autotrim_level_spin->hide();
lib_autotrim_level_unit_label->hide();
//
// Populate Fields
// Ok Button
//
lib_ok_button=new QPushButton(this);
lib_ok_button->setDefault(true);
lib_ok_button->setFont(buttonFont());
lib_ok_button->setText(tr("&OK"));
connect(lib_ok_button,SIGNAL(clicked()),this,SLOT(okData()));
//
// Cancel Button
//
lib_cancel_button=new QPushButton(this);
lib_cancel_button->setFont(buttonFont());
lib_cancel_button->setText(tr("&Cancel"));
connect(lib_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
}
RDExportSettingsDialog::~RDExportSettingsDialog()
{
delete lib_channels_box;
delete lib_samprate_box;
delete lib_bitrate_box;
}
QSize RDExportSettingsDialog::sizeHint() const
{
return QSize(325,180);
}
QSizePolicy RDExportSettingsDialog::sizePolicy() const
{
return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
}
void RDExportSettingsDialog::setShowNormalizationLevel(bool state)
{
lib_normalization_level_enabled=state;
lib_normalization_level_label->setVisible(state);
lib_normalization_level_spin->setVisible(state);
lib_normalization_level_unit_label->setVisible(state);
}
void RDExportSettingsDialog::setShowAutotrimLevel(bool state)
{
lib_autotrim_level_enabled=state;
lib_autotrim_level_label->setVisible(state);
lib_autotrim_level_spin->setVisible(state);
lib_autotrim_level_unit_label->setVisible(state);
}
int RDExportSettingsDialog::exec(RDSettings *s,unsigned id)
{
lib_settings=s;
lib_id=id;
lib_format_box->clear();
lib_channels_box->clear();
if(id==0) {
lib_name_label->hide();
lib_name_edit->hide();
}
else {
lib_name_label->show();
lib_name_edit->show();
lib_name_edit->setText(lib_settings->name());
}
lib_format_box->insertItem(tr("PCM16"));
if(settings->format()==RDSettings::Pcm16) {
if(lib_settings->format()==RDSettings::Pcm16) {
lib_format_box->setCurrentItem(lib_format_box->count()-1);
}
lib_format_box->insertItem(tr("PCM24"));
if(settings->format()==RDSettings::Pcm24) {
if(lib_settings->format()==RDSettings::Pcm24) {
lib_format_box->setCurrentItem(lib_format_box->count()-1);
}
if(rda->station()->haveCapability(RDStation::HaveFlac)) {
lib_format_box->insertItem(tr("FLAC"));
if(settings->format()==RDSettings::Flac) {
if(lib_settings->format()==RDSettings::Flac) {
lib_format_box->setCurrentItem(lib_format_box->count()-1);
}
}
lib_format_box->insertItem(tr("MPEG Layer 2"));
if(settings->format()==RDSettings::MpegL2) {
if(lib_settings->format()==RDSettings::MpegL2) {
lib_format_box->setCurrentItem(lib_format_box->count()-1);
}
if(rda->station()->haveCapability(RDStation::HaveLame)) {
lib_format_box->insertItem(tr("MPEG Layer 3"));
if(settings->format()==RDSettings::MpegL3) {
if(lib_settings->format()==RDSettings::MpegL3) {
lib_format_box->setCurrentItem(lib_format_box->count()-1);
}
}
if(rda->station()->haveCapability(RDStation::HaveOggenc)) {
lib_format_box->insertItem(tr("OggVorbis"));
if(settings->format()==RDSettings::OggVorbis) {
if(lib_settings->format()==RDSettings::OggVorbis) {
lib_format_box->setCurrentItem(lib_format_box->count()-1);
}
}
@ -156,26 +254,27 @@ RDExportSettingsDialog::RDExportSettingsDialog(RDSettings *settings,
}
ShowBitRates(lib_settings->format(),lib_settings->sampleRate(),
lib_settings->bitRate(),lib_settings->quality());
}
lib_normalization_level_spin->setValue(lib_settings->normalizationLevel());
lib_autotrim_level_spin->setValue(lib_settings->autotrimLevel());
RDExportSettingsDialog::~RDExportSettingsDialog()
{
delete lib_channels_box;
delete lib_samprate_box;
delete lib_bitrate_box;
}
QSize RDExportSettingsDialog::sizeHint() const
{
return QSize(275,190);
}
if(id==0) {
setMinimumHeight(sizeHint().height());
setMaximumHeight(sizeHint().height());
}
else {
int height=sizeHint().height()+22;
if(lib_normalization_level_enabled) {
height+=22;
}
if(lib_autotrim_level_enabled) {
height+=22;
}
setMinimumHeight(height);
setMaximumHeight(height);
}
QSizePolicy RDExportSettingsDialog::sizePolicy() const
{
return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
return RDDialog::exec();
}
@ -210,8 +309,27 @@ void RDExportSettingsDialog::bitrateData(const QString &str)
void RDExportSettingsDialog::okData()
{
QString sql;
RDSqlQuery *q=NULL;
unsigned rate=0;
if(lib_id>0) {
sql=QString("select ")+
"ID "+ // 00
"from ENCODER_PRESETS where "+
"NAME=\""+RDEscapeString(lib_name_edit->text())+"\" && "+
QString().sprintf("ID!=%u",lib_id);
q=new RDSqlQuery(sql);
if(q->first()) {
QMessageBox::information(this,lib_caption+" - "+tr("Duplicate Name"),
tr("The name")+" \""+lib_name_edit->text()+"\" "+
tr("is already in use."));
delete q;
return;
}
delete q;
lib_settings->setName(lib_name_edit->text());
}
lib_settings->setFormat(GetFormat(lib_format_box->currentText()));
lib_settings->setChannels(lib_channels_box->currentItem()+1);
lib_settings->setSampleRate(lib_samprate_box->currentText().toInt());
@ -251,13 +369,61 @@ void RDExportSettingsDialog::okData()
lib_settings->setQuality(lib_quality_spin->value());
break;
}
done(0);
lib_settings->setNormalizationLevel(lib_normalization_level_spin->value());
lib_settings->setAutotrimLevel(lib_autotrim_level_spin->value());
done(true);
}
void RDExportSettingsDialog::cancelData()
{
done(1);
done(false);
}
void RDExportSettingsDialog::resizeEvent(QResizeEvent *e)
{
int ypos=2;
if(lib_id>0) {
lib_name_label->setGeometry(10,ypos,135,19);
lib_name_edit->setGeometry(150,ypos,size().width()-160,19);
ypos+=22;
}
lib_format_label->setGeometry(10,ypos,135,19);
lib_format_box->setGeometry(150,ypos,150,19);
ypos+=22;
lib_channels_label->setGeometry(10,ypos,135,19);
lib_channels_box->setGeometry(150,ypos,60,19);
ypos+=22;
lib_samprate_label->setGeometry(10,ypos,135,19);
lib_samprate_box->setGeometry(150,ypos,100,19);
ypos+=22;
lib_bitrate_label->setGeometry(10,ypos,135,19);
lib_bitrate_box->setGeometry(150,ypos,100,19);
ypos+=22;
lib_quality_label->setGeometry(10,ypos,135,19);
lib_quality_spin->setGeometry(150,ypos,50,19);
ypos+=22;
lib_normalization_level_label->setGeometry(10,ypos,135,19);
lib_normalization_level_spin->setGeometry(150,ypos,50,19);
lib_normalization_level_unit_label->setGeometry(205,ypos,100,19);
ypos+=22;
lib_autotrim_level_label->setGeometry(10,ypos,135,19);
lib_autotrim_level_spin->setGeometry(150,ypos,50,19);
lib_autotrim_level_unit_label->setGeometry(205,ypos,100,19);
ypos+=22;
lib_ok_button->setGeometry(size().width()-180,size().height()-60,80,50);
lib_cancel_button->setGeometry(size().width()-90,size().height()-60,80,50);
}
@ -272,7 +438,7 @@ void RDExportSettingsDialog::ShowBitRates(RDSettings::Format fmt,
lib_bitrate_box->clear();
switch(fmt) {
case RDSettings::Pcm16: // PCM16
case RDSettings::Pcm24: // PCM16
case RDSettings::Pcm24: // PCM24
lib_channels_box->insertItem("1");
lib_channels_box->insertItem("2");
lib_samprate_box->insertItem("32000");
@ -823,4 +989,3 @@ RDSettings::Format RDExportSettingsDialog::GetFormat(QString str)
}
return RDSettings::Pcm16;
}

76
lib/rdexport_settings_dialog.h

@ -23,6 +23,7 @@
#include <qcombobox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qspinbox.h>
#include <rddialog.h>
@ -31,31 +32,56 @@
class RDExportSettingsDialog : public RDDialog
{
Q_OBJECT
public:
RDExportSettingsDialog(RDSettings *settings,QWidget *parent=0);
~RDExportSettingsDialog();
QSize sizeHint() const;
QSizePolicy sizePolicy() const;
private slots:
void formatData(const QString &);
void samprateData(const QString &);
void bitrateData(const QString &);
void okData();
void cancelData();
private:
void ShowBitRates(RDSettings::Format fmt,int samprate,int bitrate,int qual);
void SetCurrentItem(QComboBox *box,int value);
RDSettings::Format GetFormat(QString str);
RDSettings *lib_settings;
QComboBox *lib_format_box;
QComboBox *lib_channels_box;
QLabel *lib_bitrate_label;
QComboBox *lib_bitrate_box;
QComboBox *lib_samprate_box;
QLabel *lib_quality_label;
QSpinBox *lib_quality_spin;
public:
RDExportSettingsDialog(const QString &caption,QWidget *parent=0);
~RDExportSettingsDialog();
QSize sizeHint() const;
QSizePolicy sizePolicy() const;
void setShowNormalizationLevel(bool state);
void setShowAutotrimLevel(bool state);
public slots:
int exec(RDSettings *s,unsigned id=0);
private slots:
void formatData(const QString &);
void samprateData(const QString &);
void bitrateData(const QString &);
void okData();
void cancelData();
protected:
void resizeEvent(QResizeEvent *e);
private:
void ShowBitRates(RDSettings::Format fmt,int samprate,int bitrate,int qual);
void SetCurrentItem(QComboBox *box,int value);
RDSettings::Format GetFormat(QString str);
RDSettings *lib_settings;
QLabel *lib_name_label;
QLineEdit *lib_name_edit;
unsigned lib_id;
QString lib_caption;
QLabel *lib_format_label;
QComboBox *lib_format_box;
QLabel *lib_channels_label;
QComboBox *lib_channels_box;
QLabel *lib_bitrate_label;
QComboBox *lib_bitrate_box;
bool lib_normalization_level_enabled;
QLabel *lib_normalization_level_label;
QSpinBox *lib_normalization_level_spin;
QLabel *lib_normalization_level_unit_label;
bool lib_autotrim_level_enabled;
QLabel *lib_autotrim_level_label;
QSpinBox *lib_autotrim_level_spin;
QLabel *lib_autotrim_level_unit_label;
QLabel *lib_samprate_label;
QComboBox *lib_samprate_box;
QLabel *lib_quality_label;
QSpinBox *lib_quality_spin;
QPushButton *lib_ok_button;
QPushButton *lib_cancel_button;
};

10
lib/rdformpost.cpp

@ -221,6 +221,16 @@ bool RDFormPost::getValue(const QString &name,long *n,bool *ok)
}
bool RDFormPost::getValue(const QString &name,unsigned *n,bool *ok)
{
if(post_values.count(name)>0) {
*n=post_values.at(name).toUInt(ok);
return true;
}
return false;
}
bool RDFormPost::getValue(const QString &name,QDateTime *datetime,bool *ok)
{
QString str;

1
lib/rdformpost.h

@ -48,6 +48,7 @@ class RDFormPost
bool getValue(const QString &name,QString *str,bool *ok=NULL);
bool getValue(const QString &name,int *n,bool *ok=NULL);
bool getValue(const QString &name,long *n,bool *ok=NULL);
bool getValue(const QString &name,unsigned *n,bool *ok=NULL);
bool getValue(const QString &name,QDateTime *datetime,bool *ok=NULL);
bool getValue(const QString &name,QDate *date,bool *ok=NULL);
bool getValue(const QString &name,QTime *time,bool *ok=NULL);

4
lib/rdimport_audio.cpp

@ -451,8 +451,8 @@ void RDImportAudio::selectOutputFileData()
void RDImportAudio::selectOutputFormatData()
{
RDExportSettingsDialog *dialog=
new RDExportSettingsDialog(import_settings,this);
dialog->exec();
new RDExportSettingsDialog(import_caption,this);
dialog->exec(import_settings);
delete dialog;
import_format_edit->setText(import_settings->description());
import_out_filename_edit->

145
lib/rdsettings.cpp

@ -18,6 +18,8 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#include <QObject>
#include <rdsettings.h>
#include <rddb.h>
#include <rdescape_string.h>
@ -28,6 +30,18 @@ RDSettings::RDSettings()
}
QString RDSettings::name() const
{
return set_name;