2 * KMix -- KDE's full featured mini mixer
4 * Copyright (C) 2000 Stefan Schimanski <1Stein@gmx.de>
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.
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.
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.
28 #include <QVBoxLayout>
29 #include <QPushButton>
36 #include <kxmlguiwindow.h>
39 #include "core/GlobalConfig.h"
45 #include "core/mixer.h"
48 class DialogSelectMaster;
51 KMixWindow : public KXmlGuiWindow
56 KMixWindow(bool invisible);
60 void saveBaseConfig();
61 void saveViewConfig();
63 void loadBaseConfig();
67 void initActionsLate();
68 void initActionsAfterInitMixer();
71 //void setErrorMixerWidget();
73 void setBeepOnVolumeChange(bool beep);
74 void fixConfigAfterRead();
76 virtual bool queryClose();
79 void controlsChange(int changeType);
86 void loadVolumes(QString postfix);
88 void saveVolumes(QString postfix);
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();
98 KMixerWidget* findKMWforTab( const QString& tabId );
100 void forkExec(const QStringList& args);
101 void errorPopup(const QString& msg);
104 KAction* _actionShowMenubar;
108 * configSnapshot is used to hold the original state before modifications in the preferences dialog
110 GlobalConfigData configDataSnapshot;
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
117 KTabWidget *m_wsMixers;
119 KMixDockWidget *m_dockWidget;
120 DialogSelectMaster *m_dsm;
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);
131 OSDWidget* osdWidget;
133 bool addMixerWidget(const QString& mixer_ID, QString guiprofId, int insertPosition);
134 void setInitialSize();
137 static QString getKmixctrlRcFilename(QString postfix);
138 bool profileExists(QString guiProfileId);
139 bool updateDocking();
141 void updateTabsClosable();
145 void slotKdeAudioSetupExec();
146 void slotConfigureCurrentView();
147 void plugged( const char* driverName, const QString& udi, QString& dev);
148 void unplugged( const QString& udi);
150 void slotIncreaseVolume();
151 void slotDecreaseVolume();
153 void slotSelectMasterClose(QObject*);
156 void saveAndCloseView(int);
158 void loadVolumes1() { loadVolumes(QString("1")); }
159 void loadVolumes2() { loadVolumes(QString("2")); }
160 void loadVolumes3() { loadVolumes(QString("3")); }
161 void loadVolumes4() { loadVolumes(QString("4")); }
163 void saveVolumes1() { saveVolumes(QString("1")); }
164 void saveVolumes2() { saveVolumes(QString("2")); }
165 void saveVolumes3() { saveVolumes(QString("3")); }
166 void saveVolumes4() { saveVolumes(QString("4")); }