Formatting

This commit is contained in:
Jonas Kvinge
2022-03-22 21:09:05 +01:00
parent 8cb4e75f70
commit f6b70fda71
106 changed files with 446 additions and 479 deletions

View File

@@ -94,19 +94,17 @@ bool Engine::Base::Play(const QUrl &stream_url, const QUrl &original_url, const
}
return Play(offset_nanosec);
}
void Engine::Base::SetVolume(const uint value) {
volume_ = value;
SetVolumeSW(MakeVolumeLogarithmic(value));
}
uint Engine::Base::MakeVolumeLogarithmic(const uint volume) {
// We're using a logarithmic function to make the volume ramp more natural.
return static_cast<uint>( 100 - 100.0 * std::log10( ( 100 - volume ) * 0.09 + 1.0 ) );
return static_cast<uint>(100 - 100.0 * std::log10((100 - volume) * 0.09 + 1.0));
}
void Engine::Base::ReloadSettings() {