![]() |
Mixxx
|
00001 00007 /*************************************************************************** 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 ***************************************************************************/ 00015 00016 #ifndef DLGPREFSOUNDITEM_H 00017 #define DLGPREFSOUNDITEM_H 00018 00019 #include <QtCore> 00020 #include "ui_dlgprefsounditem.h" 00021 #include "soundmanagerutil.h" 00022 00023 class SoundDevice; 00024 class SoundManagerConfig; 00025 00032 class DlgPrefSoundItem : public QWidget, public Ui::DlgPrefSoundItem { 00033 Q_OBJECT; 00034 public: 00035 DlgPrefSoundItem(QWidget *parent, AudioPathType type, 00036 QList<SoundDevice*> &devices, bool isInput, unsigned int index = 0); 00037 ~DlgPrefSoundItem(); 00038 AudioPathType type() const { return m_type; }; 00039 unsigned int index() const { return m_index; }; 00040 signals: 00041 void settingChanged(); 00042 public slots: 00043 void refreshDevices(const QList<SoundDevice*> &devices); 00044 void deviceChanged(int index); 00045 void loadPath(const SoundManagerConfig &config); 00046 void writePath(SoundManagerConfig *config) const; 00047 void save(); 00048 void reload(); 00049 private: 00050 SoundDevice* getDevice() const; // if this returns NULL, we don't have a valid AudioPath 00051 void setDevice(const QString &deviceName); 00052 void setChannel(unsigned int channel); 00053 AudioPathType m_type; 00054 unsigned int m_index; 00055 QList<SoundDevice*> m_devices; 00056 bool m_isInput; 00057 QString m_savedDevice; 00058 unsigned int m_savedChannel; 00059 }; 00060 00061 #endif