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:
Rafał Dzięgiel
2021-02-24 08:42:27 +01:00
parent 6130ffa6c0
commit 86d365872a
5 changed files with 33 additions and 45 deletions

View File

@@ -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
);
}