1
/* This file is part of Clementine.
2
Copyright 2010, David Sansome <me@davidsansome.com>
4
Clementine is free software: you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation, either version 3 of the License, or
7
(at your option) any later version.
9
Clementine is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
18
#include "transcoderoptionsspeex.h"
19
#include "ui_transcoderoptionsspeex.h"
23
const char* TranscoderOptionsSpeex::kSettingsGroup = "Transcoder/speexenc";
25
TranscoderOptionsSpeex::TranscoderOptionsSpeex(QWidget* parent)
26
: TranscoderOptionsInterface(parent),
27
ui_(new Ui_TranscoderOptionsSpeex)
32
TranscoderOptionsSpeex::~TranscoderOptionsSpeex() {
36
void TranscoderOptionsSpeex::Load() {
38
s.beginGroup(kSettingsGroup);
40
ui_->quality_slider->setValue(s.value("quality", 8).toInt());
41
ui_->bitrate_slider->setValue(s.value("bitrate", 0).toInt() / 1000);
42
ui_->mode->setCurrentIndex(s.value("mode", 0).toInt());
43
ui_->vbr->setChecked(s.value("vbr", false).toBool());
44
ui_->abr_slider->setValue(s.value("abr", 0).toInt() / 1000);
45
ui_->vad->setChecked(s.value("vad", false).toBool());
46
ui_->dtx->setChecked(s.value("dtx", false).toBool());
47
ui_->complexity->setValue(s.value("complexity", 3).toInt());
48
ui_->nframes->setValue(s.value("nframes", 1).toInt());
51
void TranscoderOptionsSpeex::Save() {
53
s.beginGroup(kSettingsGroup);
55
s.setValue("quality", ui_->quality_slider->value());
56
s.setValue("bitrate", ui_->bitrate_slider->value() * 1000);
57
s.setValue("mode", ui_->mode->currentIndex());
58
s.setValue("vbr", ui_->vbr->isChecked());
59
s.setValue("abr", ui_->abr_slider->value() * 1000);
60
s.setValue("vad", ui_->vad->isChecked());
61
s.setValue("dtx", ui_->dtx->isChecked());
62
s.setValue("complexity", ui_->complexity->value());
63
s.setValue("nframes", ui_->nframes->value());