From d29c882faad4edbb23d5be05c1f083c27353c16d Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 11 Oct 2023 12:37:18 +0200 Subject: [PATCH] Cleanup and fixing Signed-off-by: falkTX --- Makefile | 12 +++++++---- dpf | 2 +- plugins/NeuralRecord/MOD/manifest.ttl | 2 +- .../MOD/modgui/icon-profiler.html | 13 +++++------- .../MOD/modgui/script-profiler.js | 6 +++--- plugins/NeuralRecord/Makefile | 3 ++- plugins/NeuralRecord/PluginNeuralCapture.hpp | 2 ++ plugins/NeuralRecord/profiler.cc | 20 +++++++++---------- 8 files changed, 31 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index aac6657..fbd82b9 100644 --- a/Makefile +++ b/Makefile @@ -76,9 +76,11 @@ export USER_DSSI_DIR USER_LADSPA_DIR USER_LV2_DIR USER_VST2_DIR USER_VST3_DIR US # -------------------------------------------------------------- # Targets +ifneq ($(MOD_BUILD),true) all: libs plugins gen - -mod: MOD +else +all: MOD +endif # -------------------------------------------------------------- @@ -86,12 +88,14 @@ submodules: git submodule update --init --recursive libs: - $(MAKE) -C dpf/dgl ../build/libdgl-cairo.a +ifeq ($(HAVE_CAIRO),true) + $(MAKE) -C dpf/dgl cairo +endif plugins: libs $(MAKE) all -C plugins/NeuralRecord -MOD: clean +MOD: $(MAKE) mod -C plugins/NeuralRecord ifneq ($(CROSS_COMPILING),true) diff --git a/dpf b/dpf index 07d7344..af5c3bd 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit 07d73447c881264978b60c270b6c754c1489bd78 +Subproject commit af5c3bda07a28ecc7c7d60c98ffcfbeb8e89f396 diff --git a/plugins/NeuralRecord/MOD/manifest.ttl b/plugins/NeuralRecord/MOD/manifest.ttl index da6f40e..3817dc9 100644 --- a/plugins/NeuralRecord/MOD/manifest.ttl +++ b/plugins/NeuralRecord/MOD/manifest.ttl @@ -12,6 +12,6 @@ a pset:Preset ; lv2:appliesTo ; - rdfs:label "" ; + rdfs:label "Default" ; rdfs:seeAlso . diff --git a/plugins/NeuralRecord/MOD/modgui/icon-profiler.html b/plugins/NeuralRecord/MOD/modgui/icon-profiler.html index 06f17d5..22f24dd 100644 --- a/plugins/NeuralRecord/MOD/modgui/icon-profiler.html +++ b/plugins/NeuralRecord/MOD/modgui/icon-profiler.html @@ -1,19 +1,16 @@
- +
-

{{label}}

- {{#controls.0}} -
- {{/controls.0}} +
-
+
-
-
+
+
{{#effect.ports.audio.input}} diff --git a/plugins/NeuralRecord/MOD/modgui/script-profiler.js b/plugins/NeuralRecord/MOD/modgui/script-profiler.js index f27994e..af9f2ff 100644 --- a/plugins/NeuralRecord/MOD/modgui/script-profiler.js +++ b/plugins/NeuralRecord/MOD/modgui/script-profiler.js @@ -1,8 +1,8 @@ function (event) { - const meter = event.icon.find ('[mod-role=METER]'); - const state = event.icon.find ('[mod-role=STATE]'); - const popup = event.icon.find ('[mod-role=POPUP]'); + const meter = event.icon.find ('[mod-port-symbol=METER]'); + const state = event.icon.find ('[mod-port-symbol=STATE]'); + const popup = event.icon.find ('.popup'); var position = "0"; diff --git a/plugins/NeuralRecord/Makefile b/plugins/NeuralRecord/Makefile index 102750c..071d3a0 100644 --- a/plugins/NeuralRecord/Makefile +++ b/plugins/NeuralRecord/Makefile @@ -34,7 +34,8 @@ FILES_UI = \ UI_TYPE = cairo include ../../dpf/Makefile.plugins.mk -BUILD_CXX_FLAGS += -pthread `pkg-config --cflags sndfile` `pkg-config --libs sndfile` +BUILD_CXX_FLAGS += -pthread $(shell $(PKG_CONFIG) --cflags sndfile) +LINK_FLAGS += -pthread $(shell $(PKG_CONFIG) --libs sndfile) # -------------------------------------------------------------- # Enable all selected plugin types diff --git a/plugins/NeuralRecord/PluginNeuralCapture.hpp b/plugins/NeuralRecord/PluginNeuralCapture.hpp index 0e2e5a4..08014f2 100644 --- a/plugins/NeuralRecord/PluginNeuralCapture.hpp +++ b/plugins/NeuralRecord/PluginNeuralCapture.hpp @@ -134,6 +134,8 @@ struct Preset { const Preset factoryPresets[] = { { + "Default", + { 0.f, 0.f, 0.f, 0.f } } //,{ // "Another preset", // preset name diff --git a/plugins/NeuralRecord/profiler.cc b/plugins/NeuralRecord/profiler.cc index 2d09ef2..294b69e 100644 --- a/plugins/NeuralRecord/profiler.cc +++ b/plugins/NeuralRecord/profiler.cc @@ -245,7 +245,7 @@ inline std::string Profil::get_path() { std::string pPath; #ifndef __MOD_DEVICES__ -#if defined(WIN32) || defined(_WIN32) +#ifdef _WIN32 pPath = getenv("USERPROFILE"); if (pPath.empty()) { pPath = getenv("HOMEDRIVE"); @@ -254,15 +254,16 @@ inline std::string Profil::get_path() { #else pPath = getenv("HOME"); #endif - pPath +=PATH_SEPARATOR; - pPath +="profiles"; - pPath +=PATH_SEPARATOR; - + pPath += PATH_SEPARATOR "profiles" PATH_SEPARATOR; #else - pPath = "/data/user-files/Audio Recordings/profiles/"; + if (const char* const userFilesDir = std::getenv("MOD_USER_FILES_DIR")) + pPath = userFilesDir; + else + pPath = "/data/user-files"; + pPath += PATH_SEPARATOR "Audio Recordings" PATH_SEPARATOR "profiles" PATH_SEPARATOR; #endif if (!(stat(pPath.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode))) { -#if defined(WIN32) || defined(_WIN32) +#ifdef _WIN32 mkdir(pPath.c_str()); #else mkdir(pPath.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); @@ -282,10 +283,7 @@ inline std::string Profil::get_ifilename() { struct stat sb; char * path = strdup(get_profile_library_path().data()); std::string iname = dirname(path); - iname += PATH_SEPARATOR; - iname += "resources"; - iname += PATH_SEPARATOR; - iname += "input.wav"; + iname += PATH_SEPARATOR "resources" PATH_SEPARATOR "input.wav"; std::string oname = get_path() + "input.wav"; if (stat (oname.c_str(), &sb) != 0 && stat (iname.c_str(), &sb) == 0) { std::ifstream src(iname.c_str(), std::ios::binary);