#include #include AudioSettings::AudioSettings() { lockChannels = Options::GetInstance().GetValue("audio", "lock"); volumeL = Options::GetInstance().GetValue("audio", "volumeL") * 100; volumeR = Options::GetInstance().GetValue("audio", "volumeR") * 100; } bool AudioSettings::render() { if(ImGui::Checkbox("Lock channels:", &lockChannels)) { Options::GetInstance().SetValue("audio", "lock", lockChannels); if(lockChannels) { volumeR = volumeL; Options::GetInstance().SetValue("audio", "volumeR", volumeR / 100.f); } modified = true; } if(ImGui::SliderFloat("Volume L", &volumeL, 0.f, 100.f, "%.2f")) { Options::GetInstance().SetValue("audio", "volumeL", volumeL / 100.f); if (lockChannels) { volumeR = volumeL; Options::GetInstance().SetValue("audio", "volumeR", volumeR / 100.f); } modified = true; } ImGui::BeginDisabled(lockChannels); if(ImGui::SliderFloat("Volume R", &volumeR, 0.f, 100.f, "%.2f")) { Options::GetInstance().SetValue("audio", "volumeR", volumeR / 100.f); modified = true; } ImGui::EndDisabled(); return modified; }