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>
38 class DevicePreference
: public QWidget
, private Ui::DevicePreference
42 DevicePreference(QWidget
*parent
= 0);
51 void changeEvent(QEvent
*);
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();
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