mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
[Audio] Get/set audio device volume (this is the device's value, NOT the logical AFV value)
This commit is contained in:
committed by
Mat Sutcliffe
parent
fc9bb1277d
commit
091fa5f338
@@ -233,4 +233,16 @@ namespace BlackSound
|
||||
static const QString unknown("unknown");
|
||||
return unknown;
|
||||
}
|
||||
|
||||
double normalize0to100(double in)
|
||||
{
|
||||
if (in < 0) { return 0; }
|
||||
return (in >= 1.0) ? 1.0 : in;
|
||||
}
|
||||
|
||||
qreal normalize0to100qr(double in)
|
||||
{
|
||||
return static_cast<qreal>(normalize0to100(in));
|
||||
}
|
||||
|
||||
} // ns
|
||||
|
||||
@@ -35,6 +35,12 @@ namespace BlackSound
|
||||
BLACKSOUND_EXPORT const QString &toQString(QAudioFormat::Endian e);
|
||||
BLACKSOUND_EXPORT const QString &toQString(QAudioFormat::SampleType s);
|
||||
//! @}
|
||||
|
||||
//! Normalize audio volume to 0..100 @{
|
||||
BLACKSOUND_EXPORT double normalize0to100(double in);
|
||||
BLACKSOUND_EXPORT qreal normalize0to100qr(double in);
|
||||
//! @}
|
||||
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user