From 531c95291e42d2087a620f90568765ce786a3485 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 26 Apr 2013 07:08:53 +0100 Subject: [PATCH] Implement save/load project in carla-single --- source/bridges/CarlaBridgePlugin.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source/bridges/CarlaBridgePlugin.cpp b/source/bridges/CarlaBridgePlugin.cpp index 927f5d3d1..2ba22fe18 100644 --- a/source/bridges/CarlaBridgePlugin.cpp +++ b/source/bridges/CarlaBridgePlugin.cpp @@ -157,6 +157,11 @@ public: fEngine = carla_get_standalone_engine(); fPlugin = fEngine->getPlugin(0); + fProjFileName = fPlugin->name(); + fProjFileName += ".carxp"; + + fEngine->loadProject(fProjFileName); + fTimerId = startTimer(50); } @@ -169,12 +174,18 @@ public: if (gSaveNow) { - // TODO gSaveNow = false; + + CARLA_ASSERT(fEngine != nullptr); + + if (fEngine != nullptr && fProjFileName.isNotEmpty()) + fEngine->saveProject(fProjFileName); } if (gCloseNow) { + gCloseNow = false; + if (fTimerId != 0) { killTimer(fTimerId); @@ -340,6 +351,7 @@ private: CarlaBackend::CarlaEngine* fEngine; CarlaBackend::CarlaPlugin* fPlugin; + CarlaString fProjFileName; int fTimerId; void timerEvent(QTimerEvent* const event)