OSDN Git Service

kmix: remove unused configuration checks
[kde/kde-extraapps.git] / kmix / apps / kmix.h
1 /*
2  * KMix -- KDE's full featured mini mixer
3  *
4  * Copyright (C) 2000 Stefan Schimanski <1Stein@gmx.de>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this program; if not, write to the Free
18  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19  */
20
21 #ifndef KMIX_H
22 #define KMIX_H
23
24 // Qt
25 #include <QString>
26 #include <QLabel>
27 #include <qlist.h>
28 #include <QVBoxLayout>
29 #include <QPushButton>
30 #include <QTimer>
31
32 // KDE
33 class KTabWidget;
34 class KAccel;
35 class KAction;
36 #include <kxmlguiwindow.h>
37
38 // KMix
39 #include "core/GlobalConfig.h"
40
41 class KMixDockWidget;
42 class KMixerWidget;
43 class KMixWindow;
44 class Mixer;
45 #include "core/mixer.h"
46
47 class OSDWidget;
48 class DialogSelectMaster;
49
50 class
51 KMixWindow : public KXmlGuiWindow
52 {
53    Q_OBJECT
54
55   public:
56    KMixWindow(bool invisible);
57    ~KMixWindow();
58
59   private:
60    void saveBaseConfig();
61    void saveViewConfig();
62    void loadConfig();
63    void loadBaseConfig();
64
65    void initPrefDlg();
66    void initActions();
67    void initActionsLate();
68    void initActionsAfterInitMixer();
69    //void recreateGUI();
70    void initWidgets();
71    //void setErrorMixerWidget();
72
73    void setBeepOnVolumeChange(bool beep);
74    void fixConfigAfterRead();
75
76    virtual bool queryClose();
77
78   public slots:
79    void controlsChange(int changeType);
80    void quit();
81    void showSettings();
82    void showHelp();
83    void showAbout();
84    void toggleMenuBar();
85    void loadVolumes();
86    void loadVolumes(QString postfix);
87    void saveVolumes();
88    void saveVolumes(QString postfix);
89    void saveConfig();
90    virtual void applyPrefs();
91    void recreateGUI(bool saveView);
92    void recreateGUI(bool saveConfig, const QString& mixerId, bool forceNewTab);
93    void recreateGUIwithSavingView();
94    void newMixerShown(int tabIndex);
95    void slotSelectMaster();
96
97     private:
98         KMixerWidget* findKMWforTab( const QString& tabId );
99
100         void forkExec(const QStringList& args);
101         void errorPopup(const QString& msg);
102
103    KAccel *m_keyAccel;
104    KAction* _actionShowMenubar;
105
106 private:
107    /**
108     * configSnapshot is used to hold the original state before modifications in the preferences dialog
109     */
110    GlobalConfigData configDataSnapshot;
111
112    bool m_startVisible;
113    bool m_visibilityUpdateAllowed;
114    bool m_multiDriverMode;         // Not officially supported.
115    bool m_autouseMultimediaKeys;   // Due to message freeze, not in config dialog in KDE4.4
116
117    KTabWidget *m_wsMixers;
118
119    KMixDockWidget *m_dockWidget;
120    DialogSelectMaster *m_dsm;
121
122    QString m_hwInfoString;
123    QString m_defaultCardOnStart;
124    bool m_dontSetDefaultCardOnStart;
125    QLabel      *m_errorLabel;
126    QList<QString> m_backendFilter;
127    unsigned int m_configVersion;
128    void showVolumeDisplay();
129    void increaseOrDecreaseVolume(bool increase);
130
131    OSDWidget* osdWidget;
132
133    bool addMixerWidget(const QString& mixer_ID, QString guiprofId, int insertPosition);
134    void setInitialSize();
135
136     private:
137     static QString getKmixctrlRcFilename(QString postfix);
138         bool profileExists(QString guiProfileId);
139         bool updateDocking();
140         void removeDock();
141         void updateTabsClosable();
142
143   private slots:
144    void slotHWInfo();
145    void slotKdeAudioSetupExec();
146    void slotConfigureCurrentView();
147    void plugged( const char* driverName, const QString& udi, QString& dev);
148    void unplugged( const QString& udi);
149    void hideOrClose();
150    void slotIncreaseVolume();
151    void slotDecreaseVolume();
152    void slotMute();
153    void slotSelectMasterClose(QObject*);
154
155    void newView();
156    void saveAndCloseView(int);
157
158    void loadVolumes1() { loadVolumes(QString("1")); }
159    void loadVolumes2() { loadVolumes(QString("2")); }
160    void loadVolumes3() { loadVolumes(QString("3")); }
161    void loadVolumes4() { loadVolumes(QString("4")); }
162
163    void saveVolumes1() { saveVolumes(QString("1")); }
164    void saveVolumes2() { saveVolumes(QString("2")); }
165    void saveVolumes3() { saveVolumes(QString("3")); }
166    void saveVolumes4() { saveVolumes(QString("4")); }
167 };
168
169 #endif // KMIX_H