From c78100cf2bd00d31f4bdf87125b1a010d95e5f8f Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 4 Feb 2014 06:49:11 +0000 Subject: [PATCH] Misc --- source/Makefile.mk | 4 +++- source/backend/plugin/ReWirePlugin.cpp | 20 +++++++++++++++++--- source/backend/plugin/VstPlugin.cpp | 2 +- source/bridges/CarlaBridgePlugin.cpp | 8 +++++--- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/source/Makefile.mk b/source/Makefile.mk index 67d28165d..e58288525 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -71,7 +71,9 @@ BASE_FLAGS += -Wmissing-declarations -Wsign-conversion endif endif -ifneq ($(WIN32),true) +ifeq ($(WIN32),true) +BASE_FLAGS += -msse -msse2 +else BASE_FLAGS += -fPIC -DPIC endif diff --git a/source/backend/plugin/ReWirePlugin.cpp b/source/backend/plugin/ReWirePlugin.cpp index 3f13a5fbc..ec9dbce44 100644 --- a/source/backend/plugin/ReWirePlugin.cpp +++ b/source/backend/plugin/ReWirePlugin.cpp @@ -213,7 +213,8 @@ struct RewireBridge { return -1; #define JOIN(a, b) a ## b - #define LIB_SYMBOL(NAME) NAME = (Fn_##NAME)lib_symbol(lib, #NAME); if (NAME == nullptr) cleanup(); return -2; + #define LIB_SYMBOL(NAME) NAME = (Fn_##NAME)lib_symbol(lib, #NAME); + //if (NAME == nullptr) cleanup(); return -2; LIB_SYMBOL(RWDEFCloseDevice) LIB_SYMBOL(RWDEFDriveAudio) @@ -473,11 +474,24 @@ public: void idle() override { + CARLA_SAFE_ASSERT_RETURN(fRw.lib != nullptr,); + + fRw.RWDEFIdle(); + // check if panel has been closed if (fIsPanelLaunched && ! fRw.RWDEFIsPanelAppLaunched()) { - fIsPanelLaunched = true; - pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0.0f, nullptr); + // FIXME + //fIsPanelLaunched = true; + //pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0.0f, nullptr); +// static int counter = 0; +// +// if (counter % 1000) +// { +// carla_stdout("Panel is closed?"); +// } +// +// ++counter; } CarlaPlugin::idle(); diff --git a/source/backend/plugin/VstPlugin.cpp b/source/backend/plugin/VstPlugin.cpp index 9b1cf2393..42e595fe6 100644 --- a/source/backend/plugin/VstPlugin.cpp +++ b/source/backend/plugin/VstPlugin.cpp @@ -1716,7 +1716,7 @@ protected: { CARLA_SAFE_ASSERT_RETURN(fEffect != nullptr, 0); #ifdef DEBUG - if (opcode != effEditIdle && opcode != effProcessEvents) + if (opcode != effIdle && opcode != effEditIdle && opcode != effProcessEvents) carla_debug("VstPlugin::dispatcher(%02i:%s, %i, " P_INTPTR ", %p, %f)", opcode, vstEffectOpcode2str(opcode), index, value, ptr, opt); #endif diff --git a/source/bridges/CarlaBridgePlugin.cpp b/source/bridges/CarlaBridgePlugin.cpp index 0a04e6bd3..4811ea55a 100644 --- a/source/bridges/CarlaBridgePlugin.cpp +++ b/source/bridges/CarlaBridgePlugin.cpp @@ -35,6 +35,7 @@ // ------------------------------------------------------------------------- +static bool gIsInitiated = false; static volatile bool gCloseNow = false; static volatile bool gSaveNow = false; @@ -161,8 +162,8 @@ public: //if (! File::isAbsolutePath((const char*)fProjFileName)) // fProjFileName = File::getCurrentWorkingDirectory().getChildFile((const char*)fProjFileName).getFullPathName().toRawUTF8(); - if (! fPlugin->loadStateFromFile(fProjFileName)) - carla_stderr("Plugin preset load failed, error was:\n%s", fEngine->getLastError()); + //if (! fPlugin->loadStateFromFile(fProjFileName)) + // carla_stderr("Plugin preset load failed, error was:\n%s", fEngine->getLastError()); } } @@ -325,7 +326,7 @@ protected: case ENGINE_CALLBACK_UI_STATE_CHANGED: if (! isOscControlRegistered()) { - if (value1 != 1) + if (value1 != 1 && gIsInitiated) gCloseNow = true; } else @@ -605,6 +606,7 @@ int main(int argc, char* argv[]) } client.ready(!useOsc); + gIsInitiated = true; client.exec(); carla_set_engine_about_to_close();