diff --git a/CMakeLists.txt b/CMakeLists.txt index 752864354..d9f9ac92f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,9 +18,11 @@ set(CMAKE_PROJECT_VERSION_PATCH 7) if (ANDROID) set(BUILD_GUI_DEFAULT OFF) + set(USE_RTMIDI_DEFAULT OFF) set(SYSTEM_SDL2_DEFAULT ON) else() set(BUILD_GUI_DEFAULT ON) + set(USE_RTMIDI_DEFAULT ON) set(SYSTEM_SDL2_DEFAULT OFF) endif() @@ -33,6 +35,7 @@ else() endif() option(BUILD_GUI "Build the tracker (disable to build only a headless player)" ${BUILD_GUI_DEFAULT}) +option(USE_RTMIDI "Build with MIDI support using RtMidi. Currently unfinished." ${USE_RTMIDI_DEFAULT}) option(WITH_JACK "Whether to build with JACK support. Auto-detects if JACK is available" ${WITH_JACK_DEFAULT}) option(SYSTEM_FMT "Use a system-installed version of fmt instead of the vendored one" OFF) option(SYSTEM_LIBSNDFILE "Use a system-installed version of libsndfile instead of the vendored one" OFF) @@ -105,20 +108,22 @@ else() message(STATUS "Using vendored libsndfile") endif() -if (SYSTEM_RTMIDI) - find_package(PkgConfig REQUIRED) - pkg_check_modules(RTMIDI REQUIRED rtmidi) - list(APPEND DEPENDENCIES_INCLUDE_DIRS ${RTMIDI_INCLUDE_DIRS}) - list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${RTMIDI_CFLAGS_OTHER}) - list(APPEND DEPENDENCIES_LIBRARIES ${RTMIDI_LIBRARIES}) - list(APPEND DEPENDENCIES_LIBRARY_DIRS ${RTMIDI_LIBRARY_DIRS}) - list(APPEND DEPENDENCIES_LINK_OPTIONS ${RTMIDI_LDFLAGS_OTHER}) - list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${RTMIDI_LDFLAGS}) - message(STATUS "Using system-installed RtMidi") -else() - add_subdirectory(extern/rtmidi EXCLUDE_FROM_ALL) - list(APPEND DEPENDENCIES_LIBRARIES rtmidi) - message(STATUS "Using vendored RtMidi") +if (USE_RTMIDI) + if (SYSTEM_RTMIDI) + find_package(PkgConfig REQUIRED) + pkg_check_modules(RTMIDI REQUIRED rtmidi) + list(APPEND DEPENDENCIES_INCLUDE_DIRS ${RTMIDI_INCLUDE_DIRS}) + list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${RTMIDI_CFLAGS_OTHER}) + list(APPEND DEPENDENCIES_LIBRARIES ${RTMIDI_LIBRARIES}) + list(APPEND DEPENDENCIES_LIBRARY_DIRS ${RTMIDI_LIBRARY_DIRS}) + list(APPEND DEPENDENCIES_LINK_OPTIONS ${RTMIDI_LDFLAGS_OTHER}) + list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${RTMIDI_LDFLAGS}) + message(STATUS "Using system-installed RtMidi") + else() + add_subdirectory(extern/rtmidi EXCLUDE_FROM_ALL) + list(APPEND DEPENDENCIES_LIBRARIES rtmidi) + message(STATUS "Using vendored RtMidi") + endif() endif() if (SYSTEM_ZLIB) @@ -210,6 +215,13 @@ else() message(STATUS "Building without JACK support") endif() +if (USE_RTMIDI) + list(APPEND AUDIO_SOURCES src/audio/rtmidi.cpp) + message(STATUS "Building with RtMidi") +else() + message(STATUS "Building without RtMidi") +endif() + set(ENGINE_SOURCES src/log.cpp src/fileutils.cpp diff --git a/demos/super_fantasy_zone_mango.fur b/demos/super_fantasy_zone_mango.fur new file mode 100644 index 000000000..6cf30812d Binary files /dev/null and b/demos/super_fantasy_zone_mango.fur differ diff --git a/src/audio/rtmidi.cpp b/src/audio/rtmidi.cpp new file mode 100644 index 000000000..e8f0c60d6 --- /dev/null +++ b/src/audio/rtmidi.cpp @@ -0,0 +1 @@ +#include "rtmidi.h" diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 647d9444a..617feacf3 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -2732,7 +2732,7 @@ void FurnaceGUI::doPaste() { invalidData=true; break; } - if (iFine<(3+e->song.pat[cursor.xCoarse].effectRows*2)) pat->data[j][iFine+1]=val; + if (iFine<(3+e->song.pat[iCoarse].effectRows*2)) pat->data[j][iFine+1]=val; } } iFine++;