diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d4c0ddad9..6aa3b349f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -325,6 +325,7 @@ set(SOURCES transcoder/transcoderoptionsmp3.cpp transcoder/transcoderoptionsopus.cpp transcoder/transcoderoptionsspeex.cpp + transcoder/transcoderoptionsvoaac.cpp transcoder/transcoderoptionsvorbis.cpp transcoder/transcoderoptionswma.cpp transcoder/transcodersettingspage.cpp @@ -754,6 +755,7 @@ set(UI transcoder/transcoderoptionsmp3.ui transcoder/transcoderoptionsopus.ui transcoder/transcoderoptionsspeex.ui + transcoder/transcoderoptionsvoaac.ui transcoder/transcoderoptionsvorbis.ui transcoder/transcoderoptionswma.ui transcoder/transcodersettingspage.ui diff --git a/src/transcoder/transcoderoptionsdialog.cpp b/src/transcoder/transcoderoptionsdialog.cpp index a861f9037..646851f46 100644 --- a/src/transcoder/transcoderoptionsdialog.cpp +++ b/src/transcoder/transcoderoptionsdialog.cpp @@ -27,6 +27,7 @@ #include "transcoderoptionsmp3.h" #include "transcoderoptionsopus.h" #include "transcoderoptionsspeex.h" +#include "transcoderoptionsvoaac.h" #include "transcoderoptionsvorbis.h" #include "transcoderoptionswma.h" #include "ui_transcoderoptionsdialog.h" @@ -81,6 +82,8 @@ TranscoderOptionsInterface* TranscoderOptionsDialog::MakeOptionsPage( return new TranscoderOptionsAAC(parent); } else if (element == "fdkaacenc") { return new TranscoderOptionsFDKAAC(parent); + } else if (element == "voaacenc") { + return new TranscoderOptionsVOAAC(parent); } else if (element == "lamemp3enc") { return new TranscoderOptionsMP3(parent); } else if (element == "vorbisenc") { diff --git a/src/transcoder/transcoderoptionsvoaac.cpp b/src/transcoder/transcoderoptionsvoaac.cpp new file mode 100644 index 000000000..0fd4b4837 --- /dev/null +++ b/src/transcoder/transcoderoptionsvoaac.cpp @@ -0,0 +1,50 @@ +/* This file is part of Clementine. + Copyright 2021, Jim Broadus + + 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 . +*/ + +/* + Settings for the voaacenc gstreamer element. + https://gstreamer.freedesktop.org/documentation/voaacenc/index.html +*/ + +#include "transcoderoptionsvoaac.h" + +#include + +#include "ui_transcoderoptionsvoaac.h" + +const char* TranscoderOptionsVOAAC::kSettingsGroup = "Transcoder/voaacenc"; + +TranscoderOptionsVOAAC::TranscoderOptionsVOAAC(QWidget* parent) + : TranscoderOptionsInterface(parent), ui_(new Ui_TranscoderOptionsVOAAC) { + ui_->setupUi(this); +} + +TranscoderOptionsVOAAC::~TranscoderOptionsVOAAC() { delete ui_; } + +void TranscoderOptionsVOAAC::Load() { + QSettings s; + s.beginGroup(kSettingsGroup + settings_postfix_); + + ui_->bitrate_slider->setValue(s.value("bitrate", 128000).toInt() / 1000); +} + +void TranscoderOptionsVOAAC::Save() { + QSettings s; + s.beginGroup(kSettingsGroup + settings_postfix_); + + s.setValue("bitrate", ui_->bitrate_slider->value() * 1000); +} diff --git a/src/transcoder/transcoderoptionsvoaac.h b/src/transcoder/transcoderoptionsvoaac.h new file mode 100644 index 000000000..3152b3d8f --- /dev/null +++ b/src/transcoder/transcoderoptionsvoaac.h @@ -0,0 +1,39 @@ +/* This file is part of Clementine. + Copyright 2021, Jim Broadus + + 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 TRANSCODEROPTIONSVOAAC_H +#define TRANSCODEROPTIONSVOAAC_H + +#include "transcoderoptionsinterface.h" + +class Ui_TranscoderOptionsVOAAC; + +class TranscoderOptionsVOAAC : public TranscoderOptionsInterface { + public: + TranscoderOptionsVOAAC(QWidget* parent = nullptr); + ~TranscoderOptionsVOAAC(); + + void Load(); + void Save(); + + private: + static const char* kSettingsGroup; + + Ui_TranscoderOptionsVOAAC* ui_; +}; + +#endif // TRANSCODEROPTIONSVOAAC_H diff --git a/src/transcoder/transcoderoptionsvoaac.ui b/src/transcoder/transcoderoptionsvoaac.ui new file mode 100644 index 000000000..063af81c0 --- /dev/null +++ b/src/transcoder/transcoderoptionsvoaac.ui @@ -0,0 +1,104 @@ + + + TranscoderOptionsVOAAC + + + + 0 + 0 + 480 + 344 + + + + Form + + + + + + Bitrate + + + + + + + + + 8 + + + 320 + + + 128 + + + Qt::Horizontal + + + + + + + kbps + + + 8 + + + 320 + + + 8 + + + 128 + + + + + + + + + bitrate_slider + bitrate_spinbox + + + + + bitrate_slider + valueChanged(int) + bitrate_spinbox + setValue(int) + + + 170 + 29 + + + 445 + 24 + + + + + bitrate_spinbox + valueChanged(int) + bitrate_slider + setValue(int) + + + 407 + 18 + + + 191 + 29 + + + + +