Mixxx

/home/maxime/Projets/Mixxx/1.10/mixxx/src/dlgprefsound.h

Go to the documentation of this file.
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 DLGPREFSOUND_H
00017 #define DLGPREFSOUND_H
00018 
00019 #include <QtCore>
00020 #include "ui_dlgprefsounddlg.h"
00021 #include "configobject.h"
00022 #include "soundmanagerconfig.h"
00023 
00024 class SoundManager;
00025 class PlayerManager;
00026 class ControlObject;
00027 class SoundDevice;
00028 class DlgPrefSoundItem;
00029 
00030 /*
00031  * TODO(bkgood) (n-decks) establish a signal/slot connection with a signal
00032  * on EngineMaster that emits every time a channel is added, and a slot here
00033  * that updates the dialog accordingly.
00034  */
00035 
00039 class DlgPrefSound : public QWidget, public Ui::DlgPrefSoundDlg  {
00040     Q_OBJECT;
00041 public:
00042     DlgPrefSound(QWidget *parent, SoundManager *soundManager,
00043                  PlayerManager* pPlayerManager,
00044                  ConfigObject<ConfigValue> *config);
00045     ~DlgPrefSound();
00046 signals:
00047     void loadPaths(const SoundManagerConfig &config);
00048     void writePaths(SoundManagerConfig *config);
00049     void refreshOutputDevices(const QList<SoundDevice*> &devices);
00050     void refreshInputDevices(const QList<SoundDevice*> &devices);
00051     void updatingAPI();
00052     void updatedAPI();
00053 public slots:
00054     void slotUpdate(); // called on show
00055     void slotApply();  // called on ok button
00056     void forceApply(); // called by DlgPrefVinyl to make slotApply call setupDevices
00057 private:
00058     void initializePaths();
00059     void connectSoundItem(DlgPrefSoundItem *item);
00060     void loadSettings(const SoundManagerConfig &config);
00061     void insertItem(DlgPrefSoundItem *pItem, QVBoxLayout *pLayout);
00062     SoundManager *m_pSoundManager;
00063     PlayerManager *m_pPlayerManager;
00064     ConfigObject<ConfigValue> *m_pConfig;
00065     QList<SoundDevice*> m_inputDevices;
00066     QList<SoundDevice*> m_outputDevices;
00067     bool m_settingsModified;
00068     SoundManagerConfig m_config;
00069     bool m_loading;
00070     bool m_forceApply;
00071 private slots:
00072     void addPath(AudioOutput output);
00073     void addPath(AudioInput input);
00074     void loadSettings();
00075     void apiChanged(int index);
00076     void updateAPIs();
00077     void sampleRateChanged(int index);
00078     void latencyChanged(int index);
00079     void updateLatencies(int sampleRateIndex);
00080     void refreshDevices();
00081     void settingChanged();
00082     void queryClicked();
00083     void resetClicked();
00084 };
00085 
00086 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines