mirror of
https://github.com/Rafostar/clapper.git
synced 2025-09-01 00:41:58 +02:00
API: operate on cubic volume scale
Instead converting volume inside GJS, simplify things by making API operate on cubic volume scale.
This commit is contained in:
18
src/misc.js
18
src/misc.js
@@ -95,21 +95,3 @@ function getFormattedTime(time, showHours)
|
||||
const parsed = (hours) ? `${hours}:` : '';
|
||||
return parsed + `${minutes}:${seconds}`;
|
||||
}
|
||||
|
||||
function getCubicValue(linearVal)
|
||||
{
|
||||
return GstAudio.StreamVolume.convert_volume(
|
||||
GstAudio.StreamVolumeFormat.LINEAR,
|
||||
GstAudio.StreamVolumeFormat.CUBIC,
|
||||
linearVal
|
||||
);
|
||||
}
|
||||
|
||||
function getLinearValue(cubicVal)
|
||||
{
|
||||
return GstAudio.StreamVolume.convert_volume(
|
||||
GstAudio.StreamVolumeFormat.CUBIC,
|
||||
GstAudio.StreamVolumeFormat.LINEAR,
|
||||
cubicVal
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user