]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/simple_preferences.hpp
Merge branch 'master' into lpcm_encoder
[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        spdifChB,
79 };
80 enum { inputLE, cachingCoB };
81 enum { skinRB, qtRB, styleCB };
82
83 class ConfigControl;
84 class QComboBox;
85 class QLineEdit;
86 class QRadioButton;
87 class QCheckBox;
88 class QString;
89
90 #ifdef WIN32
91 class QTreeWidgetItem;
92 #endif
93
94 class SPrefsCatList : public QWidget
95 {
96     Q_OBJECT
97 public:
98     SPrefsCatList( intf_thread_t *, QWidget *, bool );
99     virtual ~SPrefsCatList() {};
100 private:
101     intf_thread_t *p_intf;
102 signals:
103     void currentItemChanged( int );
104 public slots:
105     void switchPanel( int );
106 };
107
108 class SPrefsPanel : public QWidget
109 {
110     Q_OBJECT
111 public:
112     SPrefsPanel( intf_thread_t *, QWidget *, int, bool );
113     virtual ~SPrefsPanel();
114     void apply();
115     void clean();
116 private:
117     intf_thread_t *p_intf;
118     QList<ConfigControl *> controls;
119
120     int number;
121
122     QList<QWidget *> optionWidgets;
123     QStringList qs_filter;
124     QButtonGroup *radioGroup;
125
126 #ifdef WIN32
127     QList<QTreeWidgetItem *> listAsso;
128     bool addType( const char * psz_ext, QTreeWidgetItem*, QTreeWidgetItem*, QVLCRegistry* );
129 #endif
130
131 /* Display only the options for the selected audio output */
132 private slots:
133     void lastfm_Changed( int );
134     void updateAudioOptions( int );
135     void updateAudioVolume( int );
136 #ifdef SYS_MINGW32
137     void assoDialog();
138     void saveAsso();
139 #endif
140     void changeStyle( QString );
141 };
142
143 #endif