diff options
author | Chris Xiong <chirs241097@gmail.com> | 2019-09-13 00:52:25 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2019-09-13 00:52:25 +0800 |
commit | 9fecb429a37bcaa577aaa972139f6db3ce17ac50 (patch) | |
tree | 046a2a47b6e5aa67ad65121387781a4ea191210c | |
parent | aec5e972e8968255e8843eb22314b96a8f23b041 (diff) | |
download | QMidiPlayer-9fecb429a37bcaa577aaa972139f6db3ce17ac50.tar.xz |
CMake. It's happening.
Added a new build system based on CMake.
Minor code cleanups.
This probably breaks building with QMake on multiple
platforms. And of course the new CMake support isn't tested
thoroughly. But it's finally happening.
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | CMakeLists.txt | 26 | ||||
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | README.md | 16 | ||||
-rw-r--r-- | core/CMakeLists.txt | 19 | ||||
-rw-r--r-- | core/qmpmidioutrtmidi.cpp | 2 | ||||
-rw-r--r-- | core/qmpmidioutrtmidi.hpp | 2 | ||||
-rw-r--r-- | midifmt-plugin/CMakeLists.txt | 10 | ||||
-rw-r--r-- | qmidiplayer-desktop/CMakeLists.txt | 62 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmidiplayer-desktop.pro | 7 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpmainwindow.cpp | 1 | ||||
-rw-r--r-- | sample-plugin/CMakeLists.txt | 10 | ||||
-rw-r--r-- | simple-visualization/CMakeLists.txt | 22 | ||||
-rw-r--r-- | visualization/CMakeLists.txt | 38 | ||||
m--------- | visualization/SMELT | 0 |
15 files changed, 210 insertions, 18 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..62ea702 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "visualization/SMELT"] + path = visualization/SMELT + url = https://github.com/BearKidsTeam/SMELT.git diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..92ba7f7 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.10.0) + +project(QMidiPlayer C CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +include(FindPkgConfig) +find_package(Qt5 COMPONENTS Widgets REQUIRED) +find_package(Threads REQUIRED) +pkg_search_module(fluidsynth REQUIRED fluidsynth>=2.0.0) +pkg_search_module(rtmidi REQUIRED rtmidi) + +option(BUILD_VISUALIZATION "Build visualization plugin" ON) + +add_subdirectory(core) +add_subdirectory(qmidiplayer-desktop) +add_subdirectory(sample-plugin) +add_subdirectory(midifmt-plugin) +add_subdirectory(simple-visualization) +if(BUILD_VISUALIZATION) + add_subdirectory(visualization) +endif() @@ -1,3 +1,13 @@ +2019-09-13 0.8.7 indev +CMake. It's happening. + +Added a new build system based on CMake. +Minor code cleanups. + +This probably breaks building with QMake on multiple +platforms. And of course the new CMake support isn't tested +thoroughly. But it's finally happening. + 2019-09-10 0.8.7 indev We refactorin', eh? Hell yeah. @@ -4,14 +4,14 @@ A cross-platform midi file player based on libfluidsynth and Qt. [Project homepage](https://chrisoft.org/QMidiPlayer/) Features: -* Channel mute/solo -* Editing channel parameters on-the-fly -* Playlists -* Editing synthesizer effects -* Rendering midi to wave file (currently fluidsynth only) -* Visualization using SMELT (experimental Windows version now available) -* MIDI mapping (RtMidi and plugins) -* Plugin interface for extending the player easily +- Channel mute/solo +- Editing channel parameters on-the-fly +- Playlists +- Editing synthesizer effects +- Rendering midi to wave file (currently fluidsynth only) +- Visualization using SMELT (experimental Windows version now available) +- MIDI mapping (RtMidi and plugins) +- Plugin interface for extending the player easily Tested on Debian sid and Windows Vista~10. diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt new file mode 100644 index 0000000..2086a30 --- /dev/null +++ b/core/CMakeLists.txt @@ -0,0 +1,19 @@ +set(qmpcore_SOURCES + qmpmidioutfluid.hpp + qmpmidioutfluid.cpp + qmpmidioutrtmidi.hpp + qmpmidioutrtmidi.cpp + qmpmidiplay.hpp + qmpmidiplay.cpp + qmpmidiread.cpp +) + +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +include_directories(${fluidsynth_INCLUDE_DIRS}) +include_directories(${rtmidi_INCLUDE_DIRS}) +include_directories(${PROJECT_SOURCE_DIR}/include/) + +add_library(qmpcore STATIC + ${qmpcore_SOURCES} +) diff --git a/core/qmpmidioutrtmidi.cpp b/core/qmpmidioutrtmidi.cpp index 1a18e46..c37fadc 100644 --- a/core/qmpmidioutrtmidi.cpp +++ b/core/qmpmidioutrtmidi.cpp @@ -4,7 +4,7 @@ #include <algorithm> #include <deque> #include <vector> -#include RT_MIDI_H +#include "rtmidi/RtMidi.h" #include "qmpmidioutrtmidi.hpp" void split(std::string s,char c,std::deque<std::string>& v) diff --git a/core/qmpmidioutrtmidi.hpp b/core/qmpmidioutrtmidi.hpp index 0c1843c..0a4fd60 100644 --- a/core/qmpmidioutrtmidi.hpp +++ b/core/qmpmidioutrtmidi.hpp @@ -4,7 +4,7 @@ #include <vector> #define QMP_MAIN #include "../include/qmpcorepublic.hpp" -#include RT_MIDI_H +#include "rtmidi/RtMidi.h" struct qmpDeviceInitializer { CMidiTrack initseq; diff --git a/midifmt-plugin/CMakeLists.txt b/midifmt-plugin/CMakeLists.txt new file mode 100644 index 0000000..5b1902a --- /dev/null +++ b/midifmt-plugin/CMakeLists.txt @@ -0,0 +1,10 @@ +set(midifmt-plugin_SOURCES + midifmtplugin.hpp + midifmtplugin.cpp +) + +include_directories(${PROJECT_SOURCE_DIR}/include/) + +add_library(midifmt-plugin MODULE + ${midifmt-plugin_SOURCES} +) diff --git a/qmidiplayer-desktop/CMakeLists.txt b/qmidiplayer-desktop/CMakeLists.txt new file mode 100644 index 0000000..1f40a2e --- /dev/null +++ b/qmidiplayer-desktop/CMakeLists.txt @@ -0,0 +1,62 @@ +set(qmpdesktop_SOURCES + qdialskulpturestyle.hpp + qmpchanneleditor.hpp + qmpchannelswindow.hpp + qmpcustomizewindow.hpp + qmpdevpropdialog.hpp + qmpefxwindow.hpp + qmphelpwindow.hpp + qmpinfowindow.hpp + qmpmainwindow.hpp + qmpplistwindow.hpp + qmpplugin.hpp + qmppresetselect.hpp + qmpsettingswindow.hpp + main.cpp + qdialskulpturestyle.cpp + qmpchanneleditor.cpp + qmpchannelswindow.cpp + qmpcustomizewindow.cpp + qmpdevpropdialog.cpp + qmpefxwindow.cpp + qmphelpwindow.cpp + qmpinfowindow.cpp + qmpmainwindow.cpp + qmpplistwindow.cpp + qmpplugin.cpp + qmppresetselect.cpp + qmpsettingswindow.cpp + qmpchanneleditor.ui + qmpchannelswindow.ui + qmpcustomizewindow.ui + qmpdevpropdialog.ui + qmpefxwindow.ui + qmphelpwindow.ui + qmpinfowindow.ui + qmpmainwindow.ui + qmpplistwindow.ui + qmppresetselect.ui + qmpsettingswindow.ui + resources.qrc +) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +include_directories(${fluidsynth_INCLUDE_DIRS}) +include_directories(${rtmidi_INCLUDE_DIRS}) +include_directories(${PROJECT_SOURCE_DIR}/include/) + +add_executable(qmidiplayer + ${qmpdesktop_SOURCES} +) + +target_link_libraries(qmidiplayer + Qt5::Widgets + qmpcore + ${fluidsynth_LIBRARIES} + ${rtmidi_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} + ${CMAKE_DL_LIBS} +) diff --git a/qmidiplayer-desktop/qmidiplayer-desktop.pro b/qmidiplayer-desktop/qmidiplayer-desktop.pro index 193c0e5..53fc7c3 100644 --- a/qmidiplayer-desktop/qmidiplayer-desktop.pro +++ b/qmidiplayer-desktop/qmidiplayer-desktop.pro @@ -77,12 +77,6 @@ unix{ message(Building in packaging mode...) DEFINES += QMP_BUILD_UNIX_PACKAGE } - exists("/usr/include/RtMidi.h") { - DEFINES += RT_MIDI_H=\\\"/usr/include/RtMidi.h\\\" - } - exists("/usr/include/rtmidi/RtMidi.h") { - DEFINES += RT_MIDI_H=\\\"/usr/include/rtmidi/RtMidi.h\\\" - } QMAKE_CXXFLAGS_RELEASE -= -O2 QMAKE_CXXFLAGS_RELEASE += -O3 QMAKE_LFLAGS_RELEASE -= -O1 @@ -113,7 +107,6 @@ unix{ LIBS += -lfluidsynth -lrtmidi -ldl } win32{ - DEFINES += RT_MIDI_H=\\\"RtMidi.h\\\" #change these before building... LIBS += -lfluidsynth -lwinmm -lRtMidi RC_FILE = qmidiplayer.rc diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp index 95b2da3..e097c62 100644 --- a/qmidiplayer-desktop/qmpmainwindow.cpp +++ b/qmidiplayer-desktop/qmpmainwindow.cpp @@ -118,7 +118,6 @@ void qmpMainWindow::init() pmgr->scanPlugins();settingsw->updatePluginList(pmgr);pmgr->initPlugins(); ui->vsMasterVol->setValue(qmpSettingsWindow::getSettingsIntf()->value("Audio/Gain",50).toInt()); connect(timer,SIGNAL(timeout()),this,SLOT(updateWidgets())); - connect(timer,SIGNAL(timeout()),chnlw,SLOT(channelWindowsUpdate())); connect(timer,SIGNAL(timeout()),infow,SLOT(updateInfo())); ui->pbNext->setIcon(QIcon(getThemedIcon(":/img/next.svg"))); ui->pbPrev->setIcon(QIcon(getThemedIcon(":/img/prev.svg"))); diff --git a/sample-plugin/CMakeLists.txt b/sample-plugin/CMakeLists.txt new file mode 100644 index 0000000..be8913b --- /dev/null +++ b/sample-plugin/CMakeLists.txt @@ -0,0 +1,10 @@ +set(sampleplugin_SOURCES + sampleplugin.hpp + sampleplugin.cpp +) + +include_directories(${PROJECT_SOURCE_DIR}/include/) + +add_library(sampleplugin MODULE + ${sampleplugin_SOURCES} +) diff --git a/simple-visualization/CMakeLists.txt b/simple-visualization/CMakeLists.txt new file mode 100644 index 0000000..777640f --- /dev/null +++ b/simple-visualization/CMakeLists.txt @@ -0,0 +1,22 @@ +set(simple-visualization_SOURCES + qmpkeyboardwindow.hpp + qmppianowidget.hpp + simplevisualization.hpp + qmpkeyboardwindow.cpp + qmppianowidget.cpp + simplevisualization.cpp +) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +include_directories(${PROJECT_SOURCE_DIR}/include/) + +add_library(simple-visualization MODULE + ${simple-visualization_SOURCES} +) + +target_link_libraries(simple-visualization + Qt5::Widgets +) diff --git a/visualization/CMakeLists.txt b/visualization/CMakeLists.txt new file mode 100644 index 0000000..fb88e10 --- /dev/null +++ b/visualization/CMakeLists.txt @@ -0,0 +1,38 @@ +set(visualization_SOURCES + extrasmeltutils.hpp + qmpvirtualpiano3d.hpp + qmpvisualization.hpp + extrasmeltutils.cpp + qmpvirtualpiano3d.cpp + qmpvisualization.cpp +) + +set(BUILD_DUMB ON) +set(BUILD_EXAMPLE OFF) +add_subdirectory(SMELT) + +find_package(glfw3 REQUIRED) +find_package(GLEW REQUIRED) +find_package(DevIL REQUIRED) +find_package(ZLIB REQUIRED) +find_package(Freetype REQUIRED) +find_package(OpenGL REQUIRED COMPONENTS OpenGL) + +include_directories(${PROJECT_SOURCE_DIR}/include/) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/SMELT/include) +include_directories(${FREETYPE_INCLUDE_DIRS}) + +add_library(visualization MODULE + ${visualization_SOURCES} +) + +target_link_libraries(visualization + ${FREETYPE_LIBRARIES} + ${ZLIB_LIBRARIES} + smeltext + smelt + ${IL_LIBRARIES} + glfw + ${GLEW_LIBRARIES} + OpenGL::GL +) diff --git a/visualization/SMELT b/visualization/SMELT new file mode 160000 +Subproject 2836b3d1bdb32765950b8e3133a2452d8e7b98d |