Skip to content

Commit

Permalink
Use getBinaryFilename from DPF
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Oct 30, 2023
1 parent c4cf039 commit 62ae7c6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/NeuralRecord/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

# --------------------------------------------------------------
Expand Down
13 changes: 13 additions & 0 deletions plugins/NeuralRecord/profiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

#include "profiler.h"

#ifdef USING_DPF
#include "DistrhoPluginUtils.hpp"
#endif

namespace profiler {


Expand Down Expand Up @@ -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)
Expand All @@ -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() {
Expand Down

0 comments on commit 62ae7c6

Please sign in to comment.