Skip to content

Commit

Permalink
Make it compatible with debian packaged versions
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Oct 5, 2021
1 parent 6242a2c commit bbb2abe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 11 additions & 0 deletions plugins/ProM/DistrhoUIProM.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
{
Expand All @@ -269,6 +277,7 @@ bool DistrhoUIProM::onKeyboard(const KeyboardEvent& ev)
return true;
}
}
#endif

projectMKeycode pmKey = PROJECTM_K_NONE;

Expand Down Expand Up @@ -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;
Expand Down
9 changes: 8 additions & 1 deletion plugins/ProM/Makefile
Expand Up @@ -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
Expand Down

0 comments on commit bbb2abe

Please sign in to comment.