From 98188d1428abd47aa5455bef21f5c7d5ea01fd2a Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 25 Feb 2013 02:39:59 +0000 Subject: [PATCH] Fix build for Qt4 moc --- source/backend/native/Makefile | 8 ++++++-- source/backend/native/distrho-notes.cpp | 6 ++++++ source/backend/native/notes/ParamProgressBar.cpp | 2 +- source/backend/plugin/NativePlugin.cpp | 10 +++++++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/source/backend/native/Makefile b/source/backend/native/Makefile index 70f277769..ec97bf42b 100644 --- a/source/backend/native/Makefile +++ b/source/backend/native/Makefile @@ -60,6 +60,7 @@ all: $(STATIC) clean: rm -f $(OBJS) $(SHARED) $(STATIC) + rm -f moc_*.cpp debug: $(MAKE) DEBUG=true @@ -89,7 +90,7 @@ distrho-3bandsplitter.cpp.o: distrho-3bandsplitter.cpp distrho-pingpongpan.cpp.o: distrho-pingpongpan.cpp $(CXX) $< $(BUILD_CXX_FLAGS) -Ipingpongpan -DDISTRHO_NAMESPACE=DISTRHO_PingPongPan -c -o $@ -distrho-notes.cpp.o: distrho-notes.cpp +distrho-notes.cpp.o: distrho-notes.cpp moc_DistrhoUINotes.cpp moc_ParamProgressBar.cpp $(CXX) $< $(BUILD_CXX_FLAGS) -Inotes -DDISTRHO_NAMESPACE=DISTRHO_Notes -c -o $@ zynaddsubfx.cpp.o: zynaddsubfx.cpp @@ -100,5 +101,8 @@ zynaddsubfx-src.cpp.o: zynaddsubfx-src.cpp # -------------------------------------------------------------- -moc_%.cpp: %.hpp +moc_DistrhoUINotes.cpp: notes/DistrhoUINotes.hpp + $(MOC) $< -o $@ + +moc_ParamProgressBar.cpp: notes/ParamProgressBar.hpp $(MOC) $< -o $@ diff --git a/source/backend/native/distrho-notes.cpp b/source/backend/native/distrho-notes.cpp index 6e2be6b1e..87f8c248f 100644 --- a/source/backend/native/distrho-notes.cpp +++ b/source/backend/native/distrho-notes.cpp @@ -21,11 +21,17 @@ #include "notes/DistrhoPluginNotes.cpp" #include "notes/DistrhoUINotes.cpp" +// FIXME - link to widgets +#include "notes/ParamProgressBar.cpp" +#include "moc_ParamProgressBar.cpp" + // Carla DISTRHO Plugin #include "distrho/DistrhoPluginCarla.cpp" START_NAMESPACE_DISTRHO +#include "moc_DistrhoUINotes.cpp" + // ----------------------------------------------------------------------- static const PluginDescriptor notesDesc = { diff --git a/source/backend/native/notes/ParamProgressBar.cpp b/source/backend/native/notes/ParamProgressBar.cpp index 7c584ae2a..03286d9d9 100644 --- a/source/backend/native/notes/ParamProgressBar.cpp +++ b/source/backend/native/notes/ParamProgressBar.cpp @@ -15,7 +15,7 @@ * For a full copy of the GNU General Public License see the COPYING file */ -#include "ParamProgressBar.h" +#include "ParamProgressBar.hpp" #include diff --git a/source/backend/plugin/NativePlugin.cpp b/source/backend/plugin/NativePlugin.cpp index b6ef34745..46cba12db 100644 --- a/source/backend/plugin/NativePlugin.cpp +++ b/source/backend/plugin/NativePlugin.cpp @@ -104,6 +104,7 @@ public: fHandle2(nullptr), fDescriptor(nullptr), fIsProcessing(false), + fIsUiVisible(false), fAudioInBuffers(nullptr), fAudioOutBuffers(nullptr), fMidiEventCount(0) @@ -128,6 +129,9 @@ public: if (fDescriptor != nullptr) { + if (fIsUiVisible) + fDescriptor->ui_show(fHandle, false); + if (fDescriptor->deactivate != nullptr && kData->activeBefore) { if (fHandle != nullptr) @@ -487,6 +491,8 @@ public: else if (fDescriptor->ui_show != nullptr) fDescriptor->ui_show(fHandle, yesNo); } + + fIsUiVisible = yesNo; } void idleGui() @@ -494,7 +500,7 @@ public: CARLA_ASSERT(fDescriptor != nullptr); CARLA_ASSERT(fHandle != nullptr); - if (fDescriptor != nullptr && fHandle != nullptr && fDescriptor->ui_idle != nullptr) + if (fIsUiVisible) fDescriptor->ui_idle(fHandle); } @@ -1641,6 +1647,7 @@ protected: void handleUiClosed() { kData->engine->callback(CALLBACK_SHOW_GUI, fId, 0, 0, 0.0f, nullptr); + fIsUiVisible = false; } public: @@ -1750,6 +1757,7 @@ private: const PluginDescriptor* fDescriptor; bool fIsProcessing; + bool fIsUiVisible; float** fAudioInBuffers; float** fAudioOutBuffers;