1 /* 2 Copyright © 2019 by The qTox Project Contributors 3 4 This file is part of qTox, a Qt-based graphical interface for Tox. 5 6 qTox is libre software: you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation, either version 3 of the License, or 9 (at your option) any later version. 10 11 qTox 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 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with qTox. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #ifndef I_AUDIO_SETTINGS_H 21 #define I_AUDIO_SETTINGS_H 22 23 #include "src/model/interface.h" 24 25 #include <QString> 26 27 class IAudioSettings { 28 public: 29 virtual ~IAudioSettings() = default; 30 31 virtual QString getInDev() const = 0; 32 virtual void setInDev(const QString& deviceSpecifier) = 0; 33 34 virtual bool getAudioInDevEnabled() const = 0; 35 virtual void setAudioInDevEnabled(bool enabled) = 0; 36 37 virtual QString getOutDev() const = 0; 38 virtual void setOutDev(const QString& deviceSpecifier) = 0; 39 40 virtual bool getAudioOutDevEnabled() const = 0; 41 virtual void setAudioOutDevEnabled(bool enabled) = 0; 42 43 virtual qreal getAudioInGainDecibel() const = 0; 44 virtual void setAudioInGainDecibel(qreal dB) = 0; 45 46 virtual qreal getAudioThreshold() const = 0; 47 virtual void setAudioThreshold(qreal percent) = 0; 48 49 virtual int getOutVolume() const = 0; 50 virtual int getOutVolumeMin() const = 0; 51 virtual int getOutVolumeMax() const = 0; 52 virtual void setOutVolume(int volume) = 0; 53 54 virtual int getAudioBitrate() const = 0; 55 virtual void setAudioBitrate(int bitrate) = 0; 56 57 virtual bool getEnableTestSound() const = 0; 58 virtual void setEnableTestSound(bool newValue) = 0; 59 60 DECLARE_SIGNAL(inDevChanged, const QString& device); 61 DECLARE_SIGNAL(audioInDevEnabledChanged, bool enabled); 62 63 DECLARE_SIGNAL(outDevChanged, const QString& device); 64 DECLARE_SIGNAL(audioOutDevEnabledChanged, bool enabled); 65 66 DECLARE_SIGNAL(audioInGainDecibelChanged, qreal dB); 67 DECLARE_SIGNAL(audioThresholdChanged, qreal dB); 68 DECLARE_SIGNAL(outVolumeChanged, int volume); 69 DECLARE_SIGNAL(audioBitrateChanged, int bitrate); 70 DECLARE_SIGNAL(enableTestSoundChanged, bool newValue); 71 }; 72 73 #endif // I_AUDIO_SETTINGS_H 74