diff --git a/data/data.qrc b/data/data.qrc
index eaeea7d23..480fdf780 100644
--- a/data/data.qrc
+++ b/data/data.qrc
@@ -305,5 +305,6 @@
providers/musicbrainz.png
last.fm/as_disabled.png
last.fm/as_light.png
+ icons/32x32/tools-wizard.png
diff --git a/data/icons/32x32/tools-wizard.png b/data/icons/32x32/tools-wizard.png
new file mode 100644
index 000000000..34914417c
Binary files /dev/null and b/data/icons/32x32/tools-wizard.png differ
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index bf27ecb22..9301ad5cb 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -215,6 +215,13 @@ set(SOURCES
transcoder/transcodedialog.cpp
transcoder/transcoder.cpp
+ transcoder/transcoderoptionsaac.cpp
+ transcoder/transcoderoptionsdialog.cpp
+ transcoder/transcoderoptionsflac.cpp
+ transcoder/transcoderoptionsmp3.cpp
+ transcoder/transcoderoptionsspeex.cpp
+ transcoder/transcoderoptionsvorbis.cpp
+ transcoder/transcoderoptionswma.cpp
ui/about.cpp
ui/addstreamdialog.cpp
@@ -407,6 +414,8 @@ set(HEADERS
transcoder/transcodedialog.h
transcoder/transcoder.h
+ transcoder/transcoderoptionsdialog.h
+ transcoder/transcoderoptionsmp3.h
ui/about.h
ui/addstreamdialog.h
@@ -489,6 +498,13 @@ set(UI
transcoder/transcodedialog.ui
transcoder/transcodelogdialog.ui
+ transcoder/transcoderoptionsaac.ui
+ transcoder/transcoderoptionsdialog.ui
+ transcoder/transcoderoptionsflac.ui
+ transcoder/transcoderoptionsmp3.ui
+ transcoder/transcoderoptionsspeex.ui
+ transcoder/transcoderoptionsvorbis.ui
+ transcoder/transcoderoptionswma.ui
ui/about.ui
ui/addstreamdialog.ui
diff --git a/src/transcoder/transcodedialog.cpp b/src/transcoder/transcodedialog.cpp
index 78ebd49b5..5a7e2f792 100644
--- a/src/transcoder/transcodedialog.cpp
+++ b/src/transcoder/transcodedialog.cpp
@@ -17,6 +17,7 @@
#include "transcodedialog.h"
#include "transcoder.h"
+#include "transcoderoptionsdialog.h"
#include "ui_transcodedialog.h"
#include "ui_transcodelogdialog.h"
#include "ui/mainwindow.h"
@@ -97,6 +98,7 @@ TranscodeDialog::TranscodeDialog(QWidget *parent)
connect(cancel_button_, SIGNAL(clicked()), SLOT(Cancel()));
connect(close_button_, SIGNAL(clicked()), SLOT(hide()));
connect(ui_->details, SIGNAL(clicked()), log_dialog_, SLOT(show()));
+ connect(ui_->options, SIGNAL(clicked()), SLOT(Options()));
connect(transcoder_, SIGNAL(JobComplete(QString,bool)), SLOT(JobComplete(QString,bool)));
connect(transcoder_, SIGNAL(LogLine(QString)), SLOT(LogLine(QString)));
@@ -243,3 +245,13 @@ void TranscodeDialog::timerEvent(QTimerEvent* e) {
UpdateProgress();
}
}
+
+void TranscodeDialog::Options() {
+ TranscoderPreset preset = ui_->format->itemData(
+ ui_->format->currentIndex()).value();
+
+ TranscoderOptionsDialog dialog(preset.type_, this);
+ if (dialog.is_valid()) {
+ dialog.exec();
+ }
+}
diff --git a/src/transcoder/transcodedialog.h b/src/transcoder/transcodedialog.h
index 539e387a4..ebf70d204 100644
--- a/src/transcoder/transcodedialog.h
+++ b/src/transcoder/transcodedialog.h
@@ -48,6 +48,7 @@ class TranscodeDialog : public QDialog {
void JobComplete(const QString& filename, bool success);
void LogLine(const QString& message);
void AllJobsComplete();
+ void Options();
private:
void SetWorking(bool working);
diff --git a/src/transcoder/transcodedialog.ui b/src/transcoder/transcodedialog.ui
index 29243460d..1b8ede1de 100644
--- a/src/transcoder/transcodedialog.ui
+++ b/src/transcoder/transcodedialog.ui
@@ -14,7 +14,7 @@
Transcode Music
-
+
:/icon.png:/icon.png
@@ -104,7 +104,25 @@
-
-
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+ Options...
+
+
+
+
-
@@ -178,8 +196,6 @@
destination
button_box
-
-
-
+
diff --git a/src/transcoder/transcoder.cpp b/src/transcoder/transcoder.cpp
index ab2999e05..c4a4fea05 100644
--- a/src/transcoder/transcoder.cpp
+++ b/src/transcoder/transcoder.cpp
@@ -20,6 +20,7 @@
#include
#include
#include
+#include
#include
#include
@@ -60,6 +61,8 @@ GstElement* Transcoder::CreateElement(const QString &factory_name,
tr("Could not create the GStreamer element \"%1\" -"
" make sure you have all the required GStreamer plugins installed")
.arg(factory_name));
+ } else {
+ SetElementProperties(factory_name, G_OBJECT(ret));
}
return ret;
@@ -146,8 +149,6 @@ GstElement* Transcoder::CreateElementForMimeType(const QString& element_type,
if (best.name_ == "lamemp3enc") {
// Special case: we need to add xingmux and id3v2mux to the pipeline when
// using lamemp3enc because it doesn't write the VBR or ID3v2 headers itself.
- // We also turn off VBR since it isn't compatible with some music players.
- // TODO: Should make settings like these configurable.
LogLine("Adding xingmux and id3v2mux to the pipeline");
@@ -164,10 +165,6 @@ GstElement* Transcoder::CreateElementForMimeType(const QString& element_type,
return NULL;
}
- // Configure the lame element
- g_object_set(G_OBJECT(lame), "target", 1, NULL); // 1 == bitrate
- g_object_set(G_OBJECT(lame), "cbr", true, NULL);
-
// Link the elements together
gst_element_link_many(lame, xing, id3v2, NULL);
@@ -210,6 +207,17 @@ Transcoder::Transcoder(QObject* parent)
{
if (JobFinishedEvent::sEventType == -1)
JobFinishedEvent::sEventType = QEvent::registerEventType();
+
+ // Initialise some settings for the lamemp3enc element.
+ QSettings s;
+ s.beginGroup("Transcoder/lamemp3enc");
+
+ if (s.value("target").isNull()) {
+ s.setValue("target", 1); // 1 == bitrate
+ }
+ if (s.value("cbr").isNull()) {
+ s.setValue("cbr", true);
+ }
}
QList Transcoder::GetAllPresets() {
@@ -535,3 +543,32 @@ QMap Transcoder::GetProgress() const {
return ret;
}
+
+void Transcoder::SetElementProperties(const QString& name, GObject* object) {
+ QSettings s;
+ s.beginGroup("Transcoder/" + name);
+
+ guint properties_count = 0;
+ GParamSpec** properties = g_object_class_list_properties(
+ G_OBJECT_GET_CLASS(object), &properties_count);
+
+ for (int i=0 ; iname);
+ if (value.isNull())
+ continue;
+
+ LogLine(QString("Setting %1 property: %2 = %3").arg(name, property->name, value.toString()));
+
+ switch (property->value_type) {
+ case G_TYPE_DOUBLE: g_object_set(object, property->name, value.toDouble(), NULL); break;
+ case G_TYPE_FLOAT: g_object_set(object, property->name, value.toFloat(), NULL); break;
+ case G_TYPE_BOOLEAN: g_object_set(object, property->name, value.toInt(), NULL); break;
+ case G_TYPE_INT:
+ default: g_object_set(object, property->name, value.toInt(), NULL); break;
+ }
+ }
+
+ g_free(properties);
+}
diff --git a/src/transcoder/transcoder.h b/src/transcoder/transcoder.h
index 940b728db..fbcb77bb7 100644
--- a/src/transcoder/transcoder.h
+++ b/src/transcoder/transcoder.h
@@ -129,6 +129,7 @@ class Transcoder : public QObject {
GstElement* CreateElementForMimeType(const QString& element_type,
const QString& mime_type,
GstElement* bin = NULL);
+ void SetElementProperties(const QString& name, GObject* element);
static void NewPadCallback(GstElement*, GstPad* pad, gboolean, gpointer data);
static gboolean BusCallback(GstBus*, GstMessage* msg, gpointer data);
diff --git a/src/transcoder/transcoderoptionsaac.cpp b/src/transcoder/transcoderoptionsaac.cpp
new file mode 100644
index 000000000..0f5751396
--- /dev/null
+++ b/src/transcoder/transcoderoptionsaac.cpp
@@ -0,0 +1,56 @@
+/* This file is part of Clementine.
+ Copyright 2010, David Sansome
+
+ Clementine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Clementine 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 Clementine. If not, see .
+*/
+
+#include "transcoderoptionsaac.h"
+#include "ui_transcoderoptionsaac.h"
+
+#include
+
+const char* TranscoderOptionsAAC::kSettingsGroup = "Transcoder/faac";
+
+TranscoderOptionsAAC::TranscoderOptionsAAC(QWidget* parent)
+ : TranscoderOptionsInterface(parent),
+ ui_(new Ui_TranscoderOptionsAAC)
+{
+ ui_->setupUi(this);
+}
+
+TranscoderOptionsAAC::~TranscoderOptionsAAC() {
+ delete ui_;
+}
+
+void TranscoderOptionsAAC::Load() {
+ QSettings s;
+ s.beginGroup(kSettingsGroup);
+
+ ui_->bitrate_slider->setValue(s.value("bitrate", 128000).toInt() / 1000);
+ ui_->profile->setCurrentIndex(s.value("profile", 2).toInt() - 1);
+ ui_->tns->setChecked(s.value("tns", false).toBool());
+ ui_->midside->setChecked(s.value("midside", true).toBool());
+ ui_->shortctl->setCurrentIndex(s.value("shortctl", 0).toInt());
+}
+
+void TranscoderOptionsAAC::Save() {
+ QSettings s;
+ s.beginGroup(kSettingsGroup);
+
+ s.setValue("bitrate", ui_->bitrate_slider->value() * 1000);
+ s.setValue("profile", ui_->profile->currentIndex() + 1);
+ s.setValue("tns", ui_->tns->isChecked());
+ s.setValue("midside", ui_->midside->isChecked());
+ s.setValue("shortctl", ui_->shortctl->currentIndex());
+}
diff --git a/src/transcoder/transcoderoptionsaac.h b/src/transcoder/transcoderoptionsaac.h
new file mode 100644
index 000000000..6710904bd
--- /dev/null
+++ b/src/transcoder/transcoderoptionsaac.h
@@ -0,0 +1,39 @@
+/* This file is part of Clementine.
+ Copyright 2010, David Sansome
+
+ Clementine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Clementine 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 Clementine. If not, see .
+*/
+
+#ifndef TRANSCODEROPTIONSAAC_H
+#define TRANSCODEROPTIONSAAC_H
+
+#include "transcoderoptionsinterface.h"
+
+class Ui_TranscoderOptionsAAC;
+
+class TranscoderOptionsAAC : public TranscoderOptionsInterface {
+public:
+ TranscoderOptionsAAC(QWidget* parent = 0);
+ ~TranscoderOptionsAAC();
+
+ void Load();
+ void Save();
+
+private:
+ static const char* kSettingsGroup;
+
+ Ui_TranscoderOptionsAAC* ui_;
+};
+
+#endif // TRANSCODEROPTIONSAAC_H
diff --git a/src/transcoder/transcoderoptionsaac.ui b/src/transcoder/transcoderoptionsaac.ui
new file mode 100644
index 000000000..9463d276e
--- /dev/null
+++ b/src/transcoder/transcoderoptionsaac.ui
@@ -0,0 +1,185 @@
+
+
+ TranscoderOptionsAAC
+
+
+
+ 0
+ 0
+ 480
+ 344
+
+
+
+ Form
+
+
+
-
+
+
+ Bitrate
+
+
+
+ -
+
+
-
+
+
+ 8
+
+
+ 320
+
+
+ 128
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+ kbps
+
+
+ 8
+
+
+ 320
+
+
+ 8
+
+
+ 128
+
+
+
+
+
+ -
+
+
+ Profile
+
+
+
+ -
+
+
+ 1
+
+
-
+
+ Main profile (MAIN)
+
+
+ -
+
+ Low complexity profile (LC)
+
+
+ -
+
+ Scalable sampling rate profile (SSR)
+
+
+ -
+
+ Long term prediction profile (LTP)
+
+
+
+
+ -
+
+
+ Use temporal noise shaping
+
+
+
+ -
+
+
+ Allow mid/side encoding
+
+
+ true
+
+
+
+ -
+
+
+ Block type
+
+
+
+ -
+
+
-
+
+ Normal block type
+
+
+ -
+
+ No short blocks
+
+
+ -
+
+ No long blocks
+
+
+
+
+
+
+
+ bitrate_slider
+ bitrate_spinbox
+ profile
+ shortctl
+ tns
+ midside
+
+
+
+
+ bitrate_slider
+ valueChanged(int)
+ bitrate_spinbox
+ setValue(int)
+
+
+ 170
+ 29
+
+
+ 445
+ 24
+
+
+
+
+ bitrate_spinbox
+ valueChanged(int)
+ bitrate_slider
+ setValue(int)
+
+
+ 407
+ 18
+
+
+ 191
+ 29
+
+
+
+
+
diff --git a/src/transcoder/transcoderoptionsdialog.cpp b/src/transcoder/transcoderoptionsdialog.cpp
new file mode 100644
index 000000000..f0e3661c8
--- /dev/null
+++ b/src/transcoder/transcoderoptionsdialog.cpp
@@ -0,0 +1,70 @@
+/* This file is part of Clementine.
+ Copyright 2010, David Sansome
+
+ Clementine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Clementine 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 Clementine. If not, see .
+*/
+
+#include "transcoderoptionsaac.h"
+#include "transcoderoptionsdialog.h"
+#include "transcoderoptionsflac.h"
+#include "transcoderoptionsmp3.h"
+#include "transcoderoptionsspeex.h"
+#include "transcoderoptionsvorbis.h"
+#include "transcoderoptionswma.h"
+#include "ui_transcoderoptionsdialog.h"
+
+TranscoderOptionsDialog::TranscoderOptionsDialog(Song::FileType type, QWidget* parent)
+ : QDialog(parent),
+ ui_(new Ui_TranscoderOptionsDialog),
+ options_(NULL)
+{
+ ui_->setupUi(this);
+
+ switch (type) {
+ case Song::Type_Flac:
+ case Song::Type_OggFlac: options_ = new TranscoderOptionsFlac(this); break;
+ case Song::Type_Mp4: options_ = new TranscoderOptionsAAC(this); break;
+ case Song::Type_Mpeg: options_ = new TranscoderOptionsMP3(this); break;
+ case Song::Type_OggVorbis: options_ = new TranscoderOptionsVorbis(this); break;
+ case Song::Type_OggSpeex: options_ = new TranscoderOptionsSpeex(this); break;
+ case Song::Type_Asf: options_ = new TranscoderOptionsWma(this); break;
+ default:
+ break;
+ }
+
+ if (options_) {
+ setWindowTitle(windowTitle() + " - " + Song::TextForFiletype(type));
+ options_->layout()->setContentsMargins(0, 0, 0, 0);
+ ui_->verticalLayout->insertWidget(0, options_);
+ resize(width(), minimumHeight());
+ }
+}
+
+TranscoderOptionsDialog::~TranscoderOptionsDialog() {
+ delete ui_;
+}
+
+void TranscoderOptionsDialog::showEvent(QShowEvent* e) {
+ if (options_) {
+ options_->Load();
+ }
+}
+
+void TranscoderOptionsDialog::accept() {
+ if (options_) {
+ options_->Save();
+ }
+ QDialog::accept();
+}
+
diff --git a/src/transcoder/transcoderoptionsdialog.h b/src/transcoder/transcoderoptionsdialog.h
new file mode 100644
index 000000000..4f033f378
--- /dev/null
+++ b/src/transcoder/transcoderoptionsdialog.h
@@ -0,0 +1,47 @@
+/* This file is part of Clementine.
+ Copyright 2010, David Sansome
+
+ Clementine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Clementine 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 Clementine. If not, see .
+*/
+
+#ifndef TRANSCODEROPTIONSDIALOG_H
+#define TRANSCODEROPTIONSDIALOG_H
+
+#include
+
+#include "transcoderoptionsinterface.h"
+#include "core/song.h"
+
+class Ui_TranscoderOptionsDialog;
+
+class TranscoderOptionsDialog : public QDialog {
+ Q_OBJECT
+
+public:
+ TranscoderOptionsDialog(Song::FileType type, QWidget* parent = 0);
+ ~TranscoderOptionsDialog();
+
+ bool is_valid() const { return options_; }
+
+ void accept();
+
+protected:
+ void showEvent(QShowEvent* e);
+
+private:
+ Ui_TranscoderOptionsDialog* ui_;
+ TranscoderOptionsInterface* options_;
+};
+
+#endif // TRANSCODEROPTIONSDIALOG_H
diff --git a/src/transcoder/transcoderoptionsdialog.ui b/src/transcoder/transcoderoptionsdialog.ui
new file mode 100644
index 000000000..9bc4844a9
--- /dev/null
+++ b/src/transcoder/transcoderoptionsdialog.ui
@@ -0,0 +1,64 @@
+
+
+ TranscoderOptionsDialog
+
+
+
+ 0
+ 0
+ 400
+ 300
+
+
+
+ Transcoding options
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QDialogButtonBox::Cancel|QDialogButtonBox::Ok
+
+
+
+
+
+
+
+
+ buttonBox
+ accepted()
+ TranscoderOptionsDialog
+ accept()
+
+
+ 248
+ 254
+
+
+ 157
+ 274
+
+
+
+
+ buttonBox
+ rejected()
+ TranscoderOptionsDialog
+ reject()
+
+
+ 316
+ 260
+
+
+ 286
+ 274
+
+
+
+
+
diff --git a/src/transcoder/transcoderoptionsflac.cpp b/src/transcoder/transcoderoptionsflac.cpp
new file mode 100644
index 000000000..ee73175ed
--- /dev/null
+++ b/src/transcoder/transcoderoptionsflac.cpp
@@ -0,0 +1,48 @@
+/* This file is part of Clementine.
+ Copyright 2010, David Sansome
+
+ Clementine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Clementine 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 Clementine. If not, see .
+*/
+
+#include "transcoderoptionsflac.h"
+#include "ui_transcoderoptionsflac.h"
+
+#include
+
+const char* TranscoderOptionsFlac::kSettingsGroup = "Transcoder/flacenc";
+
+TranscoderOptionsFlac::TranscoderOptionsFlac(QWidget* parent)
+ : TranscoderOptionsInterface(parent),
+ ui_(new Ui_TranscoderOptionsFlac)
+{
+ ui_->setupUi(this);
+}
+
+TranscoderOptionsFlac::~TranscoderOptionsFlac() {
+ delete ui_;
+}
+
+void TranscoderOptionsFlac::Load() {
+ QSettings s;
+ s.beginGroup(kSettingsGroup);
+
+ ui_->quality->setValue(s.value("quality", 5).toInt());
+}
+
+void TranscoderOptionsFlac::Save() {
+ QSettings s;
+ s.beginGroup(kSettingsGroup);
+
+ s.setValue("quality", ui_->quality->value());
+}
diff --git a/src/transcoder/transcoderoptionsflac.h b/src/transcoder/transcoderoptionsflac.h
new file mode 100644
index 000000000..ae410327b
--- /dev/null
+++ b/src/transcoder/transcoderoptionsflac.h
@@ -0,0 +1,39 @@
+/* This file is part of Clementine.
+ Copyright 2010, David Sansome
+
+ Clementine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Clementine 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 Clementine. If not, see .
+*/
+
+#ifndef TRANSCODEROPTIONSFLAC_H
+#define TRANSCODEROPTIONSFLAC_H
+
+#include "transcoderoptionsinterface.h"
+
+class Ui_TranscoderOptionsFlac;
+
+class TranscoderOptionsFlac : public TranscoderOptionsInterface {
+public:
+ TranscoderOptionsFlac(QWidget* parent = 0);
+ ~TranscoderOptionsFlac();
+
+ void Load();
+ void Save();
+
+private:
+ static const char* kSettingsGroup;
+
+ Ui_TranscoderOptionsFlac* ui_;
+};
+
+#endif // TRANSCODEROPTIONSFLAC_H
diff --git a/src/transcoder/transcoderoptionsflac.ui b/src/transcoder/transcoderoptionsflac.ui
new file mode 100644
index 000000000..9eaae5cc7
--- /dev/null
+++ b/src/transcoder/transcoderoptionsflac.ui
@@ -0,0 +1,62 @@
+
+
+ TranscoderOptionsFlac
+
+
+
+ 0
+ 0
+ 400
+ 102
+
+
+
+ Form
+
+
+ -
+
+
+ Quality
+
+
+
+ -
+
+
-
+
+
+ Fast
+
+
+
+ -
+
+
+ 9
+
+
+ 5
+
+
+ Qt::Horizontal
+
+
+ QSlider::TicksBelow
+
+
+
+ -
+
+
+ Best
+
+
+
+
+
+
+
+
+
+
diff --git a/src/transcoder/transcoderoptionsinterface.h b/src/transcoder/transcoderoptionsinterface.h
new file mode 100644
index 000000000..11d6740fc
--- /dev/null
+++ b/src/transcoder/transcoderoptionsinterface.h
@@ -0,0 +1,32 @@
+/* This file is part of Clementine.
+ Copyright 2010, David Sansome
+
+ Clementine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Clementine 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 Clementine. If not, see .
+*/
+
+#ifndef TRANSCODEROPTIONSINTERFACE_H
+#define TRANSCODEROPTIONSINTERFACE_H
+
+#include
+
+class TranscoderOptionsInterface : public QWidget {
+public:
+ TranscoderOptionsInterface(QWidget* parent) : QWidget(parent) {}
+ virtual ~TranscoderOptionsInterface() {}
+
+ virtual void Load() = 0;
+ virtual void Save() = 0;
+};
+
+#endif // TRANSCODEROPTIONSINTERFACE_H
diff --git a/src/transcoder/transcoderoptionsmp3.cpp b/src/transcoder/transcoderoptionsmp3.cpp
new file mode 100644
index 000000000..827405598
--- /dev/null
+++ b/src/transcoder/transcoderoptionsmp3.cpp
@@ -0,0 +1,74 @@
+/* This file is part of Clementine.
+ Copyright 2010, David Sansome
+
+ Clementine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Clementine 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 Clementine. If not, see .
+*/
+
+#include "transcoderoptionsmp3.h"
+#include "ui_transcoderoptionsmp3.h"
+
+#include
+
+const char* TranscoderOptionsMP3::kSettingsGroup = "Transcoder/lamemp3enc";
+
+TranscoderOptionsMP3::TranscoderOptionsMP3(QWidget* parent)
+ : TranscoderOptionsInterface(parent),
+ ui_(new Ui_TranscoderOptionsMP3)
+{
+ ui_->setupUi(this);
+
+ connect(ui_->quality_slider, SIGNAL(valueChanged(int)), SLOT(QualitySliderChanged(int)));
+ connect(ui_->quality_spinbox, SIGNAL(valueChanged(double)), SLOT(QualitySpinboxChanged(double)));
+}
+
+TranscoderOptionsMP3::~TranscoderOptionsMP3() {
+ delete ui_;
+}
+
+void TranscoderOptionsMP3::Load() {
+ QSettings s;
+ s.beginGroup(kSettingsGroup);;
+
+ if (s.value("target", 1).toInt() == 0) {
+ ui_->target_quality->setChecked(true);
+ } else {
+ ui_->target_bitrate->setChecked(true);
+ }
+
+ ui_->quality_spinbox->setValue(s.value("quality", 4.0).toFloat());
+ ui_->bitrate_slider->setValue(s.value("bitrate", 128).toInt());
+ ui_->cbr->setChecked(s.value("cbr", true).toBool());
+ ui_->encoding_engine_quality->setCurrentIndex(s.value("encoding-engine-quality", 1).toInt());
+ ui_->mono->setChecked(s.value("mono", false).toBool());
+}
+
+void TranscoderOptionsMP3::Save() {
+ QSettings s;
+ s.beginGroup(kSettingsGroup);
+
+ s.setValue("target", ui_->target_quality->isChecked() ? 0 : 1);
+ s.setValue("quality", ui_->quality_spinbox->value());
+ s.setValue("bitrate", ui_->bitrate_slider->value());
+ s.setValue("cbr", ui_->cbr->isChecked());
+ s.setValue("encoding-engine-quality", ui_->encoding_engine_quality->currentIndex());
+ s.setValue("mono", ui_->mono->isChecked());
+}
+
+void TranscoderOptionsMP3::QualitySliderChanged(int value) {
+ ui_->quality_spinbox->setValue(float(value) / 100);
+}
+
+void TranscoderOptionsMP3::QualitySpinboxChanged(double value) {
+ ui_->quality_slider->setValue(value * 100);
+}
diff --git a/src/transcoder/transcoderoptionsmp3.h b/src/transcoder/transcoderoptionsmp3.h
new file mode 100644
index 000000000..161643e48
--- /dev/null
+++ b/src/transcoder/transcoderoptionsmp3.h
@@ -0,0 +1,45 @@
+/* This file is part of Clementine.
+ Copyright 2010, David Sansome
+
+ Clementine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Clementine 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 Clementine. If not, see .
+*/
+
+#ifndef TRANSCODEROPTIONSMP3_H
+#define TRANSCODEROPTIONSMP3_H
+
+#include "transcoderoptionsinterface.h"
+
+class Ui_TranscoderOptionsMP3;
+
+class TranscoderOptionsMP3 : public TranscoderOptionsInterface {
+ Q_OBJECT
+
+public:
+ TranscoderOptionsMP3(QWidget* parent = 0);
+ ~TranscoderOptionsMP3();
+
+ void Load();
+ void Save();
+
+private slots:
+ void QualitySliderChanged(int value);
+ void QualitySpinboxChanged(double value);
+
+private:
+ static const char* kSettingsGroup;
+
+ Ui_TranscoderOptionsMP3* ui_;
+};
+
+#endif // TRANSCODEROPTIONSMP3_H
diff --git a/src/transcoder/transcoderoptionsmp3.ui b/src/transcoder/transcoderoptionsmp3.ui
new file mode 100644
index 000000000..0933a54fc
--- /dev/null
+++ b/src/transcoder/transcoderoptionsmp3.ui
@@ -0,0 +1,291 @@
+
+
+ TranscoderOptionsMP3
+
+
+
+ 0
+ 0
+ 557
+ 486
+
+
+
+ Form
+
+
+ -
+
+
+ Optimize for quality
+
+
+ false
+
+
+
+ -
+
+
+ false
+
+
+
+ 32
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ Quality
+
+
+
+ -
+
+
-
+
+
+ 999
+
+
+ 400
+
+
+ Qt::Horizontal
+
+
+ QSlider::TicksBelow
+
+
+ 100
+
+
+
+ -
+
+
+ 9.990000000000000
+
+
+ 4.000000000000000
+
+
+
+
+
+
+
+
+ -
+
+
+ Optimize for bitrate
+
+
+ true
+
+
+
+ -
+
+
+
+ 32
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ Bitrate
+
+
+
+ -
+
+
-
+
+
+ 8
+
+
+ 320
+
+
+ 128
+
+
+ Qt::Horizontal
+
+
+ QSlider::TicksBelow
+
+
+ 32
+
+
+
+ -
+
+
+ kbps
+
+
+ 8
+
+
+ 320
+
+
+ 8
+
+
+ 128
+
+
+
+
+
+ -
+
+
+ Constant bitrate
+
+
+
+
+
+
+ -
+
+
+ Encoding engine quality
+
+
+
+ -
+
+
+ 1
+
+
-
+
+ Fast
+
+
+ -
+
+ Standard
+
+
+ -
+
+ High
+
+
+
+
+ -
+
+
+ Force mono encoding
+
+
+
+
+
+
+ target_quality
+ quality_slider
+ quality_spinbox
+ target_bitrate
+ bitrate_slider
+ bitrate_spinbox
+ cbr
+ encoding_engine_quality
+ mono
+
+
+
+
+ bitrate_slider
+ valueChanged(int)
+ bitrate_spinbox
+ setValue(int)
+
+
+ 191
+ 109
+
+
+ 492
+ 115
+
+
+
+
+ bitrate_spinbox
+ valueChanged(int)
+ bitrate_slider
+ setValue(int)
+
+
+ 485
+ 115
+
+
+ 182
+ 113
+
+
+
+
+ target_quality
+ toggled(bool)
+ widget
+ setEnabled(bool)
+
+
+ 65
+ 23
+
+
+ 20
+ 49
+
+
+
+
+ target_bitrate
+ toggled(bool)
+ widget_2
+ setEnabled(bool)
+
+
+ 46
+ 87
+
+
+ 22
+ 122
+
+
+
+
+
diff --git a/src/transcoder/transcoderoptionsspeex.cpp b/src/transcoder/transcoderoptionsspeex.cpp
new file mode 100644
index 000000000..02dd0ab49
--- /dev/null
+++ b/src/transcoder/transcoderoptionsspeex.cpp
@@ -0,0 +1,64 @@
+/* This file is part of Clementine.
+ Copyright 2010, David Sansome
+
+ Clementine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Clementine 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 Clementine. If not, see .
+*/
+
+#include "transcoderoptionsspeex.h"
+#include "ui_transcoderoptionsspeex.h"
+
+#include
+
+const char* TranscoderOptionsSpeex::kSettingsGroup = "Transcoder/speexenc";
+
+TranscoderOptionsSpeex::TranscoderOptionsSpeex(QWidget* parent)
+ : TranscoderOptionsInterface(parent),
+ ui_(new Ui_TranscoderOptionsSpeex)
+{
+ ui_->setupUi(this);
+}
+
+TranscoderOptionsSpeex::~TranscoderOptionsSpeex() {
+ delete ui_;
+}
+
+void TranscoderOptionsSpeex::Load() {
+ QSettings s;
+ s.beginGroup(kSettingsGroup);
+
+ ui_->quality_slider->setValue(s.value("quality", 8).toInt());
+ ui_->bitrate_slider->setValue(s.value("bitrate", 0).toInt() / 1000);
+ ui_->mode->setCurrentIndex(s.value("mode", 0).toInt());
+ ui_->vbr->setChecked(s.value("vbr", false).toBool());
+ ui_->abr_slider->setValue(s.value("abr", 0).toInt() / 1000);
+ ui_->vad->setChecked(s.value("vad", false).toBool());
+ ui_->dtx->setChecked(s.value("dtx", false).toBool());
+ ui_->complexity->setValue(s.value("complexity", 3).toInt());
+ ui_->nframes->setValue(s.value("nframes", 1).toInt());
+}
+
+void TranscoderOptionsSpeex::Save() {
+ QSettings s;
+ s.beginGroup(kSettingsGroup);
+
+ s.setValue("quality", ui_->quality_slider->value());
+ s.setValue("bitrate", ui_->bitrate_slider->value() * 1000);
+ s.setValue("mode", ui_->mode->currentIndex());
+ s.setValue("vbr", ui_->vbr->isChecked());
+ s.setValue("abr", ui_->abr_slider->value() * 1000);
+ s.setValue("vad", ui_->vad->isChecked());
+ s.setValue("dtx", ui_->dtx->isChecked());
+ s.setValue("complexity", ui_->complexity->value());
+ s.setValue("nframes", ui_->nframes->value());
+}
diff --git a/src/transcoder/transcoderoptionsspeex.h b/src/transcoder/transcoderoptionsspeex.h
new file mode 100644
index 000000000..40662cbe4
--- /dev/null
+++ b/src/transcoder/transcoderoptionsspeex.h
@@ -0,0 +1,39 @@
+/* This file is part of Clementine.
+ Copyright 2010, David Sansome
+
+ Clementine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Clementine 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 Clementine. If not, see .
+*/
+
+#ifndef TRANSCODEROPTIONSSPEEX_H
+#define TRANSCODEROPTIONSSPEEX_H
+
+#include "transcoderoptionsinterface.h"
+
+class Ui_TranscoderOptionsSpeex;
+
+class TranscoderOptionsSpeex : public TranscoderOptionsInterface {
+public:
+ TranscoderOptionsSpeex(QWidget* parent = 0);
+ ~TranscoderOptionsSpeex();
+
+ void Load();
+ void Save();
+
+private:
+ static const char* kSettingsGroup;
+
+ Ui_TranscoderOptionsSpeex* ui_;
+};
+
+#endif // TRANSCODEROPTIONSSPEEX_H
diff --git a/src/transcoder/transcoderoptionsspeex.ui b/src/transcoder/transcoderoptionsspeex.ui
new file mode 100644
index 000000000..f66d89ed6
--- /dev/null
+++ b/src/transcoder/transcoderoptionsspeex.ui
@@ -0,0 +1,353 @@
+
+
+ TranscoderOptionsSpeex
+
+
+
+ 0
+ 0
+ 555
+ 424
+
+
+
+ Form
+
+
+ -
+
+
+ Quality
+
+
+
+ -
+
+
-
+
+
+ 10
+
+
+ 8
+
+
+ Qt::Horizontal
+
+
+ QSlider::TicksBelow
+
+
+
+ -
+
+
+ 10
+
+
+ 8
+
+
+
+
+
+ -
+
+
+ Bitrate
+
+
+
+ -
+
+
-
+
+
+ 320
+
+
+ 8
+
+
+ 32
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+
+ 100
+ 0
+
+
+
+ automatic
+
+
+ kbps
+
+
+ 320
+
+
+ 8
+
+
+
+
+
+ -
+
+
+ Average bitrate
+
+
+
+ -
+
+
-
+
+
+ 320
+
+
+ 8
+
+
+ 32
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+
+ 100
+ 0
+
+
+
+ disabled
+
+
+ kbps
+
+
+ 320
+
+
+ 8
+
+
+
+
+
+ -
+
+
+ Encoding mode
+
+
+
+ -
+
+
-
+
+ Auto
+
+
+ -
+
+ Ultra wide band (UWB)
+
+
+ -
+
+ Wide band (WB)
+
+
+ -
+
+ Narrow band (NB)
+
+
+
+
+ -
+
+
+ Variable bit rate
+
+
+
+ -
+
+
+ Voice activity detection
+
+
+
+ -
+
+
+ Discontinuous transmission
+
+
+
+ -
+
+
+ Encoding complexity
+
+
+
+ -
+
+
+ 10000
+
+
+ 3
+
+
+
+ -
+
+
+ Frames per buffer
+
+
+
+ -
+
+
+ 10000
+
+
+ 1
+
+
+
+
+
+
+ quality_slider
+ quality_spinbox
+ bitrate_slider
+ bitrate_spinbox
+ abr_slider
+ abr_spinbox
+ mode
+ vbr
+ vad
+ dtx
+ complexity
+ nframes
+
+
+
+
+ quality_slider
+ valueChanged(int)
+ quality_spinbox
+ setValue(int)
+
+
+ 232
+ 29
+
+
+ 525
+ 23
+
+
+
+
+ quality_spinbox
+ valueChanged(int)
+ quality_slider
+ setValue(int)
+
+
+ 517
+ 25
+
+
+ 248
+ 31
+
+
+
+
+ bitrate_slider
+ valueChanged(int)
+ bitrate_spinbox
+ setValue(int)
+
+
+ 185
+ 66
+
+
+ 445
+ 51
+
+
+
+
+ bitrate_spinbox
+ valueChanged(int)
+ bitrate_slider
+ setValue(int)
+
+
+ 471
+ 68
+
+
+ 214
+ 56
+
+
+
+
+ abr_slider
+ valueChanged(int)
+ abr_spinbox
+ setValue(int)
+
+
+ 323
+ 90
+
+
+ 500
+ 95
+
+
+
+
+ abr_spinbox
+ valueChanged(int)
+ abr_slider
+ setValue(int)
+
+
+ 493
+ 84
+
+
+ 339
+ 94
+
+
+
+
+
diff --git a/src/transcoder/transcoderoptionsvorbis.cpp b/src/transcoder/transcoderoptionsvorbis.cpp
new file mode 100644
index 000000000..3914ea711
--- /dev/null
+++ b/src/transcoder/transcoderoptionsvorbis.cpp
@@ -0,0 +1,74 @@
+/* This file is part of Clementine.
+ Copyright 2010, David Sansome
+
+ Clementine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Clementine 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 Clementine. If not, see .
+*/
+
+#include "transcoderoptionsvorbis.h"
+#include "ui_transcoderoptionsvorbis.h"
+
+#include
+
+const char* TranscoderOptionsVorbis::kSettingsGroup = "Transcoder/vorbisenc";
+
+TranscoderOptionsVorbis::TranscoderOptionsVorbis(QWidget* parent)
+ : TranscoderOptionsInterface(parent),
+ ui_(new Ui_TranscoderOptionsVorbis)
+{
+ ui_->setupUi(this);
+}
+
+TranscoderOptionsVorbis::~TranscoderOptionsVorbis() {
+ delete ui_;
+}
+
+void TranscoderOptionsVorbis::Load() {
+ QSettings s;
+ s.beginGroup(kSettingsGroup);
+
+#define GET_BITRATE(variable, property) \
+ int variable = s.value(property, -1).toInt(); \
+ variable = variable == -1 ? 0 : variable / 1000
+
+ GET_BITRATE(bitrate, "bitrate");
+ GET_BITRATE(min_bitrate, "min-bitrate");
+ GET_BITRATE(max_bitrate, "max-bitrate");
+#undef GET_BITRATE
+
+ ui_->quality_slider->setValue(s.value("quality", 0.3).toDouble() * 10);
+ ui_->managed->setChecked(s.value("managed", false).toBool());
+ ui_->max_bitrate_slider->setValue(max_bitrate);
+ ui_->min_bitrate_slider->setValue(min_bitrate);
+ ui_->bitrate_slider->setValue(bitrate);
+}
+
+void TranscoderOptionsVorbis::Save() {
+ QSettings s;
+ s.beginGroup(kSettingsGroup);
+
+#define GET_BITRATE(variable, ui_slider) \
+ int variable = ui_slider->value(); \
+ variable = variable == 0 ? -1 : variable * 1000
+
+ GET_BITRATE(bitrate, ui_->bitrate_slider);
+ GET_BITRATE(min_bitrate, ui_->min_bitrate_slider);
+ GET_BITRATE(max_bitrate, ui_->max_bitrate_slider);
+#undef GET_BITRATE
+
+ s.setValue("quality", double(ui_->quality_slider->value()) / 10);
+ s.setValue("managed", ui_->managed->isChecked());
+ s.setValue("bitrate", bitrate);
+ s.setValue("min-bitrate", min_bitrate);
+ s.setValue("max-bitrate", max_bitrate);
+}
diff --git a/src/transcoder/transcoderoptionsvorbis.h b/src/transcoder/transcoderoptionsvorbis.h
new file mode 100644
index 000000000..62c14d288
--- /dev/null
+++ b/src/transcoder/transcoderoptionsvorbis.h
@@ -0,0 +1,39 @@
+/* This file is part of Clementine.
+ Copyright 2010, David Sansome
+
+ Clementine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Clementine 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 Clementine. If not, see .
+*/
+
+#ifndef TRANSCODEROPTIONSVORBIS_H
+#define TRANSCODEROPTIONSVORBIS_H
+
+#include "transcoderoptionsinterface.h"
+
+class Ui_TranscoderOptionsVorbis;
+
+class TranscoderOptionsVorbis : public TranscoderOptionsInterface {
+public:
+ TranscoderOptionsVorbis(QWidget* parent = 0);
+ ~TranscoderOptionsVorbis();
+
+ void Load();
+ void Save();
+
+private:
+ static const char* kSettingsGroup;
+
+ Ui_TranscoderOptionsVorbis* ui_;
+};
+
+#endif // TRANSCODEROPTIONSVORBIS_H
diff --git a/src/transcoder/transcoderoptionsvorbis.ui b/src/transcoder/transcoderoptionsvorbis.ui
new file mode 100644
index 000000000..809a959e2
--- /dev/null
+++ b/src/transcoder/transcoderoptionsvorbis.ui
@@ -0,0 +1,365 @@
+
+
+ TranscoderOptionsVorbis
+
+
+
+ 0
+ 0
+ 400
+ 300
+
+
+
+ Form
+
+
+ -
+
+
+ Quality
+
+
+
+ -
+
+
-
+
+
+ -1
+
+
+ 10
+
+
+ 3
+
+
+ Qt::Horizontal
+
+
+ QSlider::TicksBelow
+
+
+
+ -
+
+
+ -1
+
+
+ 10
+
+
+ 3
+
+
+
+
+
+ -
+
+
+ Use bitrate management engine
+
+
+
+ -
+
+
+ false
+
+
+
+ 32
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ Target bitrate
+
+
+
+ -
+
+
-
+
+
+ 250
+
+
+ 128
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+ kbps
+
+
+ 250
+
+
+ 128
+
+
+
+
+
+ -
+
+
+ Minimum bitrate
+
+
+
+ -
+
+
-
+
+
+ 250
+
+
+ 0
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+ disabled
+
+
+ kbps
+
+
+ 250
+
+
+ 0
+
+
+
+
+
+ -
+
+
+ Maximum bitrate
+
+
+
+ -
+
+
-
+
+
+ 250
+
+
+ 0
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+ disabled
+
+
+ kbps
+
+
+ 250
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+ quality_slider
+ quality_spinbox
+ managed
+ bitrate_slider
+ bitrate_spinbox
+ min_bitrate_slider
+ min_bitrate_spinbox
+ max_bitrate_slider
+ max_bitrate_spinbox
+
+
+
+
+ quality_slider
+ valueChanged(int)
+ quality_spinbox
+ setValue(int)
+
+
+ 176
+ 29
+
+
+ 365
+ 31
+
+
+
+
+ quality_spinbox
+ valueChanged(int)
+ quality_slider
+ setValue(int)
+
+
+ 358
+ 19
+
+
+ 136
+ 29
+
+
+
+
+ bitrate_slider
+ valueChanged(int)
+ bitrate_spinbox
+ setValue(int)
+
+
+ 255
+ 83
+
+
+ 344
+ 88
+
+
+
+
+ bitrate_spinbox
+ valueChanged(int)
+ bitrate_slider
+ setValue(int)
+
+
+ 341
+ 77
+
+
+ 244
+ 80
+
+
+
+
+ min_bitrate_spinbox
+ valueChanged(int)
+ min_bitrate_slider
+ setValue(int)
+
+
+ 324
+ 122
+
+
+ 265
+ 115
+
+
+
+
+ min_bitrate_slider
+ valueChanged(int)
+ min_bitrate_spinbox
+ setValue(int)
+
+
+ 217
+ 122
+
+
+ 347
+ 124
+
+
+
+
+ max_bitrate_slider
+ valueChanged(int)
+ max_bitrate_spinbox
+ setValue(int)
+
+
+ 278
+ 157
+
+
+ 323
+ 155
+
+
+
+
+ max_bitrate_spinbox
+ valueChanged(int)
+ max_bitrate_slider
+ setValue(int)
+
+
+ 344
+ 166
+
+
+ 216
+ 155
+
+
+
+
+ managed
+ toggled(bool)
+ widget
+ setEnabled(bool)
+
+
+ 55
+ 58
+
+
+ 25
+ 86
+
+
+
+
+
diff --git a/src/transcoder/transcoderoptionswma.cpp b/src/transcoder/transcoderoptionswma.cpp
new file mode 100644
index 000000000..3b24c51a6
--- /dev/null
+++ b/src/transcoder/transcoderoptionswma.cpp
@@ -0,0 +1,48 @@
+/* This file is part of Clementine.
+ Copyright 2010, David Sansome
+
+ Clementine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Clementine 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 Clementine. If not, see .
+*/
+
+#include "transcoderoptionswma.h"
+#include "ui_transcoderoptionswma.h"
+
+#include
+
+const char* TranscoderOptionsWma::kSettingsGroup = "Transcoder/ffenc_wmav2";
+
+TranscoderOptionsWma::TranscoderOptionsWma(QWidget* parent)
+ : TranscoderOptionsInterface(parent),
+ ui_(new Ui_TranscoderOptionsWma)
+{
+ ui_->setupUi(this);
+}
+
+TranscoderOptionsWma::~TranscoderOptionsWma() {
+ delete ui_;
+}
+
+void TranscoderOptionsWma::Load() {
+ QSettings s;
+ s.beginGroup(kSettingsGroup);
+
+ ui_->bitrate_slider->setValue(s.value("bitrate", 128000).toInt() / 1000);
+}
+
+void TranscoderOptionsWma::Save() {
+ QSettings s;
+ s.beginGroup(kSettingsGroup);
+
+ s.setValue("bitrate", ui_->bitrate_slider->value() * 1000);
+}
diff --git a/src/transcoder/transcoderoptionswma.h b/src/transcoder/transcoderoptionswma.h
new file mode 100644
index 000000000..8ae4c19fb
--- /dev/null
+++ b/src/transcoder/transcoderoptionswma.h
@@ -0,0 +1,39 @@
+/* This file is part of Clementine.
+ Copyright 2010, David Sansome
+
+ Clementine is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Clementine 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 Clementine. If not, see .
+*/
+
+#ifndef TRANSCODEROPTIONSWMA_H
+#define TRANSCODEROPTIONSWMA_H
+
+#include "transcoderoptionsinterface.h"
+
+class Ui_TranscoderOptionsWma;
+
+class TranscoderOptionsWma : public TranscoderOptionsInterface {
+public:
+ TranscoderOptionsWma(QWidget* parent = 0);
+ ~TranscoderOptionsWma();
+
+ void Load();
+ void Save();
+
+private:
+ static const char* kSettingsGroup;
+
+ Ui_TranscoderOptionsWma* ui_;
+};
+
+#endif // TRANSCODEROPTIONSWMA_H
diff --git a/src/transcoder/transcoderoptionswma.ui b/src/transcoder/transcoderoptionswma.ui
new file mode 100644
index 000000000..a6b47eb1b
--- /dev/null
+++ b/src/transcoder/transcoderoptionswma.ui
@@ -0,0 +1,91 @@
+
+
+ TranscoderOptionsWma
+
+
+
+ 0
+ 0
+ 400
+ 300
+
+
+
+ Form
+
+
+ -
+
+
+ Bitrate
+
+
+
+ -
+
+
-
+
+
+ 320
+
+
+ 128
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+ kbps
+
+
+ 320
+
+
+ 128
+
+
+
+
+
+
+
+
+
+
+ bitrate_slider
+ valueChanged(int)
+ bitrate_spinbox
+ setValue(int)
+
+
+ 166
+ 25
+
+
+ 323
+ 24
+
+
+
+
+ bitrate_spinbox
+ valueChanged(int)
+ bitrate_slider
+ setValue(int)
+
+
+ 325
+ 14
+
+
+ 190
+ 31
+
+
+
+
+
diff --git a/src/ui/settingsdialog.cpp b/src/ui/settingsdialog.cpp
index 1e2bd68a8..b40a01f6e 100644
--- a/src/ui/settingsdialog.cpp
+++ b/src/ui/settingsdialog.cpp
@@ -145,6 +145,7 @@ SettingsDialog::SettingsDialog(BackgroundStreams* streams, QWidget* parent)
ui_->list->item(Page_Library)->setIcon(IconLoader::Load("folder-sound"));
ui_->list->item(Page_BackgroundStreams)->setIcon(QIcon(":/icons/32x32/weather-showers-scattered.png"));
ui_->list->item(Page_Proxy)->setIcon(IconLoader::Load("applications-internet"));
+ ui_->list->item(Page_Transcoding)->setIcon(IconLoader::Load("tools-wizard"));
AddStreams();
@@ -438,6 +439,14 @@ void SettingsDialog::accept() {
s.setValue("password", ui_->proxy_password->text());
s.endGroup();
+ // Transcoding
+ ui_->transcoding_aac->Save();
+ ui_->transcoding_flac->Save();
+ ui_->transcoding_mp3->Save();
+ ui_->transcoding_speex->Save();
+ ui_->transcoding_vorbis->Save();
+ ui_->transcoding_wma->Save();
+
ui_->library_config->Save();
ui_->magnatune->Save();
ui_->global_shortcuts->Save();
@@ -629,6 +638,14 @@ void SettingsDialog::showEvent(QShowEvent*) {
ui_->proxy_password->setText(s.value("password").toString());
s.endGroup();
+ // Transcoding
+ ui_->transcoding_aac->Load();
+ ui_->transcoding_flac->Load();
+ ui_->transcoding_mp3->Load();
+ ui_->transcoding_speex->Load();
+ ui_->transcoding_vorbis->Load();
+ ui_->transcoding_wma->Load();
+
loading_settings_ = false;
}
diff --git a/src/ui/settingsdialog.h b/src/ui/settingsdialog.h
index e373dc6b0..32840fcd3 100644
--- a/src/ui/settingsdialog.h
+++ b/src/ui/settingsdialog.h
@@ -67,6 +67,7 @@ class SettingsDialog : public QDialog {
Page_Magnatune,
Page_BackgroundStreams,
Page_Proxy,
+ Page_Transcoding,
#ifdef HAVE_REMOTE
Page_Remote,
#endif
diff --git a/src/ui/settingsdialog.ui b/src/ui/settingsdialog.ui
index aabf9ef69..63d6f0eab 100644
--- a/src/ui/settingsdialog.ui
+++ b/src/ui/settingsdialog.ui
@@ -103,6 +103,11 @@
Network Proxy
+ -
+
+ Transcoding
+
+
-
@@ -120,7 +125,7 @@
-
- 1
+ 9
@@ -1104,6 +1109,123 @@
+
+
+ -
+
+
+ These settings are used in the "Transcode Music" dialog, and when converting music before copying it to a device.
+
+
+ true
+
+
+
+ -
+
+
+ 0
+
+
+
+ MP3
+
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+
+
+
+
+ Vorbis
+
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+
+
+
+
+ FLAC
+
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+
+
+
+
+ Speex
+
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+
+
+
+
+ AAC
+
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+
+
+
+
+ WMA
+
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+
+
+
+
+
+
-
@@ -1159,6 +1281,42 @@
1
+
+ TranscoderOptionsMP3
+ QWidget
+ transcoder/transcoderoptionsmp3.h
+ 1
+
+
+ TranscoderOptionsVorbis
+ QWidget
+ transcoder/transcoderoptionsvorbis.h
+ 1
+
+
+ TranscoderOptionsSpeex
+ QWidget
+ transcoder/transcoderoptionsspeex.h
+ 1
+
+
+ TranscoderOptionsAAC
+ QWidget
+ transcoder/transcoderoptionsaac.h
+ 1
+
+
+ TranscoderOptionsFlac
+ QWidget
+ transcoder/transcoderoptionsflac.h
+ 1
+
+
+ TranscoderOptionsWma
+ QWidget
+ transcoder/transcoderoptionswma.h
+ 1
+
list