From bc09d94ff3c57d7c4ba17bd74c145d507f3165b0 Mon Sep 17 00:00:00 2001 From: Etienne Dechamps Date: Sat, 25 May 2024 21:52:40 +0100 Subject: [PATCH] Allow controlPanel() calls before init() Fixes #184 --- src/flexasio/FlexASIO/cflexasio.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/flexasio/FlexASIO/cflexasio.cpp b/src/flexasio/FlexASIO/cflexasio.cpp index 7a0c96e..5f2d3a2 100644 --- a/src/flexasio/FlexASIO/cflexasio.cpp +++ b/src/flexasio/FlexASIO/cflexasio.cpp @@ -1,5 +1,6 @@ #include "cflexasio.h" +#include "control_panel.h" #include "flexasio.h" #include "flexasio.rc.h" #include "flexasio_h.h" @@ -121,7 +122,10 @@ namespace flexasio { } ASIOError controlPanel() throw() final { - return EnterWithMethod("controlPanel()", &FlexASIO::ControlPanel); + return Enter("controlPanel()", [&] { + if (!flexASIO.has_value()) OpenControlPanel(NULL); // https://github.com/dechamps/FlexASIO/issues/184 + flexASIO->ControlPanel(); + }); } ASIOError future(long selector, void *) throw() final { return Enter("future()", [&] {