Browse Source

Fix new code carla for plugin bridge use

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.5.0
falkTX 2 years ago
parent
commit
0411f60476
4 changed files with 55 additions and 20 deletions
  1. +1
    -1
      source/bridges-plugin/CarlaBridgePlugin.cpp
  2. +37
    -12
      source/bridges-plugin/Makefile
  3. +12
    -6
      source/modules/carla_juce/carla_juce.cpp
  4. +5
    -1
      source/modules/carla_juce/carla_juce.h

+ 1
- 1
source/bridges-plugin/CarlaBridgePlugin.cpp View File

@@ -229,7 +229,7 @@ public:
gIsInitiated = true;

#if defined(USING_JUCE) && (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN))
CarlaJUCE::setupAndUseMainApplication();
CarlaJUCE::setupAndUseMainApplication(gIdle, &gCloseNow);
#else
int64_t timeToEnd = 0;



+ 37
- 12
source/bridges-plugin/Makefile View File

@@ -366,6 +366,11 @@ $(OBJDIR)/CarlaBridgePlugin.cpp.arm32.o: CarlaBridgePlugin.cpp
@echo "Compiling $< (arm32 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(ARM32_FLAGS) -c -o $@

$(OBJDIR)/CarlaPluginJuce.arm32.o: $(CWD)/backend/plugin/CarlaPluginJuce.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaPluginJuce.cpp (arm32 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(ARM32_FLAGS) -std=gnu++14 -c -o $@

$(OBJDIR)/CarlaStandalone.cpp.arm32.o: $(CWD)/backend/CarlaStandalone.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaStandalone.cpp (arm32 bridge)"
@@ -393,7 +398,7 @@ $(OBJDIR)/CarlaPluginVST2.cpp.posix32.o: $(CWD)/backend/plugin/CarlaPluginVST2.c
$(OBJDIR)/CarlaPluginJuce.cpp.posix32.o: $(CWD)/backend/plugin/CarlaPluginJuce.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaPluginJuce.cpp (posix32 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -ObjC++ -c -o $@
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -ObjC++ -std=gnu++14 -c -o $@

$(OBJDIR)/CarlaBridgePlugin.cpp.posix32.o: CarlaBridgePlugin.cpp
-@mkdir -p $(OBJDIR)
@@ -405,6 +410,11 @@ $(OBJDIR)/CarlaStandalone.cpp.posix32.o: $(CWD)/backend/CarlaStandalone.cpp
@echo "Compiling CarlaStandalone.cpp (posix32 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -ObjC++ -c -o $@
else
$(OBJDIR)/CarlaPluginJuce.cpp.posix32.o: $(CWD)/backend/plugin/CarlaPluginJuce.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaPluginJuce.cpp (posix32 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -std=gnu++14 -c -o $@

$(OBJDIR)/CarlaBridgePlugin.cpp.posix32.o: CarlaBridgePlugin.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $< (posix32 bridge)"
@@ -438,7 +448,7 @@ $(OBJDIR)/CarlaPluginVST2.cpp.posix64.o: $(CWD)/backend/plugin/CarlaPluginVST2.c
$(OBJDIR)/CarlaPluginJuce.cpp.posix64.o: $(CWD)/backend/plugin/CarlaPluginJuce.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaPluginJuce.cpp (posix64 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -ObjC++ -c -o $@
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -ObjC++ -std=gnu++14 -c -o $@

$(OBJDIR)/CarlaBridgePlugin.cpp.posix64.o: CarlaBridgePlugin.cpp
-@mkdir -p $(OBJDIR)
@@ -450,6 +460,11 @@ $(OBJDIR)/CarlaStandalone.cpp.posix64.o: $(CWD)/backend/CarlaStandalone.cpp
@echo "Compiling CarlaStandalone.cpp (posix64 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -ObjC++ -c -o $@
else
$(OBJDIR)/CarlaPluginJuce.cpp.posix64.o: $(CWD)/backend/plugin/CarlaPluginJuce.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaPluginJuce.cpp (posix64 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -std=gnu++14 -c -o $@

$(OBJDIR)/CarlaBridgePlugin.cpp.posix64.o: CarlaBridgePlugin.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $< (posix64 bridge)"
@@ -479,6 +494,16 @@ $(OBJDIR)/CarlaBridgePlugin.cpp.win32.o: CarlaBridgePlugin.cpp
@echo "Compiling $< (win32 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@

$(OBJDIR)/CarlaPluginJuce.cpp.win32.o: $(CWD)/backend/plugin/CarlaPluginJuce.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaPluginJuce.cpp (win32 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -std=gnu++14 -c -o $@

$(OBJDIR)/CarlaStandalone.cpp.win32.o: $(CWD)/backend/CarlaStandalone.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaStandalone.cpp (win32 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@

$(OBJDIR)/CarlaEng%.cpp.win32.o: $(CWD)/backend/engine/CarlaEng%.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaEng$*.cpp (win32 bridge)"
@@ -489,11 +514,6 @@ $(OBJDIR)/CarlaPlug%.cpp.win32.o: $(CWD)/backend/plugin/CarlaPlug%.cpp
@echo "Compiling CarlaPlug$*.cpp (win32 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@

$(OBJDIR)/CarlaStandalone.cpp.win32.o: $(CWD)/backend/CarlaStandalone.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaStandalone.cpp (win32 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@

# ---------------------------------------------------------------------------------------------------------------------
# win64

@@ -502,6 +522,16 @@ $(OBJDIR)/CarlaBridgePlugin.cpp.win64.o: CarlaBridgePlugin.cpp
@echo "Compiling $< (win64 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@

$(OBJDIR)/CarlaPluginJuce.cpp.win64.o: $(CWD)/backend/plugin/CarlaPluginJuce.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaPluginJuce.cpp (win64 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -std=gnu++14 -c -o $@

$(OBJDIR)/CarlaStandalone.cpp.win64.o: $(CWD)/backend/CarlaStandalone.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaStandalone.cpp (win64 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@

$(OBJDIR)/CarlaEng%.cpp.win64.o: $(CWD)/backend/engine/CarlaEng%.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaEng$*.cpp (win64 bridge)"
@@ -512,11 +542,6 @@ $(OBJDIR)/CarlaPlug%.cpp.win64.o: $(CWD)/backend/plugin/CarlaPlug%.cpp
@echo "Compiling CarlaPlug$*.cpp (win64 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@

$(OBJDIR)/CarlaStandalone.cpp.win64.o: $(CWD)/backend/CarlaStandalone.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling CarlaStandalone.cpp (win64 bridge)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@

# ---------------------------------------------------------------------------------------------------------------------

-include $(OBJS_lv2:%.o=%.d)


+ 12
- 6
source/modules/carla_juce/carla_juce.cpp View File

@@ -123,6 +123,9 @@ void dispatchMessageManagerMessages()
#endif

#ifdef USE_STANDALONE_JUCE_APPLICATION
static std::function<void()> sIdleFn;
static volatile bool* sClosedSignalPtr;

class CarlaJuceApp : public juce::JUCEApplication,
private juce::Timer
{
@@ -137,7 +140,7 @@ public:

void shutdown() override
{
gCloseNow = true;
*sClosedSignalPtr = true;
stopTimer();
}

@@ -153,23 +156,26 @@ public:

void timerCallback() override
{
gIdle();
sIdleFn();

if (gCloseNow)
if (*sClosedSignalPtr)
{
quit();
gCloseNow = false;
*sClosedSignalPtr = false;
}
}
};

void setupAndUseMainApplication()
static juce::JUCEApplicationBase* juce_CreateApplication() { return new CarlaJuceApp(); }

void setupAndUseMainApplication(std::function<void()> idleFn, volatile bool* closedSignalPtr)
{
#ifndef CARLA_OS_WIN
static const int argc = 0;
static const char* argv[] = {};
#endif
static juce::JUCEApplicationBase* juce_CreateApplication() { return new CarlaJuceApp(); }
sIdleFn = idleFn;
sClosedSignalPtr = closedSignalPtr;
juce::JUCEApplicationBase::createInstance = &juce_CreateApplication;
juce::JUCEApplicationBase::main(JUCE_MAIN_FUNCTION_ARGS);
}


+ 5
- 1
source/modules/carla_juce/carla_juce.h View File

@@ -29,6 +29,10 @@
# endif
#endif

#ifdef USE_STANDALONE_JUCE_APPLICATION
# include <functional>
#endif

namespace juce {
class MessageManager;
}
@@ -58,7 +62,7 @@ void dispatchMessageManagerMessages();
#endif

#ifdef USE_STANDALONE_JUCE_APPLICATION
void setupAndUseMainApplication();
void setupAndUseMainApplication(std::function<void()> idleFn, volatile bool* closedSignalPtr);
#endif

} // namespace CarlaJUCE


Loading…
Cancel
Save