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

@ -69,7 +69,7 @@ void CheatEntryWidget::editClicked() {
}
CheatEditDialog::CheatEditDialog(Emulator* emu, CheatEntryWidget& cheatEntry) : QDialog(), emu(emu), cheatEntry(cheatEntry) {
setWindowTitle("Edit Cheat");
setWindowTitle(tr("Edit Cheat"));
setAttribute(Qt::WA_DeleteOnClose);
setModal(true);
@ -161,7 +161,7 @@ void CheatEditDialog::rejected() {
CheatsWindow::CheatsWindow(Emulator* emu, const std::filesystem::path& cheatPath, QWidget* parent)
: QWidget(parent, Qt::Window), emu(emu), cheatPath(cheatPath) {
setWindowTitle("Cheats");
setWindowTitle(tr("Cheats"));
mainWindow = static_cast<MainWindow*>(parent);
QVBoxLayout* layout = new QVBoxLayout;

View file

@ -240,6 +240,16 @@ ConfigWindow::ConfigWindow(ConfigCallback configCallback, MainWindowCallback win
connectCheckbox(muteAudio, config.audioDeviceConfig.muteAudio);
audioLayout->addRow(muteAudio);
QComboBox* volumeCurveType = new QComboBox;
volumeCurveType->addItem(tr("Cubic"));
volumeCurveType->addItem(tr("Linear"));
volumeCurveType->setCurrentIndex(static_cast<int>(config.audioDeviceConfig.volumeCurve));
connect(volumeCurveType, &QComboBox::currentIndexChanged, this, [&](int index) {
config.audioDeviceConfig.volumeCurve = static_cast<AudioDeviceConfig::VolumeCurve>(index);
updateConfig();
});
audioLayout->addRow(tr("Volume curve"), volumeCurveType);
QSpinBox* volumeRaw = new QSpinBox();
volumeRaw->setRange(0, 200);
volumeRaw->setValue(config.audioDeviceConfig.volumeRaw * 100);

View file

@ -12,7 +12,7 @@
#include "io_file.hpp"
PatchWindow::PatchWindow(QWidget* parent) : QWidget(parent, Qt::Window) {
setWindowTitle("ROM patcher");
setWindowTitle(tr("ROM patcher"));
QVBoxLayout* layout = new QVBoxLayout;
layout->setContentsMargins(6, 6, 6, 6);

View file

@ -9,7 +9,7 @@ using namespace Zep;
TextEditorWindow::TextEditorWindow(QWidget* parent, const std::string& filename, const std::string& initialText)
: QDialog(parent), zepWidget(this, qApp->applicationDirPath().toStdString(), fontSize) {
setWindowTitle("Lua Editor");
setWindowTitle(tr("Lua Editor"));
resize(600, 600);
// Register our extensions