]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/simple_preferences.hpp
754d8adbbc4fe5a75e5347e2ece215e972df2cc4
[vlc] / modules / gui / qt4 / components / simple_preferences.hpp
1 /*****************************************************************************
2  * simple_preferences.hpp : Simple prefs
3  ****************************************************************************
4  * Copyright (C) 2006 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef _SIMPLEPREFS_H_
25 #define _SIMPLEPREFS_H_
26
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include <vlc_common.h>
32 #include <vlc_interface.h>
33
34 #include "ui/sprefs_input.h"
35 #include "ui/sprefs_audio.h"
36 #include "ui/sprefs_video.h"
37 #include "ui/sprefs_subtitles.h"
38 #include "ui/sprefs_interface.h"
39
40 #ifdef WIN32
41 # include "util/registry.hpp"
42 #endif
43
44 #include <QWidget>
45
46 enum {
47     SPrefsInterface = 0,
48     SPrefsAudio,
49     SPrefsVideo,
50     SPrefsSubtitles,
51     SPrefsInputAndCodecs,
52     SPrefsHotkeys,
53     SPrefsMax
54 };
55 #define SPrefsDefaultCat SPrefsInterface
56
57 enum {
58     CachingCustom = 0,
59     CachingLowest = 100,
60     CachingLow    = 200,
61     CachingNormal = 300,
62     CachingHigh   = 750,
63     CachingHigher = 2500
64 };
65
66 enum {
67 #ifdef WIN32
68        directxW,
69 #else
70        alsaW,
71        ossW,
72 #endif
73        fileW,
74        audioOutCoB,
75        normalizerChB,
76        volLW,
77        headphoneB,
78 };
79 enum { inputLE, cachingCoB };
80 enum { skinRB, qtRB };
81
82 class ConfigControl;
83 class QComboBox;
84 class QLineEdit;
85 class QRadioButton;
86 class QCheckBox;
87 class QString;
88
89 #ifdef WIN32
90 class QTreeWidgetItem;
91 #endif
92
93 class SPrefsCatList : public QWidget
94 {
95     Q_OBJECT;
96 public:
97     SPrefsCatList( intf_thread_t *, QWidget *, bool );
98     virtual ~SPrefsCatList() {};
99 private:
100     intf_thread_t *p_intf;
101 signals:
102     void currentItemChanged( int );
103 public slots:
104     void switchPanel( int );
105 };
106
107 class SPrefsPanel : public QWidget
108 {
109     Q_OBJECT
110 public:
111     SPrefsPanel( intf_thread_t *, QWidget *, int, bool );
112     virtual ~SPrefsPanel();
113     void apply();
114     void clean();
115 private:
116     intf_thread_t *p_intf;
117     QList<ConfigControl *> controls;
118
119     int number;
120
121     QList<QWidget *> optionWidgets;
122     QStringList qs_filter;
123
124 #ifdef WIN32
125     QList<QTreeWidgetItem *> listAsso;
126     bool addType( const char * psz_ext, QTreeWidgetItem*, QTreeWidgetItem*, QVLCRegistry* );
127 #endif
128
129 /* Display only the options for the selected audio output */
130 private slots:
131     void lastfm_Changed( int );
132     void updateAudioOptions( int );
133     void updateAudioVolume( int );
134 #ifdef SYS_MINGW32
135     void assoDialog();
136     void saveAsso();
137 #endif
138 };
139
140 #endif