delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / runtime / phonon / kcm / devicepreference.h
blob036e04abb8c1551f63713f88d218f5793c860576
1 /* This file is part of the KDE project
2 Copyright (C) 2006-2008 Matthias Kretz <kretz@kde.org>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) version 3.
9 This library 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 GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
21 #ifndef DEVICEPREFERENCE_H_STUPID_UIC
22 #define DEVICEPREFERENCE_H_STUPID_UIC
24 #include "ui_devicepreference.h"
25 #include <phonon/objectdescriptionmodel.h>
26 #include <phonon/objectdescription.h>
27 #include <QtGui/QStandardItem>
28 #include <QtCore/QMap>
29 #include <QtCore/QList>
30 class QLabel;
32 namespace Phonon
34 class MediaObject;
35 class AudioOutput;
36 } // namespace Phonon
38 class DevicePreference : public QWidget, private Ui::DevicePreference
40 Q_OBJECT
41 public:
42 DevicePreference(QWidget *parent = 0);
43 void load();
44 void save();
45 void defaults();
47 Q_SIGNALS:
48 void changed();
50 protected:
51 void changeEvent(QEvent *);
53 private Q_SLOTS:
54 void on_preferButton_clicked();
55 void on_deferButton_clicked();
56 void on_removeButton_clicked();
57 void on_showCheckBox_toggled();
58 void on_applyPreferencesButton_clicked();
59 void on_testPlaybackButton_toggled(bool down);
60 void updateButtonsEnabled();
61 void updateDeviceList();
62 void updateAudioOutputDevices();
63 void updateAudioCaptureDevices();
65 private:
66 template<Phonon::ObjectDescriptionType T> void removeDevice(const Phonon::ObjectDescription<T> &deviceToRemove,
67 QMap<int, Phonon::ObjectDescriptionModel<T> *> *modelMap);
68 QList<Phonon::AudioOutputDevice> availableAudioOutputDevices() const;
69 QList<Phonon::AudioCaptureDevice> availableAudioCaptureDevices() const;
70 QList<int> m_removeOnApply;
71 QMap<int, Phonon::AudioOutputDeviceModel *> m_outputModel;
72 QMap<int, Phonon::AudioCaptureDeviceModel *> m_captureModel;
73 QStandardItemModel m_categoryModel;
74 QStandardItemModel m_headerModel;
75 bool m_showingOutputModel;
77 Phonon::MediaObject *m_media;
78 Phonon::AudioOutput *m_output;
81 #endif // DEVICEPREFERENCE_H_STUPID_UIC