1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactor(audio): remove unused set min and max input gain

This commit is contained in:
Anthony Bilinski 2021-01-23 04:35:31 -08:00
parent ce1ecb4234
commit 653a6f653e
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
3 changed files with 4 additions and 30 deletions

View File

@ -111,10 +111,7 @@ public:
virtual qreal minOutputVolume() const = 0;
virtual qreal minInputGain() const = 0;
virtual void setMinInputGain(qreal dB) = 0;
virtual qreal maxInputGain() const = 0;
virtual void setMaxInputGain(qreal dB) = 0;
virtual qreal inputGain() const = 0;
virtual void setInputGain(qreal dB) = 0;

View File

@ -56,6 +56,8 @@ void applyGain(int16_t* buffer, uint32_t bufferSize, qreal gainFactor)
static const unsigned int BUFFER_COUNT = 16;
static const uint32_t AUDIO_CHANNELS = 2;
constexpr qreal OpenAL::minInGain;
constexpr qreal OpenAL::maxInGain;
OpenAL::OpenAL(IAudioSettings& _settings)
: settings{_settings}
@ -161,17 +163,6 @@ qreal OpenAL::minInputGain() const
return minInGain;
}
/**
* @brief Set the minimum allowed gain value in dB.
*
* @note Default is -30dB; usually you don't need to alter this value;
*/
void OpenAL::setMinInputGain(qreal dB)
{
QMutexLocker locker(&audioLock);
minInGain = dB;
}
/**
* @brief The maximum gain value for an input device.
*
@ -183,17 +174,6 @@ qreal OpenAL::maxInputGain() const
return maxInGain;
}
/**
* @brief Set the maximum allowed gain value in dB.
*
* @note Default is 30dB; usually you don't need to alter this value.
*/
void OpenAL::setMaxInputGain(qreal dB)
{
QMutexLocker locker(&audioLock);
maxInGain = dB;
}
/**
* @brief The minimum threshold value for an input device.
*

View File

@ -66,10 +66,7 @@ public:
void setOutputVolume(qreal volume);
qreal minInputGain() const;
void setMinInputGain(qreal dB);
qreal maxInputGain() const;
void setMaxInputGain(qreal dB);
qreal inputGain() const;
void setInputGain(qreal dB);
@ -156,8 +153,8 @@ protected:
int channels = 0;
qreal gain = 0;
qreal gainFactor = 1;
qreal minInGain = -30;
qreal maxInGain = 30;
static constexpr qreal minInGain = -30;
static constexpr qreal maxInGain = 30;
qreal inputThreshold = 0;
qreal voiceHold = 250;
bool isActive = false;