~ubuntu-branches/ubuntu/wily/smplayer/wily

« back to all changes in this revision

Viewing changes to src/filters.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Maia Kozheva
  • Date: 2009-11-04 12:45:38 UTC
  • mto: (1.1.10 upstream) (3.1.3 squeeze)
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: james.westby@ubuntu.com-20091104124538-i5ntu42ni0e1njnv
ImportĀ upstreamĀ versionĀ 0.6.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  smplayer, GUI front-end for mplayer.
 
2
    Copyright (C) 2006-2009 Ricardo Villalba <rvm@escomposlinux.org>
 
3
 
 
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.
 
8
 
 
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.
 
13
 
 
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
 
17
*/
 
18
 
 
19
#include "filters.h"
 
20
#include <QSettings>
 
21
 
 
22
Filters::Filters(QObject * parent) : QObject(parent) 
 
23
{
 
24
        init();
 
25
}
 
26
 
 
27
void Filters::init() {
 
28
        list.clear();
 
29
 
 
30
        // Video
 
31
        list["noise"] = Filter(tr("add noise"), "noise", "9ah:5ah");
 
32
        list["deblock"] = Filter(tr("deblock"), "pp", "vb/hb");
 
33
        list["denoise_normal"] = Filter(tr("normal denoise"), "hqdn3d");
 
34
        list["denoise_soft"] = Filter(tr("soft denoise"), "hqdn3d", "2:1:2");
 
35
 
 
36
        // Audio
 
37
        list["volnorm"] = Filter(tr("volume normalization"), "volnorm", "1");
 
38
}
 
39
 
 
40
Filter Filters::item(const QString & key) {
 
41
        return list[key];
 
42
}
 
43
 
 
44
void Filters::save(QSettings *set) {
 
45
        set->beginGroup("filter_options");
 
46
 
 
47
        QMap<QString, Filter>::iterator i;
 
48
        for (i = list.begin(); i != list.end(); ++i) {
 
49
                set->setValue(i.key(), i.value().options());
 
50
        }
 
51
 
 
52
        set->endGroup();
 
53
}
 
54
 
 
55
void Filters::load(QSettings *set) {
 
56
        set->beginGroup("filter_options");
 
57
 
 
58
        QMap<QString, Filter>::iterator i;
 
59
        for (i = list.begin(); i != list.end(); ++i) {
 
60
                i.value().setOptions( set->value(i.key(), i.value().options()).toString() );
 
61
        }
 
62
 
 
63
        set->endGroup();
 
64
}
 
65
 
 
66
#include "moc_filters.cpp"