From 6237cfda9fc0382b014d478f559c09e27a0ba323 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Tue, 12 Dec 2017 22:43:56 +0100 Subject: [PATCH] Add the restoremidi option with the config.json file --- src/blupi.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/blupi.cxx b/src/blupi.cxx index 363a70e..032325c 100644 --- a/src/blupi.cxx +++ b/src/blupi.cxx @@ -79,6 +79,7 @@ enum Settings { SETTING_RENDERER = 1 << 3, SETTING_ZOOM = 1 << 4, SETTING_DRIVER = 1 << 5, + SETTING_MIDI = 1 << 6, }; static int g_settingsOverload = 0; @@ -188,6 +189,10 @@ ReadConfig () SDL_SetHint (SDL_HINT_RENDER_DRIVER, "opengl"); } + if ( + !(g_settingsOverload & SETTING_MIDI) && j.find ("restoremidi") != j.end ()) + g_restoreMidi = j["restoremidi"].get (); + return true; } @@ -685,7 +690,10 @@ parseArgs (int argc, char * argv[], bool & exit) g_restoreBugs = true; if (args["restoremidi"]) + { g_restoreMidi = true; + g_settingsOverload |= SETTING_MIDI; + } return EXIT_SUCCESS; }