Add volume curve setting (#658)

* Add volume curve setting

* Qt: Add missing translations
This commit is contained in:
wheremyfoodat 2024-12-03 14:16:57 +02:00 committed by GitHub
parent 545ac81d81
commit 5f822b32d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 60 additions and 5 deletions

View file

@ -1,12 +1,21 @@
#pragma once
#include <filesystem>
#include <string>
#include "audio/dsp_core.hpp"
#include "renderer.hpp"
#include "frontend_settings.hpp"
#include "renderer.hpp"
struct AudioDeviceConfig {
// Audio curve to use for volumes between 0-100
enum class VolumeCurve : int {
Cubic = 0, // Samples are scaled by volume ^ 3
Linear = 1, // Samples are scaled by volume
};
float volumeRaw = 1.0f;
VolumeCurve volumeCurve = VolumeCurve::Cubic;
bool muteAudio = false;
float getVolume() const {
@ -16,6 +25,9 @@ struct AudioDeviceConfig {
return volumeRaw;
}
static VolumeCurve volumeCurveFromString(std::string inString);
static const char* volumeCurveToString(VolumeCurve curve);
};
// Remember to initialize every field here to its default value otherwise bad things will happen