Skip to content

Commit

Permalink
Put the rest of the linux embed webview details in place
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Mar 15, 2024
1 parent 34c6858 commit 87c1267
Show file tree
Hide file tree
Showing 6 changed files with 447 additions and 431 deletions.
21 changes: 15 additions & 6 deletions src/plugin/DesktopPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class DesktopPlugin : public Plugin,
bool startingJackd = false;
bool startingModUI = false;
bool processing = false;
bool firstTimeActivating = true;
bool firstTimeProcessing = true;
float parameters[kParameterCount] = {};
float* tmpBuffers[2] = {};
Expand All @@ -44,7 +45,9 @@ class DesktopPlugin : public Plugin,
return;

// TODO check available ports
int availablePortNum = 1;
static int port = 1;
int availablePortNum = port;
port += 4;

envp = getEvironment(availablePortNum);

Expand All @@ -56,9 +59,6 @@ class DesktopPlugin : public Plugin,

portBaseNum = availablePortNum;

if (shm.init() && run())
startRunner(500);

bufferSizeChanged(getBufferSize());
}

Expand Down Expand Up @@ -303,9 +303,18 @@ class DesktopPlugin : public Plugin,

void activate() override
{
shm.reset();
if (firstTimeActivating)
{
firstTimeActivating = false;

if (envp != nullptr && shm.init() && run())
startRunner(500);
}
else
{
shm.reset();
}

firstTimeProcessing = true;
numFramesInShmBuffer = numFramesInTmpBuffer = 0;
}

Expand Down
22 changes: 4 additions & 18 deletions src/plugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ NAME = MOD-Desktop
# Files to build

FILES_DSP = DesktopPlugin.cpp utils.cpp
FILES_UI = DesktopUI.cpp NanoButton.cpp
FILES_UI = DesktopUI.cpp NanoButton.cpp utils.cpp

ifeq ($(MACOS),true)
FILES_UI += WebView.mm
Expand Down Expand Up @@ -43,25 +43,11 @@ LINK_FLAGS += -framework IOKit -framework WebKit
else ifeq ($(WINDOWS),true)
LINK_FLAGS += -lwinmm
else ifeq ($(LINUX),true)
LINK_FLAGS += -ldl
BUILD_CXX_FLAGS += $(shell $(PKG_CONFIG) --cflags Qt5Core) -std=gnu++14
LINK_FLAGS += -ldl -lrt
endif

TARGETS = jack vst2

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

ifeq ($(LINUX),true)

TARGETS += $(TARGET_DIR)/MOD-Desktop-WebView

$(TARGET_DIR)/MOD-Desktop-WebView: $(BUILD_DIR)/WebViewQt.cpp.o
$(CXX) $^ $(LINK_FLAGS) $(shell $(PKG_CONFIG) --libs x11) -o $@

$(BUILD_DIR)/WebViewQt.cpp.o: BUILD_CXX_FLAGS += -std=gnu++14 $(shell $(PKG_CONFIG) --cflags Qt5Widgets x11)

-include $(BUILD_DIR)/WebViewQt.cpp.d

endif
TARGETS = clap lv2_sep vst2 vst3

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

Expand Down
Loading

0 comments on commit 87c1267

Please sign in to comment.