1
/* smplayer, GUI front-end for mplayer.
2
Copyright (C) 2006-2009 Ricardo Villalba <rvm@escomposlinux.org>
4
This program 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 2 of the License, or
7
(at your option) any later version.
9
This program 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 this program; if not, write to the Free Software
16
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#include "preferences.h"
22
#include "mediasettings.h"
24
PrefTV::PrefTV(QWidget * parent, Qt::WindowFlags f)
25
: PrefWidget(parent, f )
40
QString PrefTV::sectionName() {
41
return tr("TV and radio");
44
QPixmap PrefTV::sectionIcon() {
45
return Images::icon("open_tv");
48
void PrefTV::retranslateStrings() {
51
int deinterlace_item = deinterlace_combo->currentIndex();
52
deinterlace_combo->clear();
53
deinterlace_combo->addItem( tr("None"), MediaSettings::NoDeinterlace );
54
deinterlace_combo->addItem( tr("Lowpass5"), MediaSettings::L5 );
55
deinterlace_combo->addItem( tr("Yadif (normal)"), MediaSettings::Yadif );
56
deinterlace_combo->addItem( tr("Yadif (double framerate)"), MediaSettings::Yadif_1 );
57
deinterlace_combo->addItem( tr("Linear Blend"), MediaSettings::LB );
58
deinterlace_combo->addItem( tr("Kerndeint"), MediaSettings::Kerndeint );
59
deinterlace_combo->setCurrentIndex(deinterlace_item);
64
void PrefTV::setData(Preferences * pref) {
65
setInitialDeinterlace( pref->initial_tv_deinterlace );
66
setRescan( pref->check_channels_conf_on_startup );
69
void PrefTV::getData(Preferences * pref) {
70
requires_restart = false;
72
pref->initial_tv_deinterlace = initialDeinterlace();
73
pref->check_channels_conf_on_startup = rescan();
76
void PrefTV::setInitialDeinterlace(int ID) {
77
int pos = deinterlace_combo->findData(ID);
79
deinterlace_combo->setCurrentIndex(pos);
81
qWarning("PrefTV::setInitialDeinterlace: ID: %d not found in combo", ID);
85
int PrefTV::initialDeinterlace() {
86
if (deinterlace_combo->currentIndex() != -1) {
87
return deinterlace_combo->itemData( deinterlace_combo->currentIndex() ).toInt();
89
qWarning("PrefTV::initialDeinterlace: no item selected");
94
void PrefTV::setRescan(bool b) {
95
rescan_check->setChecked(b);
98
bool PrefTV::rescan() {
99
return rescan_check->isChecked();
102
void PrefTV::createHelp() {
105
setWhatsThis(deinterlace_combo, tr("Deinterlace by default for TV"),
106
tr("Select the deinterlace filter that you want to be used for TV channels.") );
109
setWhatsThis(rescan_check, tr("Rescan ~/.mplayer/channels.conf on startup"),
110
tr("If this option is enabled, SMPlayer will look for new TV and radio "
111
"channels on ~/.mplayer/channels.conf.ter or ~/.mplayer/channels.conf.") );
115
#include "moc_preftv.cpp"