mirror of https://github.com/snes9xgit/snes9x.git
Sound reset and signal handlers.
This commit is contained in:
parent
4aaf009dbb
commit
f8c71178d9
|
@ -30,8 +30,11 @@ SoundPanel::SoundPanel(EmuApplication *app_)
|
|||
});
|
||||
|
||||
connect(spinBox_buffer_size, &QSpinBox::valueChanged, [&](int value) {
|
||||
app->config->audio_buffer_size_ms = value;
|
||||
app->restartAudio();
|
||||
if (app->config->audio_buffer_size_ms != value)
|
||||
{
|
||||
app->config->audio_buffer_size_ms = value;
|
||||
app->restartAudio();
|
||||
}
|
||||
});
|
||||
|
||||
connect(checkBox_adjust_input_rate, &QCheckBox::clicked, [&](bool checked) {
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#include "EmuApplication.hpp"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <csignal>
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
EmuApplication emu;
|
||||
|
@ -7,6 +11,12 @@ int main(int argc, char *argv[])
|
|||
|
||||
QGuiApplication::setDesktopFileName("snes9x-gtk");
|
||||
|
||||
#ifndef _WIN32
|
||||
auto quit_handler = [](int) { QApplication::quit(); };
|
||||
for (auto s : { SIGQUIT, SIGINT, SIGTERM, SIGHUP })
|
||||
signal(s, quit_handler);
|
||||
#endif
|
||||
|
||||
emu.config = std::make_unique<EmuConfig>();
|
||||
emu.config->setDefaults();
|
||||
emu.config->loadFile(EmuConfig::findConfigFile());
|
||||
|
@ -17,6 +27,9 @@ int main(int argc, char *argv[])
|
|||
|
||||
emu.updateBindings();
|
||||
emu.startIdleLoop();
|
||||
|
||||
|
||||
|
||||
emu.qtapp->exec();
|
||||
|
||||
emu.config->saveFile(EmuConfig::findConfigFile());
|
||||
|
|
Loading…
Reference in New Issue