mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Ref T730, function to check range for input/output volume
This commit is contained in:
committed by
Mat Sutcliffe
parent
905c487451
commit
09b38b4e6d
@@ -22,6 +22,20 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Audio
|
||||
{
|
||||
int CSettings::fixOutVolume(int v)
|
||||
{
|
||||
if (v > OutMax) { return OutMax; }
|
||||
if (v < OutMin) { return OutMin; }
|
||||
return v;
|
||||
}
|
||||
|
||||
int CSettings::fixInVolume(int v)
|
||||
{
|
||||
if (v > InMax) { return InMax; }
|
||||
if (v < InMin) { return InMin; }
|
||||
return v;
|
||||
}
|
||||
|
||||
CSettings::CSettings()
|
||||
{
|
||||
this->initDefaultValues();
|
||||
@@ -82,16 +96,12 @@ namespace BlackMisc
|
||||
|
||||
void CSettings::setOutVolume(int volume)
|
||||
{
|
||||
if (volume > OutMax) { volume = OutMax; }
|
||||
else if (volume < OutMin) { volume = OutMin; }
|
||||
m_outVolume = volume;
|
||||
m_outVolume = fixOutVolume(volume);
|
||||
}
|
||||
|
||||
void CSettings::setInVolume(int volume)
|
||||
{
|
||||
if (volume > InMax) { volume = InMax; }
|
||||
else if (volume < InMin) { volume = InMin; }
|
||||
m_inVolume = volume;
|
||||
m_inVolume = fixInVolume(volume);
|
||||
}
|
||||
|
||||
QString CSettings::convertToQString(bool i18n) const
|
||||
|
||||
Reference in New Issue
Block a user