Browse Source

Make it compatible with debian packaged versions

Signed-off-by: falkTX <falktx@falktx.com>
master
falkTX 3 years ago
parent
commit
bbb2abe2f8
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 19 additions and 1 deletions
  1. +11
    -0
      plugins/ProM/DistrhoUIProM.cpp
  2. +8
    -1
      plugins/ProM/Makefile

+ 11
- 0
plugins/ProM/DistrhoUIProM.cpp View File

@@ -14,7 +14,14 @@
* For a full copy of the license see the LICENSE file. * For a full copy of the license see the LICENSE file.
*/ */


/* s/private/public/ as workaround old projectM versions */
#define private public
#include "libprojectM/projectM.hpp" #include "libprojectM/projectM.hpp"
#undef private

#ifndef PROJECTM_DATA_DIR
#include "libprojectM/projectM-opengl.h"
#endif


#include "DistrhoPluginProM.hpp" #include "DistrhoPluginProM.hpp"
#include "DistrhoUIProM.hpp" #include "DistrhoUIProM.hpp"
@@ -253,6 +260,7 @@ bool DistrhoUIProM::onKeyboard(const KeyboardEvent& ev)
if (fPM == nullptr) if (fPM == nullptr)
return false; return false;


#ifdef HAVE_PROJECTM_TEXT_FUNCTIONS
// special handling for text // special handling for text
if (fPM->isTextInputActive(true) && !ev.press) if (fPM->isTextInputActive(true) && !ev.press)
{ {
@@ -269,6 +277,7 @@ bool DistrhoUIProM::onKeyboard(const KeyboardEvent& ev)
return true; return true;
} }
} }
#endif


projectMKeycode pmKey = PROJECTM_K_NONE; projectMKeycode pmKey = PROJECTM_K_NONE;


@@ -304,12 +313,14 @@ bool DistrhoUIProM::onKeyboard(const KeyboardEvent& ev)
case '\r': case '\r':
pmKey = PROJECTM_K_RETURN; pmKey = PROJECTM_K_RETURN;
break; break;
#ifdef HAVE_PROJECTM_TEXT_FUNCTIONS
case '/': case '/':
pmKey = PROJECTM_K_SLASH; pmKey = PROJECTM_K_SLASH;
break; break;
case '\\': case '\\':
pmKey = PROJECTM_K_BACKSLASH; pmKey = PROJECTM_K_BACKSLASH;
break; break;
#endif
case '+': case '+':
pmKey = PROJECTM_K_PLUS; pmKey = PROJECTM_K_PLUS;
break; break;


+ 8
- 1
plugins/ProM/Makefile View File

@@ -116,9 +116,16 @@ BASE_FLAGS += -DPROJECTM_DATA_DIR='"$(shell pkg-config --variable=pkgdatadir lib
BASE_FLAGS += $(shell pkg-config --cflags libprojectM) BASE_FLAGS += $(shell pkg-config --cflags libprojectM)
LINK_FLAGS += $(shell pkg-config --libs libprojectM) LINK_FLAGS += $(shell pkg-config --libs libprojectM)


ifeq ($(shell pkg-config --atleast-version=3.1.8 libprojectM && echo true),true)
BASE_FLAGS += -DHAVE_PROJECTM_TEXT_FUNCTIONS
endif

else # HAVE_PROJECTM else # HAVE_PROJECTM


# compiler macros
# custom macros for ProM
BASE_FLAGS += -DHAVE_PROJECTM_TEXT_FUNCTIONS

# compiler macros from projectM
BASE_FLAGS += -DUSE_TEXT_MENU=1 BASE_FLAGS += -DUSE_TEXT_MENU=1
BASE_FLAGS += -DUSE_THREADS=1 BASE_FLAGS += -DUSE_THREADS=1
# GLES stuff # GLES stuff


Loading…
Cancel
Save