From 60f87adeda0d76850b61324f484b7e40832e19e7 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 13 Feb 2019 19:00:40 +0000 Subject: added projectm 3.1 support (#998) git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8708 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Visual/projectm/CMakeLists.txt | 6 ++++++ src/plugins/Visual/projectm/projectm.pro | 2 ++ src/plugins/Visual/projectm/projectmwrapper.cpp | 10 +++++++++- src/plugins/Visual/projectm/projectmwrapper.h | 6 +++++- 4 files changed, 22 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/Visual/projectm/CMakeLists.txt b/src/plugins/Visual/projectm/CMakeLists.txt index 6e724723b..15697f879 100644 --- a/src/plugins/Visual/projectm/CMakeLists.txt +++ b/src/plugins/Visual/projectm/CMakeLists.txt @@ -15,6 +15,12 @@ ELSE(${Qt5Gui_OPENGL_IMPLEMENTATION} STREQUAL GL) MESSAGE(WARNING "Unsuppoted OpenGL implementation, projectM disabled") ENDIF(${Qt5Gui_OPENGL_IMPLEMENTATION} STREQUAL GL) +pkg_search_module(PROJECTM_31 libprojectM>=3.1.0) + +IF(PROJECTM_31_FOUND) +ADD_DEFINITIONS(-DPROJECTM_31) +ENDIF(PROJECTM_31_FOUND) + find_file(PROJECTM_CONFIG config.inp PATHS "/usr/share/projectM/" "/usr/local/share/projectM/") diff --git a/src/plugins/Visual/projectm/projectm.pro b/src/plugins/Visual/projectm/projectm.pro index 171650a78..042a881e3 100644 --- a/src/plugins/Visual/projectm/projectm.pro +++ b/src/plugins/Visual/projectm/projectm.pro @@ -13,6 +13,8 @@ SOURCES += projectmplugin.cpp \ RESOURCES = translations/translations.qrc +#DEFINES += PROJECTM_31 + unix { PKGCONFIG += libprojectM target.path = $$PLUGIN_DIR/Visual diff --git a/src/plugins/Visual/projectm/projectmwrapper.cpp b/src/plugins/Visual/projectm/projectmwrapper.cpp index eb8a2d07e..a9022f3ad 100644 --- a/src/plugins/Visual/projectm/projectmwrapper.cpp +++ b/src/plugins/Visual/projectm/projectmwrapper.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2013 by Ilya Kotov * + * Copyright (C) 2013-2019 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -40,8 +40,16 @@ void ProjectMWrapper::selectPreset(int index) projectM::selectPreset(index); } +#ifdef PROJECTM_31 +void ProjectMWrapper::presetSwitchedEvent(bool isHardCut, size_t index) const +{ + Q_UNUSED(isHardCut); + emit currentPresetChanged(index); +} +#else void ProjectMWrapper::presetSwitchedEvent(bool isHardCut, unsigned int index) const { Q_UNUSED(isHardCut); emit currentPresetChanged(index); } +#endif diff --git a/src/plugins/Visual/projectm/projectmwrapper.h b/src/plugins/Visual/projectm/projectmwrapper.h index 1fe947499..25f9546d1 100644 --- a/src/plugins/Visual/projectm/projectmwrapper.h +++ b/src/plugins/Visual/projectm/projectmwrapper.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2013 by Ilya Kotov * + * Copyright (C) 2013-2019 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -40,7 +40,11 @@ public slots: void selectPreset(int index); private: +#ifdef PROJECTM_31 + void presetSwitchedEvent(bool isHardCut, size_t index) const override; +#else void presetSwitchedEvent(bool isHardCut, unsigned int index) const override; +#endif }; -- cgit v1.2.3-13-gbd6f