From 62ae7c6b4d677d085289edd6061c862415abdb74 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 31 Oct 2023 00:25:49 +0100 Subject: [PATCH] Use getBinaryFilename from DPF Signed-off-by: falkTX --- plugins/NeuralRecord/Makefile | 2 +- plugins/NeuralRecord/profiler.cc | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/plugins/NeuralRecord/Makefile b/plugins/NeuralRecord/Makefile index 34c7b3c..46370c1 100644 --- a/plugins/NeuralRecord/Makefile +++ b/plugins/NeuralRecord/Makefile @@ -34,7 +34,7 @@ FILES_UI = \ UI_TYPE = cairo include ../../dpf/Makefile.plugins.mk -BUILD_CXX_FLAGS += -pthread $(shell $(PKG_CONFIG) --cflags sndfile) +BUILD_CXX_FLAGS += -pthread $(shell $(PKG_CONFIG) --cflags sndfile) -DUSING_DPF LINK_FLAGS += -pthread $(shell $(PKG_CONFIG) --libs sndfile) # -------------------------------------------------------------- diff --git a/plugins/NeuralRecord/profiler.cc b/plugins/NeuralRecord/profiler.cc index f42c0c5..58f856f 100644 --- a/plugins/NeuralRecord/profiler.cc +++ b/plugins/NeuralRecord/profiler.cc @@ -19,6 +19,10 @@ #include "profiler.h" +#ifdef USING_DPF +#include "DistrhoPluginUtils.hpp" +#endif + namespace profiler { @@ -238,9 +242,17 @@ Profil::~Profil() { #endif } +#ifdef USING_DPF +// when using dpf, we already have ways to do this +std::string get_profile_library_path() { + return getBinaryFilename(); +} +#else +// can be useful for non-dpf builds #ifdef _WIN32 static HINSTANCE gInstance; +extern "C" __declspec (dllexport) BOOL WINAPI DllMain (HINSTANCE hInst, DWORD reason, LPVOID) { if (reason == DLL_PROCESS_ATTACH) @@ -264,6 +276,7 @@ std::string get_profile_library_path() { #endif return std::string(); } +#endif // get the path were to save the recording and the input file inline std::string Profil::get_path() {