Browse Source

Make it compatible with debian packaged versions

Signed-off-by: falkTX <falktx@falktx.com>
master
falkTX 1 year 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.
*/

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

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

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

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

projectMKeycode pmKey = PROJECTM_K_NONE;

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

# 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_THREADS=1
# GLES stuff


Loading…
Cancel
Save