From c998feb631ae9b51d5cf92ce43f685fa63811ef7 Mon Sep 17 00:00:00 2001
From: Flamefire
Date: Sat, 15 Dec 2018 13:12:35 +0100
Subject: Remove explicit link to stdc++
---
examples/sdl2_audio/CMakeLists.txt | 2 +-
utils/adlmidi-2/CMakeLists.txt | 2 +-
utils/gen_adldata/CMakeLists.txt | 2 +-
utils/midiplay/CMakeLists.txt | 2 +-
utils/vlc_codec/CMakeLists.txt | 2 --
5 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/examples/sdl2_audio/CMakeLists.txt b/examples/sdl2_audio/CMakeLists.txt
index 47924d0..4e0a76b 100644
--- a/examples/sdl2_audio/CMakeLists.txt
+++ b/examples/sdl2_audio/CMakeLists.txt
@@ -9,7 +9,7 @@ if(NOT MSVC)
target_link_libraries(adlmidi_sdl2_demo PRIVATE pthread)
endif()
if(NOT WIN32)
- target_link_libraries(adlmidi_sdl2_demo PRIVATE dl m stdc++)
+ target_link_libraries(adlmidi_sdl2_demo PRIVATE dl m)
endif()
if(TARGET ADLMIDI_shared)
diff --git a/utils/adlmidi-2/CMakeLists.txt b/utils/adlmidi-2/CMakeLists.txt
index ee081c6..3965c42 100644
--- a/utils/adlmidi-2/CMakeLists.txt
+++ b/utils/adlmidi-2/CMakeLists.txt
@@ -50,7 +50,7 @@ elseif(NOT ADLMIDI_DOS)
if(NOT OPENBSD_LOCALBASE)
target_link_libraries(adlmidi2 PRIVATE dl)
endif()
- target_link_libraries(adlmidi2 PRIVATE pthread m stdc++)
+ target_link_libraries(adlmidi2 PRIVATE pthread m)
endif()
if(NOT WITH_CPP_EXTRAS)
diff --git a/utils/gen_adldata/CMakeLists.txt b/utils/gen_adldata/CMakeLists.txt
index 40aa4b5..56662e7 100644
--- a/utils/gen_adldata/CMakeLists.txt
+++ b/utils/gen_adldata/CMakeLists.txt
@@ -48,7 +48,7 @@ if(MSVC)
message("Turned on C++11 on MSVC")
target_compile_options(gen_adldata PUBLIC "/std:c++latest")
else()
- target_link_libraries(gen_adldata PRIVATE pthread m stdc++)
+ target_link_libraries(gen_adldata PRIVATE pthread m)
endif()
if(WITH_GENADLDATA_COMMENTS)
diff --git a/utils/midiplay/CMakeLists.txt b/utils/midiplay/CMakeLists.txt
index 4f0c411..3531090 100644
--- a/utils/midiplay/CMakeLists.txt
+++ b/utils/midiplay/CMakeLists.txt
@@ -30,7 +30,7 @@ elseif(NOT ADLMIDI_DOS)
if(NOT OPENBSD_LOCALBASE)
target_link_libraries(adlmidiplay PRIVATE dl)
endif()
- target_link_libraries(adlmidiplay PRIVATE pthread m stdc++)
+ target_link_libraries(adlmidiplay PRIVATE pthread m)
endif()
if(ADLMIDI_DOS)
diff --git a/utils/vlc_codec/CMakeLists.txt b/utils/vlc_codec/CMakeLists.txt
index 1f37890..59f89fd 100644
--- a/utils/vlc_codec/CMakeLists.txt
+++ b/utils/vlc_codec/CMakeLists.txt
@@ -24,8 +24,6 @@ target_link_libraries(adlmidi_vlc_plugin PRIVATE ADLMIDI_static ${LIBVLCCORE_LIB
if(WIN32 AND CMAKE_COMPILER_IS_GNUCXX)
set_property(TARGET adlmidi_vlc_plugin APPEND_STRING PROPERTY LINK_FLAGS " -static-libgcc -static-libstdc++")
set_property(TARGET adlmidi_vlc_plugin APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-Bstatic,--whole-archive -lpthread -Wl,-Bdynamic,--no-whole-archive")
-elseif(NOT WIN32)
- target_link_libraries(adlmidi_vlc_plugin PRIVATE stdc++)
endif()
# target_link_libraries(adlmidi_vlc_plugin INTERFACE "-export-symbol-regex ^vlc_entry")
--
cgit v1.2.3
From da6d1501629b36fa6aaefce45116b75b734a1a69 Mon Sep 17 00:00:00 2001
From: Flamefire
Date: Sat, 15 Dec 2018 13:14:30 +0100
Subject: Remove explicit -DNDEBUG
CMake does this better
---
CMakeLists.txt | 5 -----
1 file changed, 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2acb392..f990b44 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,11 +45,6 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
-string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
-if(CMAKE_BUILD_TYPE_LOWER EQUAL "release")
- add_definitions(-DNDEBUG)
-endif()
-
# Disable bogus MSVC warnings
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
--
cgit v1.2.3
From a53f2c21566b213f782fe2e47accdf457f80650a Mon Sep 17 00:00:00 2001
From: Flamefire
Date: Sat, 15 Dec 2018 13:21:41 +0100
Subject: Set toplevel CMAKE_MODULE_PATH
---
CMakeLists.txt | 1 +
utils/vlc_codec/CMakeLists.txt | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f990b44..d9a8244 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,7 @@ set(CMAKE_CXX_STANDARD 98)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
if(DJGPP OR MSDOS)
set(ADLMIDI_DOS 1)
diff --git a/utils/vlc_codec/CMakeLists.txt b/utils/vlc_codec/CMakeLists.txt
index 59f89fd..b1f4c02 100644
--- a/utils/vlc_codec/CMakeLists.txt
+++ b/utils/vlc_codec/CMakeLists.txt
@@ -1,6 +1,5 @@
set(CMAKE_C_STANDARD 99)
-list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../cmake")
find_package(LIBVLC REQUIRED)
message("Found ${LIBVLCCORE_LIBRARY} of version ${LIBVLC_VERSION} with includes ${LIBVLC_INCLUDE_DIR}")
--
cgit v1.2.3
From 16b933429a0b101460bdcd32b2b14935e1169c6d Mon Sep 17 00:00:00 2001
From: Flamefire
Date: Sat, 15 Dec 2018 14:11:32 +0100
Subject: Improve FindLIBVLC
---
cmake/FindLIBVLC.cmake | 157 +++++++++++++++++++----------------------
utils/vlc_codec/CMakeLists.txt | 24 ++-----
utils/vlc_codec/libadlmidi.c | 2 +-
3 files changed, 79 insertions(+), 104 deletions(-)
diff --git a/cmake/FindLIBVLC.cmake b/cmake/FindLIBVLC.cmake
index f023c80..e396a9f 100644
--- a/cmake/FindLIBVLC.cmake
+++ b/cmake/FindLIBVLC.cmake
@@ -2,40 +2,22 @@
# CMake module to search for LIBVLC (VLC library)
# Authors: Rohit Yadav
# Harald Sitter
+# Alexander Grund
#
-# If it's found it sets LIBVLC_FOUND to TRUE
-# and following variables are set:
-# LIBVLC_INCLUDE_DIR
-# LIBVLC_LIBRARY
-# LIBVLC_VERSION
-
-if(NOT LIBVLC_MIN_VERSION)
- set(LIBVLC_MIN_VERSION "0.0")
-endif(NOT LIBVLC_MIN_VERSION)
-
-# find_path and find_library normally search standard locations
-# before the specified paths. To search non-standard paths first,
-# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
-# and then again with no specified paths to search the default
-# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
-# searching for the same item do nothing.
+# If it's found it defines the following targets:
+# - libvlc::libvlc
+# - libvlc::plugin
if(NOT WIN32)
- find_package(PkgConfig)
- pkg_check_modules(PC_LIBVLC libvlc)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(PC_LIBVLC libvlc QUIET)
set(LIBVLC_DEFINITIONS ${PC_LIBVLC_CFLAGS_OTHER})
- set(LIBVLC_INCLUDE_DIRS ${PC_LIBVLC_INCLUDEDIR} ${PC_LIBVLC_INCLUDE_DIRS})
- pkg_check_modules(PC_VLCPLUGIN vlc-plugin)
+ pkg_check_modules(PC_VLCPLUGIN vlc-plugin QUIET)
set(VLCPLUGIN_DEFINITIONS ${PC_VLCPLUGIN_CFLAGS_OTHER})
- set(VLCPLUGIN_INCLUDE_DIRS ${PC_VLCPLUGIN_INCLUDEDIR} ${PC_VLCPLUGIN_INCLUDE_DIRS})
pkg_get_variable(PC_VLCPLUGIN_PLUGINS_PATH vlc-plugin pluginsdir)
set(VLCPLUGIN_CODEC_INSTALL_PATH ${PC_VLCPLUGIN_PLUGINS_PATH}/codec)
-
- message("-- VLC Lib include path is \"${LIBVLC_INCLUDE_DIRS}\" ==")
- message("-- VLC Plugins include path is \"${VLCPLUGIN_INCLUDE_DIRS}\" ==")
- message("-- VLC Plugins path is \"${VLCPLUGIN_CODEC_INSTALL_PATH}\" ==")
else()
set(LIBVLC_DEFINITIONS)
# FIXME: Is "_FILE_OFFSET_BITS=64" correct for Windows?
@@ -49,70 +31,73 @@ else()
set(VLCPLUGIN_CODEC_INSTALL_PATH "C:/Program Files/VideoLAN/VLC/plugins/codec")
endif()
-#Put here path to custom location
-#example: /home/user/vlc/include etc..
-find_path(LIBVLC_INCLUDE_DIR vlc/vlc.h
-HINTS "$ENV{LIBVLC_INCLUDE_PATH}"
-PATHS
- "$ENV{LIB_DIR}/include"
- "$ENV{LIB_DIR}/include/vlc"
- "/usr/include"
- "/usr/include/vlc"
- "/usr/local/include"
- "/usr/local/include/vlc"
- #mingw
- ${CMAKE_PREFIX_PATH}/include
- c:/msys/local/include
-)
-find_path(LIBVLC_INCLUDE_DIR PATHS "${CMAKE_INCLUDE_PATH}/vlc" NAMES vlc.h
- HINTS ${PC_LIBVLC_INCLUDEDIR} ${PC_LIBVLC_INCLUDE_DIRS})
+foreach(lib libvlc vlcplugin)
+ string(TOUPPER ${lib} upperLib)
+ if(lib STREQUAL "vlcplugin")
+ set(headerFile vlc_common.h)
+ set(suffixes vlc/plugins include/vlc/plugins)
+ else()
+ set(headerFile vlc/libvlc.h)
+ set(suffixes )
+ endif()
+ find_path(${upperLib}_INCLUDE_DIR ${headerFile}
+ HINTS ${PC_${upperLib}_INCLUDEDIR} ${PC_${upperLib}_INCLUDE_DIRS} $ENV{LIBVLC_INCLUDE_PATH}
+ PATH_SUFFIXES include ${suffixes}
+ NO_DEFAULT_PATH
+ )
+ find_path(${upperLib}_INCLUDE_DIR ${headerFile}
+ PATHS $ENV{LIB_DIR}
+ C:/msys/local #mingw
+ PATH_SUFFIXES include ${suffixes}
+ )
+endforeach()
-#Put here path to custom location
-#example: /home/user/vlc/lib etc..
-find_library(LIBVLC_LIBRARY NAMES vlc libvlc
-HINTS "$ENV{LIBVLC_LIBRARY_PATH}" ${PC_LIBVLC_LIBDIR} ${PC_LIBVLC_LIBRARY_DIRS}
-PATHS
- "$ENV{LIB_DIR}/lib"
- #mingw
- ${CMAKE_PREFIX_PATH}/lib
- c:/msys/local/lib
-)
-find_library(LIBVLC_LIBRARY NAMES vlc libvlc)
-find_library(LIBVLCCORE_LIBRARY NAMES vlccore libvlccore
-HINTS "$ENV{LIBVLC_LIBRARY_PATH}" ${PC_LIBVLC_LIBDIR} ${PC_LIBVLC_LIBRARY_DIRS}
-PATHS
- "$ENV{LIB_DIR}/lib"
- #mingw
- ${CMAKE_PREFIX_PATH}/lib
- c:/msys/local/lib
-)
-find_library(LIBVLCCORE_LIBRARY NAMES vlccore libvlccore)
+foreach(lib vlc vlccore)
+ string(TOUPPER ${lib} upperLib)
+ find_library(LIB${upperLib}_LIBRARY ${lib} lib${lib}
+ HINTS ${PC_LIBVLC_LIBDIR} ${PC_LIBVLC_LIBRARY_DIRS} $ENV{LIBVLC_LIBRARY_PATH}
+ PATH_SUFFIXES lib
+ NO_DEFAULT_PATH
+ )
+ find_library(LIB${upperLib}_LIBRARY ${lib} lib${lib}
+ PATHS $ENV{LIB_DIR}
+ C:/msys/local #mingw
+ PATH_SUFFIXES lib
+ )
+endforeach()
-set(LIBVLC_VERSION ${PC_LIBVLC_VERSION})
-if (NOT LIBVLC_VERSION)
-# TODO: implement means to detect version on windows (vlc --version && regex? ... ultimately we would get it from a header though...)
-endif (NOT LIBVLC_VERSION)
+if(LIBVLC_INCLUDE_DIR)
+ set(vlcVersionFile ${LIBVLC_INCLUDE_DIR}/vlc/libvlc_version.h)
+ if(EXISTS ${vlcVersionFile})
+ file(STRINGS ${vlcVersionFile} versionStrings REGEX "#[ \t]*define[ \t]+LIBVLC_VERSION_(MAJOR|MINOR|REVISION|EXTRA)[ \t]+\\(?[0-9]+\\)?")
+ if(NOT versionStrings)
+ message(FATAL_ERROR "Could not read version from ${vlcVersionFile}")
+ endif()
+ foreach(item MAJOR MINOR REVISION EXTRA)
+ string(REGEX REPLACE "#[ \t]*define[ \t]+LIBVLC_VERSION_${item}[ \t]+\\(?([0-9]+)\\)?" "\\1" LIBVLC_VERSION_${item} ${versionStrings})
+ endforeach()
+ set(LIBVLC_VERSION ${LIBVLC_VERSION_MAJOR}.${LIBVLC_VERSION_MINOR}.${LIBVLC_VERSION_REVISION}.${LIBVLC_VERSION_EXTRA})
+ endif()
+endif()
-if (LIBVLC_INCLUDE_DIR AND LIBVLC_LIBRARY AND LIBVLCCORE_LIBRARY)
-set(LIBVLC_FOUND TRUE)
-endif (LIBVLC_INCLUDE_DIR AND LIBVLC_LIBRARY AND LIBVLCCORE_LIBRARY)
+include(FindPackageHandleStandardArgs)
-if (LIBVLC_VERSION STRLESS "${LIBVLC_MIN_VERSION}")
- message(WARNING "LibVLC version not found: version searched: ${LIBVLC_MIN_VERSION}, found ${LIBVLC_VERSION}\nUnless you are on Windows this is bound to fail.")
-# TODO: only activate once version detection can be garunteed (which is currently not the case on windows)
-# set(LIBVLC_FOUND FALSE)
-endif (LIBVLC_VERSION STRLESS "${LIBVLC_MIN_VERSION}")
+find_package_handle_standard_args(LIBVLC
+ REQUIRED_VARS LIBVLC_INCLUDE_DIR VLCPLUGIN_INCLUDE_DIR LIBVLC_LIBRARY LIBVLCCORE_LIBRARY
+ VERSION_VAR LIBVLC_VERSION
+)
-if (LIBVLC_FOUND)
- if (NOT LIBVLC_FIND_QUIETLY)
- message(STATUS "Found LibVLC include-dir path: ${LIBVLC_INCLUDE_DIR}")
- message(STATUS "Found LibVLC library path:${LIBVLC_LIBRARY}")
- message(STATUS "Found LibVLCcore library path:${LIBVLCCORE_LIBRARY}")
- message(STATUS "Found LibVLC version: ${LIBVLC_VERSION} (searched for: ${LIBVLC_MIN_VERSION})")
- endif (NOT LIBVLC_FIND_QUIETLY)
-else (LIBVLC_FOUND)
- if (LIBVLC_FIND_REQUIRED)
- message(FATAL_ERROR "Could not find LibVLC")
- endif (LIBVLC_FIND_REQUIRED)
-endif (LIBVLC_FOUND)
+if(LIBVLC_FOUND)
+ add_library(libvlc_libvlc INTERFACE)
+ target_compile_definitions(libvlc_libvlc INTERFACE ${LIBVLC_DEFINITIONS})
+ target_include_directories(libvlc_libvlc INTERFACE ${LIBVLC_INCLUDE_DIR})
+ target_link_libraries(libvlc_libvlc INTERFACE ${LIBVLC_LIBRARY})
+
+ add_library(libvlc_plugin INTERFACE)
+ target_include_directories(libvlc_plugin INTERFACE ${LIBVLC_INCLUDE_DIR} ${VLCPLUGIN_INCLUDE_DIR})
+ target_compile_definitions(libvlc_plugin INTERFACE ${VLCPLUGIN_DEFINITIONS})
+ target_link_libraries(libvlc_plugin INTERFACE ${LIBVLCCORE_LIBRARY})
+ add_library(libvlc::libvlc ALIAS libvlc_libvlc)
+ add_library(libvlc::plugin ALIAS libvlc_plugin)
+endif()
diff --git a/utils/vlc_codec/CMakeLists.txt b/utils/vlc_codec/CMakeLists.txt
index b1f4c02..22e390f 100644
--- a/utils/vlc_codec/CMakeLists.txt
+++ b/utils/vlc_codec/CMakeLists.txt
@@ -1,32 +1,22 @@
set(CMAKE_C_STANDARD 99)
find_package(LIBVLC REQUIRED)
-message("Found ${LIBVLCCORE_LIBRARY} of version ${LIBVLC_VERSION} with includes ${LIBVLC_INCLUDE_DIR}")
-set(adlmidi_vlc_src)
-list(APPEND adlmidi_vlc_src libadlmidi.c)
-
-add_library(adlmidi_vlc_plugin MODULE ${adlmidi_vlc_src})
+add_library(adlmidi_vlc_plugin MODULE libadlmidi.c)
set_target_properties(adlmidi_vlc_plugin PROPERTIES OUTPUT_NAME adlmidi_plugin)
-target_compile_options(adlmidi_vlc_plugin PUBLIC
- "-DVLC_MODULE_COPYRIGHT=\"Copyright \(c\) Vitaly Novichkov\""
- "-DVLC_MODULE_LICENSE=\"GPLv3\""
- "-DMODULE_STRING=\"adlmidi\""
- ${VLCPLUGIN_DEFINITIONS})
-
-target_include_directories(adlmidi_vlc_plugin PRIVATE
- ${LIBVLC_INCLUDE_DIR}/vlc/plugins
- ${LIBVLC_INCLUDE_DIR}/vlc)
+target_compile_definitions(adlmidi_vlc_plugin PUBLIC
+ "VLC_MODULE_COPYRIGHT=\"Copyright (c) Vitaly Novichkov\""
+ "VLC_MODULE_LICENSE=\"GPLv3\""
+ "MODULE_STRING=\"adlmidi\""
+)
-target_link_libraries(adlmidi_vlc_plugin PRIVATE ADLMIDI_static ${LIBVLCCORE_LIBRARY} m)
+target_link_libraries(adlmidi_vlc_plugin PRIVATE ADLMIDI_static libvlc::plugin m)
if(WIN32 AND CMAKE_COMPILER_IS_GNUCXX)
set_property(TARGET adlmidi_vlc_plugin APPEND_STRING PROPERTY LINK_FLAGS " -static-libgcc -static-libstdc++")
set_property(TARGET adlmidi_vlc_plugin APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-Bstatic,--whole-archive -lpthread -Wl,-Bdynamic,--no-whole-archive")
endif()
-# target_link_libraries(adlmidi_vlc_plugin INTERFACE "-export-symbol-regex ^vlc_entry")
-
if(NOT VLC_PLUGIN_NOINSTALL)
install(TARGETS adlmidi_vlc_plugin DESTINATION "${VLCPLUGIN_CODEC_INSTALL_PATH}")
else()
diff --git a/utils/vlc_codec/libadlmidi.c b/utils/vlc_codec/libadlmidi.c
index 0440fe5..d3353eb 100644
--- a/utils/vlc_codec/libadlmidi.c
+++ b/utils/vlc_codec/libadlmidi.c
@@ -22,7 +22,7 @@
#include
#include
#include
-#include
+#include
#include
--
cgit v1.2.3
From 040f57ad6ecc488c58aca559dc675cdd6be50f18 Mon Sep 17 00:00:00 2001
From: Flamefire
Date: Sat, 15 Dec 2018 17:58:41 +0100
Subject: Remove makefiles
---
utils/midiplay/Makefile | 12 ------------
utils/midiplay/Makefile.win32 | 12 ------------
utils/vlc_codec/Makefile.am | 13 -------------
utils/vlc_codec/autogen.sh | 15 ---------------
utils/vlc_codec/configure.ac | 32 --------------------------------
5 files changed, 84 deletions(-)
delete mode 100644 utils/midiplay/Makefile
delete mode 100644 utils/midiplay/Makefile.win32
delete mode 100644 utils/vlc_codec/Makefile.am
delete mode 100755 utils/vlc_codec/autogen.sh
delete mode 100644 utils/vlc_codec/configure.ac
diff --git a/utils/midiplay/Makefile b/utils/midiplay/Makefile
deleted file mode 100644
index f2512b4..0000000
--- a/utils/midiplay/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-all: midiplay
-
-midiplay: adlmidiplay.o wave_writer.o
- g++ $^ -Wl,-rpath='$$ORIGIN' -L../../bin -ladlmidi -lSDL2 -o ../../bin/adlmidiplay
- rm *.o
-
-adlmidiplay.o: adlmidiplay.cpp
- g++ -c $^ -I.. -o adlmidiplay.o
-
-wave_writer.o: wave_writer.c
- gcc -c $^ -I.. -o wave_writer.o
-
diff --git a/utils/midiplay/Makefile.win32 b/utils/midiplay/Makefile.win32
deleted file mode 100644
index 05e192f..0000000
--- a/utils/midiplay/Makefile.win32
+++ /dev/null
@@ -1,12 +0,0 @@
-all: midiplay
-
-midiplay: adlmidiplay.o wave_writer.o
- g++ $^ -L../../bin -ladlmidi -lSDL2 -o ../../bin/adlmidiplay
- rm *.o
-
-adlmidiplay.o: adlmidiplay.cpp
- g++ -c $^ -I.. -o adlmidiplay.o
-
-wave_writer.o: wave_writer.c
- gcc -c $^ -I.. -o wave_writer.o
-
diff --git a/utils/vlc_codec/Makefile.am b/utils/vlc_codec/Makefile.am
deleted file mode 100644
index 8992451..0000000
--- a/utils/vlc_codec/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-AUTOMAKE_OPTIONS = subdir-objects
-
-lib_LTLIBRARIES = libadlmidi_plugin.la
-
-CFLAGS = -DVLC_MODULE_COPYRIGHT="\"Copyright \(c\) Vitaly Novichkov\""
-CFLAGS += -DVLC_MODULE_LICENSE=\"GPLv3\"
-
-libadlmidi_plugin_la_SOURCES = libadlmidi.c
-libadlmidi_plugin_la_CFLAGS = -DMODULE_STRING=\"adlmidi\" $(vlc_CFLAGS)
-libadlmidi_plugin_la_CPPFLAGS = -DMODULE_STRING=\"adlmidi\" $(vlc_CFLAGS)
-libadlmidi_plugin_la_LIBADD = $(vlc_LIBS)
-libadlmidi_plugin_la_LDFLAGS = -avoid-version -module -export-symbol-regex ^vlc_entry -lADLMIDI -lm -lstdc++ $(vlc_LDFLAGS)
-
diff --git a/utils/vlc_codec/autogen.sh b/utils/vlc_codec/autogen.sh
deleted file mode 100755
index 57eeb94..0000000
--- a/utils/vlc_codec/autogen.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-if [ -x "`which autoreconf 2>/dev/null`" ] ; then
- exec autoreconf -ivf
-fi
-
-LIBTOOLIZE=libtoolize
-SYSNAME=`uname`
-if [ "x$SYSNAME" = "xDarwin" ] ; then
- LIBTOOLIZE=glibtoolize
-fi
-aclocal -I m4 && \
- autoheader && \
- $LIBTOOLIZE && \
- autoconf && \
- automake --add-missing --force-missing --copy
diff --git a/utils/vlc_codec/configure.ac b/utils/vlc_codec/configure.ac
deleted file mode 100644
index 3afee7a..0000000
--- a/utils/vlc_codec/configure.ac
+++ /dev/null
@@ -1,32 +0,0 @@
-# Process this file with autoconf to produce a configure script.
-AC_PREREQ([2.68])
-AC_INIT([vlc-libadlmidi], [1.0.0], [admin@wohlnet.ru])
-AC_CONFIG_SRCDIR([libadlmidi.c])
-AC_CONFIG_MACRO_DIR([m4])
-AC_USE_SYSTEM_EXTENSIONS
-LT_INIT
-
-# Checks for programs.
-AC_PROG_CXX
-AC_PROG_CC
-AC_PROG_CC_C99
-AC_PROG_INSTALL
-AC_PROG_LN_S
-PKG_PROG_PKG_CONFIG
-
-# Initialize automake stuff
-AM_INIT_AUTOMAKE([foreign])
-
-AC_C_INLINE
-AC_FUNC_MALLOC
-AC_FUNC_REALLOC
-AC_FUNC_STRNLEN
-AC_SEARCH_LIBS([sqrt], [m])
-AC_CHECK_FUNCS([memset sqrt strcasecmp strcspn strdup strndup strstr strtol])
-
-PKG_CHECK_MODULES([vlc], [vlc-plugin >= 2.0])
-PKG_CHECK_MODULES([vlc212], [vlc-plugin >= 2.1])
-
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-
--
cgit v1.2.3
From 5fa2ceaf2968dccaa8c0825c6d3498bd173055ef Mon Sep 17 00:00:00 2001
From: Flamefire
Date: Sat, 15 Dec 2018 17:59:43 +0100
Subject: Remove pro files
---
libADLMIDI-test.pro | 67 ---------------------------------------
libADLMIDI.pro | 58 ---------------------------------
utils/adlmidi-2/adlmidi-2.pro | 62 ------------------------------------
utils/gen_adldata/gen_adldata.pro | 39 -----------------------
4 files changed, 226 deletions(-)
delete mode 100644 libADLMIDI-test.pro
delete mode 100644 libADLMIDI.pro
delete mode 100644 utils/adlmidi-2/adlmidi-2.pro
delete mode 100644 utils/gen_adldata/gen_adldata.pro
diff --git a/libADLMIDI-test.pro b/libADLMIDI-test.pro
deleted file mode 100644
index ec5dd1a..0000000
--- a/libADLMIDI-test.pro
+++ /dev/null
@@ -1,67 +0,0 @@
-TEMPLATE=app
-CONFIG-=qt
-CONFIG+=console
-
-CONFIG -= c++11
-
-TARGET=adlmidiplay
-DESTDIR=$$PWD/bin/
-
-#INCLUDEPATH += $$PWD/AudioCodecs/build/install/include
-#LIBS += -L$$PWD/AudioCodecs/build/install/lib
-INCLUDEPATH += $$PWD/src $$PWD/include
-#LIBS += -Wl,-Bstatic -lSDL2 -Wl,-Bdynamic -lpthread -ldl
-LIBS += -lSDL2 -lpthread -ldl
-
-#DEFINES += DEBUG_TIME_CALCULATION
-#DEFINES += DEBUG_SEEKING_TEST
-#DEFINES += DISABLE_EMBEDDED_BANKS
-#DEFINES += ADLMIDI_USE_DOSBOX_OPL
-#DEFINES += ENABLE_BEGIN_SILENCE_SKIPPING
-DEFINES += ENABLE_END_SILENCE_SKIPPING
-#DEFINES += DEBUG_TRACE_ALL_EVENTS
-#DEFINES += DEBUG_TRACE_ALL_CHANNELS
-
-QMAKE_CFLAGS += -std=c90 -pedantic
-QMAKE_CXXFLAGS += -std=c++98 -pedantic
-
-HEADERS += \
- include/adlmidi.h \
- src/adlbank.h \
- src/adldata.hh \
- src/adlmidi_private.hpp \
- src/chips/dosbox/dbopl.h \
- src/chips/dosbox_opl3.h \
- src/chips/nuked/nukedopl3_174.h \
- src/chips/nuked/nukedopl3.h \
- src/chips/nuked_opl3.h \
- src/chips/nuked_opl3_v174.h \
- src/chips/opl_chip_base.h \
- src/chips/opl_chip_base.tcc \
- src/cvt_mus2mid.hpp \
- src/cvt_xmi2mid.hpp \
- src/midi_sequencer.h \
- src/midi_sequencer.hpp \
- src/midi_sequencer_impl.hpp \
- src/fraction.hpp \
- src/midiplay/wave_writer.h
-
-SOURCES += \
- src/adldata.cpp \
- \
- src/adlmidi.cpp \
- src/adlmidi_load.cpp \
- src/adlmidi_midiplay.cpp \
- src/adlmidi_opl3.cpp \
- src/adlmidi_private.cpp \
- src/adlmidi_sequencer.cpp \
- src/wopl/wopl_file.c \
- src/chips/dosbox/dbopl.cpp \
- src/chips/dosbox_opl3.cpp \
- src/chips/nuked/nukedopl3_174.c \
- src/chips/nuked/nukedopl3.c \
- src/chips/nuked_opl3.cpp \
- src/chips/nuked_opl3_v174.cpp \
- utils/midiplay/adlmidiplay.cpp \
- utils/midiplay/wave_writer.c
-
diff --git a/libADLMIDI.pro b/libADLMIDI.pro
deleted file mode 100644
index 0044b76..0000000
--- a/libADLMIDI.pro
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# Project file for the Qt Creator IDE
-#
-
-TEMPLATE = lib
-CONFIG -= qt
-CONFIG += staticlib
-
-TARGET = ADLMIDI
-INSTALLINCLUDES = $$PWD/include/*
-INSTALLINCLUDESTO = ADLMIDI
-include($$PWD/../audio_codec_common.pri)
-
-DEFINES += ADLMIDI_DISABLE_CPP_EXTRAS
-DEFINES += ENABLE_END_SILENCE_SKIPPING
-
-macx: QMAKE_CXXFLAGS_WARN_ON += -Wno-absolute-value
-
-INCLUDEPATH += $$PWD $$PWD/include
-
-HEADERS += \
- include/adlmidi.h \
- src/adlbank.h \
- src/adldata.hh \
- src/adlmidi_private.hpp \
- src/wopl/wopl_file.h \
- src/chips/dosbox/dbopl.h \
- src/chips/dosbox_opl3.h \
- src/chips/nuked/nukedopl3_174.h \
- src/chips/nuked/nukedopl3.h \
- src/chips/nuked_opl3.h \
- src/chips/nuked_opl3_v174.h \
- src/chips/opl_chip_base.h \
- src/chips/opl_chip_base.tcc \
- src/cvt_mus2mid.hpp \
- src/cvt_xmi2mid.hpp \
- src/midi_sequencer.h \
- src/midi_sequencer.hpp \
- src/midi_sequencer_impl.hpp \
- src/fraction.hpp
-
-SOURCES += \
- src/adldata.cpp \
- \
- src/adlmidi.cpp \
- src/adlmidi_load.cpp \
- src/adlmidi_midiplay.cpp \
- src/adlmidi_opl3.cpp \
- src/adlmidi_private.cpp \
- src/adlmidi_sequencer.cpp \
- src/wopl/wopl_file.c \
- src/chips/dosbox/dbopl.cpp \
- src/chips/dosbox_opl3.cpp \
- src/chips/nuked/nukedopl3_174.c \
- src/chips/nuked/nukedopl3.c \
- src/chips/nuked_opl3.cpp \
- src/chips/nuked_opl3_v174.cpp
-
diff --git a/utils/adlmidi-2/adlmidi-2.pro b/utils/adlmidi-2/adlmidi-2.pro
deleted file mode 100644
index 8808504..0000000
--- a/utils/adlmidi-2/adlmidi-2.pro
+++ /dev/null
@@ -1,62 +0,0 @@
-TEMPLATE=app
-CONFIG-=qt
-CONFIG+=console
-
-CONFIG -= c++11
-
-TARGET = adlmidi2
-DESTDIR=$$PWD/../../bin/
-
-#INCLUDEPATH += $$PWD/AudioCodecs/build/install/include
-#LIBS += -L$$PWD/AudioCodecs/build/install/lib
-INCLUDEPATH += $$PWD/../../src $$PWD/../../include
-#LIBS += -Wl,-Bstatic -lSDL2 -Wl,-Bdynamic -lpthread -ldl
-LIBS += -lSDL2 -lpthread -ldl
-
-linux-*: {
- QMAKE_CXXFLAGS += -fopenmp
- QMAKE_LFLAGS += -fopenmp
-}
-
-#DEFINES += DEBUG_TIME_CALCULATION
-#DEFINES += DEBUG_SEEKING_TEST
-#DEFINES += DISABLE_EMBEDDED_BANKS
-#DEFINES += ADLMIDI_USE_DOSBOX_OPL
-#DEFINES += ENABLE_BEGIN_SILENCE_SKIPPING
-
-QMAKE_CFLAGS += -std=c90 -pedantic
-QMAKE_CXXFLAGS += -std=c++98 -pedantic
-
-HEADERS += \
- $$PWD/../../include/adlmidi.h \
- $$PWD/../../include/adlmidi.hpp \
- $$PWD/../../src/adlbank.h \
- $$PWD/../../src/adldata.hh \
- $$PWD/../../src/adlmidi_mus2mid.h \
- $$PWD/../../src/adlmidi_private.hpp \
- $$PWD/../../src/adlmidi_xmi2mid.h \
- $$PWD/../../src/fraction.h \
- $$PWD/../../src/nukedopl3.h \
- $$PWD/../../src/dbopl.h \
- $$PWD/../../src/midiplay/wave_writer.h \
- 6x9.hpp \
- 8x16.hpp \
- 9x15.hpp \
- puzzlegame.hpp
-
-SOURCES += \
- $$PWD/../../src/adldata.cpp \
- \
- $$PWD/../../src/adlmidi.cpp \
- $$PWD/../../src/adlmidi_load.cpp \
- $$PWD/../../src/adlmidi_midiplay.cpp \
- $$PWD/../../src/adlmidi_mus2mid.c \
- $$PWD/../../src/adlmidi_opl3.cpp \
- $$PWD/../../src/adlmidi_private.cpp \
- $$PWD/../../src/adlmidi_xmi2mid.c \
- $$PWD/../../src/nukedopl3.c \
- $$PWD/../../src/dbopl.cpp \
- \
- midiplay.cc \
- puzzlegame.cc
-
diff --git a/utils/gen_adldata/gen_adldata.pro b/utils/gen_adldata/gen_adldata.pro
deleted file mode 100644
index 7f42c5c..0000000
--- a/utils/gen_adldata/gen_adldata.pro
+++ /dev/null
@@ -1,39 +0,0 @@
-TEMPLATE=app
-CONFIG-=qt
-CONFIG+=console
-TARGET=gen_adldata
-DESTDIR=$$PWD/../../bin
-CONFIG += c++11
-
-include($$PWD/ini/IniProcessor.pri)
-
-#DEFINES += ADLMIDI_USE_DOSBOX_OPL
-
-QMAKE_CXXFLAGS_RELEASE += -O3 -finline-functions
-LIBS += -lpthread
-
-HEADERS += \
- midi_inst_list.h \
- ../nukedopl3.h \
- ../dbopl.h \
- progs_cache.h \
- file_formats/load_bnk.h \
- file_formats/load_bnk2.h \
- file_formats/load_op2.h \
- file_formats/load_ail.h \
- file_formats/load_ibk.h \
- file_formats/load_jv.h \
- file_formats/load_tmb.h \
- file_formats/load_bisqwit.h \
- file_formats/load_wopl.h \
- measurer.h \
- file_formats/common.h \
- file_formats/load_ea.h
-
-SOURCES += \
- gen_adldata.cc \
- ../nukedopl3.c \
- ../dbopl.cpp \
- progs_cache.cpp \
- measurer.cpp
-
--
cgit v1.2.3
From b44ca1bc7b214c0ff4ef12a9cc3c6057af433b5f Mon Sep 17 00:00:00 2001
From: Flamefire
Date: Sat, 15 Dec 2018 18:00:47 +0100
Subject: Remove old files
---
_old_files/Makefile.cygwin | 26 --
_old_files/Makefile.old | 24 --
_old_files/Makefile.w32 | 24 --
_old_files/Readme.txt | 125 ----------
_old_files/depfun.mak | 197 ---------------
_old_files/docmaker.php | 125 ----------
_old_files/make.rules | 170 -------------
_old_files/makediff.php | 497 --------------------------------------
_old_files/midiplay.bas | 590 ---------------------------------------------
_old_files/progdesc.php | 179 --------------
10 files changed, 1957 deletions(-)
delete mode 100644 _old_files/Makefile.cygwin
delete mode 100644 _old_files/Makefile.old
delete mode 100644 _old_files/Makefile.w32
delete mode 100644 _old_files/Readme.txt
delete mode 100644 _old_files/depfun.mak
delete mode 100644 _old_files/docmaker.php
delete mode 100644 _old_files/make.rules
delete mode 100644 _old_files/makediff.php
delete mode 100644 _old_files/midiplay.bas
delete mode 100644 _old_files/progdesc.php
diff --git a/_old_files/Makefile.cygwin b/_old_files/Makefile.cygwin
deleted file mode 100644
index 1424af8..0000000
--- a/_old_files/Makefile.cygwin
+++ /dev/null
@@ -1,26 +0,0 @@
-CC=i686-pc-mingw32-gcc -static
-CXX=i686-pc-mingw32-g++ -static
-CXXLINK=$(CXX)
-
-#DEBUG=-O0 -fno-inline -D_GLIBCXX_DEBUG -g -fstack-protector-all -fdata-sections
-
-DEBUG=-O3 -g -fexpensive-optimizations -ffast-math
-
-#DEBUG += -fno-tree-vectorize
-
-# -march=pentium -mno-sse -mno-sse2 -mno-sse3 -mmmx
-
-CPPFLAGS += $(SDL)
-
-CPPFLAGS += -ansi -Wall -W
-
-CC += -mwin32 -mconsole -mno-cygwin
-CXX += -mwin32 -mconsole -mno-cygwin
-CPPFLAGS += -I/usr/include/mingw -mno-cygwin -I/usr/include/w32api
-LDLIBS += -L/usr/local/lib -L/usr/lib/w32api -lwinmm
-
-# ^For cygwin. For anything else, remove this line.
-
-
-include make.rules
-
diff --git a/_old_files/Makefile.old b/_old_files/Makefile.old
deleted file mode 100644
index f1a2ead..0000000
--- a/_old_files/Makefile.old
+++ /dev/null
@@ -1,24 +0,0 @@
-#CXX=i686-w64-mingw32-g++ -static
-CC=gcc
-CXX=g++
-CXXLINK=$(CXX)
-MKDIR=mkdir -p
-RM=rm
-RM_F=rm -Rf
-
-#DEBUG=-O0 -fno-inline -D_GLIBCXX_DEBUG -g -fstack-protector-all -fdata-sections
-
-DEBUG=-Ofast -g
-
-#DEBUG += -fno-tree-vectorize
-
-# -march=pentium -mno-sse -mno-sse2 -mno-sse3 -mmmx
-
-CFLAGS += -DLIBADLMIDI_VISIBILITY
-
-CPPFLAGS += -DLIBADLMIDI_VISIBILITY
-
-CPPFLAGS += -std=c++11 -pedantic -Wall -Wextra
-
-include make.rules
-
diff --git a/_old_files/Makefile.w32 b/_old_files/Makefile.w32
deleted file mode 100644
index c9c303f..0000000
--- a/_old_files/Makefile.w32
+++ /dev/null
@@ -1,24 +0,0 @@
-CXX=i686-w64-mingw32-g++ -static
-#CXX=g++
-CXXLINK=$(CXX)
-MD=md
-RM=del
-RM_F=del /Q /F /S
-
-#DEBUG=-O0 -fno-inline -D_GLIBCXX_DEBUG -g -fstack-protector-all -fdata-sections
-
-DEBUG=-Ofast -g
-
-#DEBUG += -fno-tree-vectorize
-
-# -march=pentium -mno-sse -mno-sse2 -mno-sse3 -mmmx
-
-CC += -mwin32 -mconsole
-CXX += -mwin32 -mconsole
-CPPFLAGS += -DLIBADLMIDI_VISIBILITY -I/usr/include/mingw -I/usr/include/w32api
-LDLIBS += -L/usr/local/lib -L/usr/lib/w32api -lwinmm
-
-CPPFLAGS += -std=c++11 -pedantic -Wall -Wextra
-
-include make.rules
-
diff --git a/_old_files/Readme.txt b/_old_files/Readme.txt
deleted file mode 100644
index 3cbe239..0000000
--- a/_old_files/Readme.txt
+++ /dev/null
@@ -1,125 +0,0 @@
-==================================================================================
- libADLMIDI is a free MIDI to WAV conversion library with OPL3 emulation
-==================================================================================
-
-Original ADLMIDI code: Copyright (c) 2010-2014 Joel Yliluoma
-ADLMIDI Library API: Copyright (c) 2015-2017 Vitaly Novichkov
-
-Library is based on the ADLMIDI, a MIDI player for Linux and Windows with OPL3 emulation:
-=========================================
-http://iki.fi/bisqwit/source/adlmidi.html
-=========================================
-
-=========================================
- Differences with original tool
-=========================================
-* Reverb code has been removed.
-* Doesn't contains platform specific code.
- Library can be used with various purposes include making of a custom music decoders
- for a media players and usage with a games
-
-=========================================
- Key features
-=========================================
-
-* OPL3 emulation with four-operator mode support
-* FM patches from a number of known PC games, copied from files typical to AIL = Miles Sound System / DMX / HMI = Human Machine Interfaces / Creative IBK.
-* Stereo sound
-* Number of simulated soundcards can be specified as 1-100 (maximum channels 1800!)
-* Pan (binary panning, i.e. left/right side on/off)
-* Pitch-bender with adjustable range
-* Vibrato that responds to RPN/NRPN parameters
-* Sustain enable/disable
-* MIDI and RMI file support
-* loopStart / loopEnd tag support (Final Fantasy VII)
-* Use automatic arpeggio with chords to relieve channel pressure
-* Support for multiple concurrent MIDI synthesizers (per-track device/port select FF 09 message), can be used to overcome 16 channel limit
-
-
-=========================================
- How to build
-=========================================
-You can build shared version and additional tools on the Linux when you will run a "make" command and you will have libadlmidi.so and additional tools in the "bin" directory.
-
-You also can build library manually:
-You need to make in the any IDE a library project and put into it next files
-(or include those files into subfolder of your exist project instead if you want to use it statically):
-
-* adlmidi.h - Library API, use it to control library
-
-* dbopl.h - DOSBOX OPL Emulation header
-* nukedopl3.h - Nuked OPL3 Emulation header
-* fraction.h - Fraction number handling
-* adldata.hh - bank structures definition
-* adlmidi_private.hpp - header of internal private APIs
-* adlmidi_mus2mid.h - MUS2MID converter header
-* adlmidi_xmi2mid.h - XMI2MID converter header
-
-* dbopl.cpp - DOSBOX OPL Emulation code (used when ADLMIDI_USE_DOSBOX_OPL macro is defined)
-* nukedopl3.c - Nuked OPL3 Emulation code (used by default)
-* adlmidi.cpp - code of library
-* adldata.cpp - Automatically generated dump of FM banks from "fm_banks" directory via "gen_adldata" tool
-* adlmidi_load.cpp - Source of file loading and parsing processing
-* adlmidi_midiplay.cpp - MIDI event sequencer
-* adlmidi_opl3.cpp - OPL3 chips manager
-* adlmidi_private.cpp - some internal functions sources
-* adlmidi_mus2mid.c - MUS2MID converter source
-* adlmidi_xmi2mid.c - XMI2MID converter source
-
-**Important**: Please use DosBox emulator on mobile devices because it requires small CPU power.
- Nuked OPL synthesizer is very accurate (compared to real OPL3 chip), but it requires much more power
- device and is high probability your device will lag and playback will be choppy.
-
-=========================================
- Example
-=========================================
-In the src/midiplay you will found alone CPP file which an example of library usage.
-That example is a simple audio player based on SDL Audio usage.
-
-To build that example you will need to have installed SDL2 library.
-
-=========================================
- Todo
-=========================================
-* Time based Seek/Tell support
-* Support of title and other meta-tags retrieving
-* Support of real-time listening of incoming MIDI-commands.
- That will allow to use library as software MIDI Output device
- to play any MIDI via this library.
-
-=========================================
-Changelog
-=========================================
-## 1.2.1 2017-07-30
- * Minor fixes
- * Added 72'th bank by Sneakernets
- * Updated "gen_adldata" utility to use ini file
-
-## 1.2.0 2017-02-15
- * Fixed 12'th bank where are drums and melodic sets are was swapped
- * Fxied logariphmic volumes flag which autoreseted to false on playing begin moment
- * Added TRUE support for MUS and XMI formats (added the conversion functions to make right MIDI data to play it)
-
-## 1.1.1 2016-12-09
- * Added a changable volume ranges models (Automatic for some banks, Generic, CMF, DMX, Apogee and 9X)
-
-## 1.1.0 2016-12-06
- * Added Nuked OPL3 emulator which is more accurate (but requires more CPU power, therefore kept ability to use DosBox OPL3 via macro)
- * Fixed warnings of CLang code model plugin
- * Fixed bend coefficient which makes hi-hats in DOOM banks be incorrectly
-
-## 1.0.3 2016-08-06
- * Added handling of 111'th controller as "loopStart" (which used by RPG-Maker)
- * Fixed infinite loop caused by blank MIDI-files (add extra second of waiting if over 10000 0-waiting loops are been detected)
- * Fixed damaged playing of IMF files (cased by wrong implementation of getc() function where return type must be int, not unsigned char)
-
-## 1.0.2 2016-03-16
- * Fixed infinite loop causes swapped loopEnd and loopStart (when loopEnd goes before loopStart)
- * Fixed sielent volume tracks (when initial voule is zero, tracks wouldn't be playd even after applying fading in volume events)
- * More accurate fine tuning for second voice for DMX-based banks (playback now is more like original DOOM than before!)
- * Library's Output data now in short format (no more need to do extra conversions to make 16-bit audio stream from every 16-bit
- sample stored into each 32-bit integer)
-
-## 1.0.0 2015-10-10
- * First release of library
-
diff --git a/_old_files/depfun.mak b/_old_files/depfun.mak
deleted file mode 100644
index 64618c7..0000000
--- a/_old_files/depfun.mak
+++ /dev/null
@@ -1,197 +0,0 @@
-# This is Bisqwit's generic depfun.mak, included from Makefile.
-# The same file is used in many different projects.
-#
-# depfun.mak version 1.6.2
-#
-# Required vars:
-#
-# ${CPP} - C preprocessor name, usually "gcc"
-# ${CPPFLAGS} - preprocessor flags (including defs)
-#
-# ${ARCHFILES} - All file names to include in archive
-# .depend, depfun.mak and Makefile are
-# automatically included.
-# ${ARCHNAME} - Name of program. Example: testprog-0.0.1
-#
-# Optional vars:
-#
-# ${ARCHDIR} - Directory for the archives.
-# Must end with '/'.
-# ${INSTALLPROGS} - Programs to be installed (space delimited)
-# ${BINDIR} - Directory for installed programs (without /)
-# Example: /usr/local/bin
-# ${INSTALL} - Installer program, example: install
-# ${DEPDIRS} - Optional dependency dirs to account in .depend
-#
-# ${EXTRA_ARCHFILES} - More files to include in archive,
-# but without dependency checking
-
-
-# Note: This requires perl. FIXME change it to sed
-.depend: ${ARCHFILES}
- @echo "Checking dependencies..."
- @rm -f $@.tmp
- @for dir in "" ${DEPDIRS}; \
- do n="`pwd`";\
- if [ ! -z "$$dir" ]; then cd "$$dir"; fi; \
- for s in *.c *.cc *.cpp; \
- do if echo "$$s"|grep -vq '^\*';\
- then \
- cd "$$n";\
- ${CPP} ${CPPFLAGS} -MM -MG "$$dir""$$s" |\
- perl -pe "s|^([^ ])|$$dir\\1|" \
- > $@."$$s";\
- fi&done; \
- cd "$$n"; \
- done; wait
- @touch $@.dummy
- @cat $@.* >$@
- @cp -f $@ $@.tmp
- @sed 's/\.o:/.lo:/' <$@.tmp >>$@
- @rm -f $@.*
-
-depend dep: .depend
-
-
--include .depend
-
-git_release: ${ARCHFILES} ;
- # Create the release commit
- git commit --allow-empty -a -m 'Release version ${VERSION} (dev)' # commit in dev brach
- git rev-parse HEAD > .git/PUSHED_HEAD
- git checkout -f release || git checkout -b release
- #
- # Set the cache & index to exact copy of the original branch
- #
- git rm -fr --cached '*' &> /dev/null
- git checkout PUSHED_HEAD .
- #
- # Limit the index to those files we publish
- #
- git rm -fr --cached '*' &> /dev/null
- git add -f --ignore-errors ${ARCHFILES} ${EXTRA_ARCHFILES} depfun.mak Makefile
- @if [ -f docmaker.php ]; then php -q docmaker.php ${ARCHNAME} > README.html; git add docmaker.php README.html; fi
- @if [ -f makediff.php ]; then git add makediff.php; fi
- #
- # Create a merge commit
- #
- cp .git/PUSHED_HEAD .git/MERGE_HEAD
- git commit -m 'Release version ${VERSION}' # commit in release
- #
- # Create the archive
- #
- @- mkdir ${ARCHDIR} 2>/dev/null
- git archive --format=tar --prefix=${ARCHNAME}/ HEAD > ${ARCHDIR}${ARCHNAME}.tar
- # Return to the original branch
- git checkout -f $$(cd .git/refs/heads;grep -l `cat ../../PUSHED_HEAD` * || echo PUSHED_HEAD)
- git update-server-info
- @make arch_finish_pak
- @make omabin_link${DEPFUN_OMABIN}
-
-git_test_release: ${ARCHFILES}
- # Create the testing commit
- git commit --allow-empty -a -m 'Test release ${VERSION} (dev)' # commit in dev branch
- git rev-parse HEAD > .git/PUSHED_HEAD
- git checkout release || git checkout -b release
- #
- # Backup the HEAD in release branch
- #
- git rev-parse release > .git/RELEASE_HEAD
- #
- # Set the cache & index to exact copy of the original branch
- #
- git rm -fr --cached '*' &> /dev/null
- git checkout PUSHED_HEAD .
- #
- # Limit the index to those files we publish
- #
- git rm -fr --cached '*' &> /dev/null
- git add -f --ignore-errors ${ARCHFILES} ${EXTRA_ARCHFILES} depfun.mak Makefile
- @if [ -f docmaker.php ]; then php -q docmaker.php ${ARCHNAME} > README.html; git add docmaker.php README.html; fi
- @if [ -f makediff.php ]; then git add makediff.php; fi
- #
- # Create a merge commit
- #
- cp .git/PUSHED_HEAD .git/MERGE_HEAD
- git commit -m 'Test release' # commit in release
- #
- # Create the testing directory
- #
- rm -rf test_release
- git archive --format=tar --prefix=test_release/ HEAD | tar xvf - | sed 's/^/ /'
- #
- # Reset the release branch to its previous state
- #
- git reset --hard RELEASE_HEAD
- # Return to the original branch
- git checkout -f $$(cd .git/refs/heads;grep -l `cat ../../PUSHED_HEAD` * || echo PUSHED_HEAD)
- git update-server-info
- git gc --quiet
- @echo
- @echo ----------------------------------------------------------------------
- @echo 'Would-be release extracted to test_release/ -- go ahead and try it.'
- @echo ----------------------------------------------------------------------
- @echo
-
-UNUSED_archpak: ${ARCHFILES} ;
- @if [ "${ARCHNAME}" = "" ]; then echo ARCHNAME not set\!;false;fi
- - mkdir ${ARCHNAME} ${ARCHDIR} 2>/dev/null
- cp --parents -lfr ${ARCHFILES} ${EXTRA_ARCHFILES} depfun.mak Makefile ${ARCHNAME}/ 2>&1 >/dev/null | while read line;do cp --parents -fr "`echo "$$line"|sed 's/.*${ARCHNAME}\///;s/'\''.*//'`" ${ARCHNAME}/; done
- - if [ -f docmaker.php ]; then php -q docmaker.php ${ARCHNAME} >README.html; ln -f docmaker.php README.html ${ARCHNAME}/;fi
- if [ -f makediff.php ]; then ln -f makediff.php ${ARCHNAME}/; fi
- #- rm -f ${ARCHDIR}${ARCHNAME}.zip
- #- zip -9rq ${ARCHDIR}${ARCHNAME}.zip ${ARCHNAME}/
- #- rar a ${ARCHDIR}${ARCHNAME}.rar -mm -m5 -r -s -inul ${ARCHNAME}/
- #tar cf ${ARCHDIR}${ARCHNAME}.tar ${ARCHNAME}/
- #
- find ${ARCHNAME}/ -type d > .paktmp.txt
- find ${ARCHNAME}/ -not -type d | rev | sort | rev >> .paktmp.txt
- #find ${ARCHNAME}/|/ftp/backup/bsort >.paktmp.txt
- tar -c --no-recursion -f ${ARCHDIR}${ARCHNAME}.tar -T.paktmp.txt
- rm -rf .paktmp.txt ${ARCHNAME}
- @make arch_finish_pak
-
-arch_finish_pak:
- - if [ "${NOBZIP2ARCHIVES}" = "" ]; then bzip2 -9 >${ARCHDIR}${ARCHNAME}.tar.bz2 < ${ARCHDIR}${ARCHNAME}.tar; fi
- if [ "${NOGZIPARCHIVES}" = "" ]; then gzip -f9 ${ARCHDIR}${ARCHNAME}.tar; wine /usr/local/bin/DeflOpt.exe ${ARCHDIR}${ARCHNAME}.tar.gz ; fi
- rm -f ${ARCHDIR}${ARCHNAME}.tar
-
-# Makes the packages of various types...
-UNUSED_pak: archpak ;
- if [ -f makediff.php ]; then php -q makediff.php ${ARCHNAME} ${ARCHDIR} 1; fi
-
-omabin_link${DEPFUN_OMABIN}:
- - @rm -f /WWW/src/arch/${ARCHNAME}.tar.{bz2,gz}
- - ln -f ${ARCHDIR}${ARCHNAME}.tar.{bz2,gz} /WWW/src/arch/
- if [ -f progdesc.php ]; then cp -p --remove-destination progdesc.php /WWW/src/.desc-$(subst /,,$(dir $(subst -,/,$(ARCHNAME)))).php 2>/dev/null || cp -fp progdesc.php /WWW/src/.desc-$(subst /,,$(dir $(subst -,/,$(ARCHNAME)))).php; fi
-
-# This is Bisqwit's method to install the packages to web-server...
-UNUSED_omabin${DEPFUN_OMABIN}: archpak
- if [ -f makediff.php ]; then php -q makediff.php ${ARCHNAME} ${ARCHDIR}; fi
- #- @rm -f /WWW/src/arch/${ARCHNAME}.{zip,rar,tar.{bz2,gz}}
- #- ln -f ${ARCHDIR}${ARCHNAME}.{zip,rar,tar.{bz2,gz}} /WWW/src/arch/
- @make omabin_link${DEPFUN_OMABIN}
-
-install${DEPFUN_INSTALL}: ${INSTALLPROGS}
- - if [ ! "${BINDIR}" = "" ]; then mkdir --parents $(BINDIR) 2>/dev/null; mkdir $(BINDIR) 2>/dev/null; \
- for s in ${INSTALLPROGS} ""; do if [ ! "$$s" = "" ]; then \
- ${INSTALL} -c -s -o bin -g bin -m 755 "$$s" ${BINDIR}/"$$s";fi;\
- done; \
- fi; \
- if [ ! "${MANDIR}" = "" ]; then mkdir --parents $(MANDIR) 2>/dev/null; mkdir $(MANDIR) 2>/dev/null; \
- for s in ${INSTALLMANS} ""; do if [ ! "$$s" = "" ]; then \
- ${INSTALL} -m 644 "$$s" ${MANDIR}/man"`echo "$$s"|sed 's/.*\.//'`"/"$$s";fi;\
- done; \
- fi
-
-uninstall${DEPFUN_INSTALL} deinstall${DEPFUN_INSTALL}:
- for s in ${INSTALLPROGS}; do rm -f ${BINDIR}/"$$s";done
- - for s in ${INSTALLLIBS}; do rm -f ${LIBDIR}/"$$s";done
- for s in ${INSTALLMANS} ""; do if [ ! "$$s" = "" ]; then \
- rm -f ${MANDIR}/man"`echo "$$s"|sed 's/.*\.//'`"/"$$s";fi;\
- done; \
-
-.PHONY: pak dep depend archpak omabin \
- install${DEPFUN_INSTALL} \
- deinstall${DEPFUN_INSTALL} \
- uninstall${DEPFUN_INSTALL}
diff --git a/_old_files/docmaker.php b/_old_files/docmaker.php
deleted file mode 100644
index 4576ed9..0000000
--- a/_old_files/docmaker.php
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
- =htmlspecialchars($title)?>
-
-
- =htmlspecialchars($title)?>
- 0. Contents
-
- This is the documentation of =htmlspecialchars($archivename)?>.
-
-
-$url = 'http://iki.fi/bisqwit/source/'.rawurlencode($progname).'.html';
-$k = '
- The official home page of '.htmlspecialchars($progname).'
- is at '.htmlspecialchars($url).'.
- Check there for new versions.
-';
-if(isset($git))
-{
- $k .=
- ''.
- 'Additionally, the most recent source code (bleeding edge) for '.htmlspecialchars($progname).
- ' can also be downloaded by cloning the Git repository'.
- ' by:
'.
- ' git clone '.htmlspecialchars($git).'
'.
- ' git checkout origin/release -b release
'.
- ' git checkout origin/master -b master
'.
- '
';
-}
-$text['download:99999. Downloading'] = $k;
-
-include $docformatfn;
-
-$st1 = stat($docmodulefn);
-$st2 = stat('docmaker.php');
-?>
- Generated from
- =$docmodulefn?> (last updated: =date('r', $st1[9])?>)
- with docmaker.php (last updated: =date('r', $st2[9])?>)
- at =date('r')?>
-
-
-
-
-
-if($outset)
-{
- $s = ob_get_contents();
- ob_end_clean();
- if(file_exists('/usr/local/bin/htmlrecode'))
- {
- /* Try to ensure browser interpretes japanese characters correctly */
- passthru('echo '.shellfix($s).
- '|/usr/local/bin/htmlrecode -Iiso-8859-1 -O'.$outset.' 2>/dev/null');
- }
- else
- print $s;
-}
diff --git a/_old_files/make.rules b/_old_files/make.rules
deleted file mode 100644
index cd3ab6d..0000000
--- a/_old_files/make.rules
+++ /dev/null
@@ -1,170 +0,0 @@
-VERSION=1.0.0
-ARCHNAME=adlmidi-$(VERSION)
-ARCHDIR=archives/
-NOGZIPARCHIVES=1
-
-ARCHFILES=\
- src/adlmidi.cpp src/adlmidi.h \
- src/adlmidi_load.cpp src/adlmidi_midiplay.cpp src/adlmidi_opl3.cpp src/adlmidi_private.cpp \
- src/dbopl.cpp src/dbopl.h \
- src/adldata.cpp src/adldata.hh \
- src/dumpbank/dumpbank.cc src/dumpmiles/dumpmiles.cc \
- src/gen_adldata/gen_adldata.cc \
- midiplay.bas \
- progdesc.php \
- make.rules \
- fraction.h \
- \
- fm_banks/bnk_files/drum.bnk \
- fm_banks/bnk_files/file131.bnk \
- fm_banks/bnk_files/file132.bnk \
- fm_banks/bnk_files/file133.bnk \
- fm_banks/bnk_files/file134.bnk \
- fm_banks/bnk_files/file142.bnk \
- fm_banks/bnk_files/file143.bnk \
- fm_banks/bnk_files/file144.bnk \
- fm_banks/bnk_files/file145.bnk \
- fm_banks/bnk_files/file159.bnk \
- fm_banks/bnk_files/file167.bnk \
- fm_banks/bnk_files/file168.bnk \
- fm_banks/bnk_files/hamdrum.bnk \
- fm_banks/bnk_files/hammelo.bnk \
- fm_banks/bnk_files/intdrum.bnk \
- fm_banks/bnk_files/intmelo.bnk \
- fm_banks/bnk_files/melodic.bnk \
- fm_banks/bnk_files/rickdrum.bnk \
- fm_banks/bnk_files/rickmelo.bnk \
- fm_banks/bnk_files/d2drum.bnk \
- fm_banks/bnk_files/d2melo.bnk \
- fm_banks/bnk_files/normdrum.bnk \
- fm_banks/bnk_files/normmelo.bnk \
- fm_banks/bnk_files/ssdrum.bnk \
- fm_banks/bnk_files/ssmelo.bnk \
- fm_banks/doom2/genmidi.htc \
- fm_banks/doom2/genmidi.op2 \
- fm_banks/doom2/default.op2 \
- fm_banks/ibk_files/game.ibk \
- fm_banks/ibk_files/mt_fm.ibk \
- fm_banks/ibk_files/soccer-genmidi.ibk \
- fm_banks/ibk_files/soccer-percs.ibk \
- fm_banks/ibk_files/nitemare_3d.ibk \
- fm_banks/op3_files/fat2.op3 \
- fm_banks/op3_files/fat4.op3 \
- fm_banks/op3_files/jv_2op.op3 \
- fm_banks/op3_files/wallace.op3 \
- fm_banks/opl_files/file12.opl \
- fm_banks/opl_files/file13.opl \
- fm_banks/opl_files/file15.opl \
- fm_banks/opl_files/file16.opl \
- fm_banks/opl_files/file17.opl \
- fm_banks/opl_files/file19.opl \
- fm_banks/opl_files/file20.opl \
- fm_banks/opl_files/file21.opl \
- fm_banks/opl_files/file23.opl \
- fm_banks/opl_files/file24.opl \
- fm_banks/opl_files/file25.opl \
- fm_banks/opl_files/file26.opl \
- fm_banks/opl_files/file27.opl \
- fm_banks/opl_files/file29.opl \
- fm_banks/opl_files/file30.opl \
- fm_banks/opl_files/file31.opl \
- fm_banks/opl_files/file32.opl \
- fm_banks/opl_files/file34.opl \
- fm_banks/opl_files/file35.opl \
- fm_banks/opl_files/file36.opl \
- fm_banks/opl_files/file37.opl \
- fm_banks/opl_files/file41.opl \
- fm_banks/opl_files/file42.opl \
- fm_banks/opl_files/file47.opl \
- fm_banks/opl_files/file48.opl \
- fm_banks/opl_files/file49.opl \
- fm_banks/opl_files/file50.opl \
- fm_banks/opl_files/file53.opl \
- fm_banks/opl_files/file54.opl \
- fm_banks/opl_files/sample.ad \
- fm_banks/opl_files/sample.opl \
- fm_banks/opl_files/sc3.opl \
- fm_banks/opl_files/simfarm.ad \
- fm_banks/opl_files/simfarm.opl \
- fm_banks/opl_files/warcraft.ad \
- fm_banks/opl_files/nemesis.opl \
- fm_banks/opl_files/nhlpa.opl \
- fm_banks/tmb_files/d3dtimbr.tmb \
- fm_banks/tmb_files/swtimbr.tmb \
- fm_banks/raptor/genmidi.op2
-
-INSTALLPROGS=adlmidi
-
-all: directories libadlmidi.so gen_adldata dumpmiles dumpbank
-
-directories:
- ${MKDIR} obj
- ${MKDIR} bin
-
-libadlmidi.so: obj/adlmidi.o obj/adlmidi_load.o obj/adlmidi_midiplay.o obj/adlmidi_opl3.o obj/adlmidi_private.o obj/adlmidi_xmi2mid.o obj/adlmidi_mus2mid.o obj/nukedopl3.o obj/adldata.o
- $(CXXLINK) $^ $(DEBUG) -shared -o bin/$@ $(LDLIBS)
-
-obj/adlmidi.o: src/adlmidi.cpp src/adlmidi.h src/dbopl.h src/nukedopl3.h src/adldata.hh
- $(CXX) $(CPPFLAGS) $< $(DEBUG) -c -fPIC -o $@
-
-obj/adlmidi_load.o: src/adlmidi_load.cpp src/adlmidi_private.hpp src/adlmidi.h src/adldata.hh
- $(CXX) $(CPPFLAGS) $< $(DEBUG) -c -fPIC -o $@
-
-obj/adlmidi_midiplay.o: src/adlmidi_midiplay.cpp src/adlmidi_private.hpp src/adlmidi.h src/adldata.hh
- $(CXX) $(CPPFLAGS) $< $(DEBUG) -c -fPIC -o $@
-
-obj/adlmidi_opl3.o: src/adlmidi_opl3.cpp src/adlmidi_private.hpp src/adlmidi.h src/adldata.hh
- $(CXX) $(CPPFLAGS) $< $(DEBUG) -c -fPIC -o $@
-
-obj/adlmidi_private.o: src/adlmidi_private.cpp src/adlmidi_private.hpp src/adlmidi.h src/adldata.hh
- $(CXX) $(CPPFLAGS) $< $(DEBUG) -c -fPIC -o $@
-
-obj/dbopl.o: src/dbopl.cpp src/dbopl.h
- $(CXX) $(CPPFLAGS) $< $(DEBUG) -DADLMIDI_USE_DOSBOX_OPL -c -fPIC -o $@
-
-obj/nukedopl3.o: src/nukedopl3.c src/nukedopl3.h
- $(CC) $(CFLAGS) $< $(DEBUG) -c -fPIC -o $@
-
-obj/adlmidi_xmi2mid.o: src/adlmidi_xmi2mid.c src/adlmidi_xmi2mid.h
- $(CC) $(CFLAGS) $< $(DEBUG) -c -fPIC -o $@
-
-obj/adlmidi_mus2mid.o: src/adlmidi_mus2mid.c src/adlmidi_mus2mid.h
- $(CC) $(CFLAGS) $< $(DEBUG) -c -fPIC -o $@
-
-obj/adldata.o: src/adldata.cpp src/adldata.hh
- $(CXX) $(CPPFLAGS) $< $(DEBUG) -c -fPIC -o $@
-
-gen_adldata: obj/gen_adldata.o obj/measurer.o obj/nukedopl3.o obj/progs_cache.o obj/ini_processing.o
- $(CXXLINK) $^ $(DEBUG) -o bin/$@ $(LDLIBS) -lpthread
-
-obj/gen_adldata.o: src/gen_adldata/gen_adldata.cc
- $(CXX) $(CPPFLAGS) $< $(DEBUG) -c -o $@
-
-obj/measurer.o: src/gen_adldata/measurer.cpp src/nukedopl3.h
- $(CXX) $(CPPFLAGS) $< $(DEBUG) -c -o $@
-
-obj/progs_cache.o: src/gen_adldata/progs_cache.cpp
- $(CXX) $(CPPFLAGS) $< $(DEBUG) -c -o $@
-
-obj/ini_processing.o: src/gen_adldata/ini/ini_processing.cpp
- $(CXX) $(CPPFLAGS) $< $(DEBUG) -c -o $@
-
-dumpmiles: obj/dumpmiles.o
- $(CXXLINK) $^ $(DEBUG) -o bin/$@ $(LDLIBS)
-
-obj/dumpmiles.o: src/dumpmiles/dumpmiles.cc
- $(CXX) $(CPPFLAGS) $< $(DEBUG) -c -o $@
-
-dumpbank: obj/dumpbank.o
- $(CXXLINK) $^ $(DEBUG) -o bin/$@ $(LDLIBS)
-
-obj/dumpbank.o: src/dumpbank/dumpbank.cc
- $(CXX) $(CPPFLAGS) $< $(DEBUG) -c -o $@
-
-.PHONY: clean
-
-clean:
- ${RM_F} obj bin
-
-include depfun.mak
-
diff --git a/_old_files/makediff.php b/_old_files/makediff.php
deleted file mode 100644
index 22a21c8..0000000
--- a/_old_files/makediff.php
+++ /dev/null
@@ -1,497 +0,0 @@
-= 2)
- {
- $oldest=''; $oldesttime=999999999;
- foreach($openfiles as $fn => $puh)
- {
- $keep = 0;
- foreach($keeplist as $keepfn) if($fn == $keepfn) { $keep=1; break; }
- if($keep) continue;
- if($puh['time'] < $oldesttime) { $oldesttime = $puh['time']; $oldest = $fn; }
- }
- if($oldest)
- {
- Close($oldest);
- }
- }
-
- $pick = '';
- foreach($files as $fn)
- if(preg_match('@\.tar\.gz$@', $fn))
- {
- $pick = $fn;
- break;
- }
-
- if(!$pick)
- {
- reset($files);
- list($dummy, $pick) = each($files);
- }
-
- GoTmp();
-
- @mkdir($subtmpdir, 0700);
- chdir($subtmpdir);
-
- if(preg_match('@\.tar\.gz$@', $pick))
- {
- print "\ttar xfz ../".shellfix($pick)."\n";
- exec('tar xfz ../../'.shellfix($pick));
- }
- else
- {
- print "\tbzip2 -d < ../".shellfix($pick)."| tar xf -\n";
- exec('bzip2 -d < ../../'.shellfix($pick).'| tar xf -');
- }
- $thisdir = exec('echo *');
- exec('mv * ../');
- chdir('..');
-
- global $timeind;
- $openfiles[$pick] = array('dir' => $thisdir, 'time' => ++$timeind);
-
- return $thisdir;
-}
-function Close($fn)
-{
- global $openfiles;
- global $archtmpdir;
-
- $puh = $openfiles[$fn];
- if(!$puh) return;
-
- $prefix = IsInTmp() ? '' : $archtmpdir.'/';
-
- $cmd = 'rm -rf '.shellfix($prefix.$puh['dir']);
- print "\t$cmd\n";
- exec($cmd);
- unset($openfiles[$fn]);
-}
-function CloseAll()
-{
- global $openfiles;
- global $archtmpdir;
-
- UnGoTmp();
-
- $openfiles = Array();
- $cmd = 'rm -rf '.shellfix($archtmpdir);
- print "\t$cmd\n";
- exec($cmd);
-}
-function MakeDiff($dir1, $dir2, $patchname)
-{
- GoTmp();
- #print "## Building $patchname from $dir1 and $dir2\n";
- #passthru('ls -al');
-
- /*
- Before doing the diff, we should do the following:
- - Remove all symlinks
- - Remove all duplicate hardlinks
- */
-
- /* Gather up inode numbers. */
-
- $data1 = FindInodes($dir1);
- $data2 = FindInodes($dir2);
-
- $era1 = Array();
- $era2 = Array();
-
- foreach($data1['if'] as $ino => $fils)
- {
- if(count($fils) > 1)
- {
- $bestcommoncount = 0;
- $bestcommon = $fn;
- $group2 = array();
- foreach($fils as $fn)
- {
- $ino2 = $data2['fi'][$fn];
- if(!isset($ino2))continue;
-
- $fils2 = $data2['if'][$ino2];
-
- $common = array_intersect($fils, $fils2);
- if(count($common) > $bestcommoncount)
- {
- $bestcommoncount = count($common);
- $bestcommon = $fn;
- $group2 = $fils2;
- }
- }
- $common = array_intersect($fils, $group2);
-
- // Leave one file so that diff works
- reset($common);
- list($dummy, $fn) = each($common);
- unset($common[$dummy]);
-
- foreach($common as $fn)
- {
- $era1[] = $fn;
- $era2[] = $fn;
- }
- }
- }
-
- if(count($era1))
- {
- chdir($dir1); print "\tcd $dir1\n";
- $cmd = 'rm -f';
- foreach($era1 as $fn)$cmd .= ' '.shellfix($fn);
- print "\t$cmd\n";
- exec($cmd);
- chdir('..'); print "\tcd ..\n";
- }
- if(count($era2))
- {
- chdir($dir2); print "\tcd $dir2\n";
- $cmd = 'rm -f';
- foreach($era1 as $fn)$cmd .= ' '.shellfix($fn);
- print "\t$cmd\n";
- exec($cmd);
- chdir('..'); print "\tcd ..\n";
- }
-
- $cmd = 'LC_ALL=C LANG=C diff -NaHudr '.shellfix($dir1) . ' ' . shellfix($dir2).' > '.shellfix($patchname);
- print "\t$cmd\n";
- exec($cmd);
-}
-function FindInodes($directory)
-{
- for($try = 0; $try < 10; $try++)
- {
- $fp = @opendir($directory);
- if($fp) break;
- print "OPENDIR $directory failed (cwd=".getcwd()."), retrying\n";
- sleep(1);
- }
- if($try == 10)
- {
- print "OPENDIR $directory failed (cwd=".getcwd().")!\n";
- exit;
- }
-
- $inofil = array();
- $filino = array();
-
- while(($fn = readdir($fp)))
- {
- if($fn=='.' || $fn=='..')continue;
-
- if($directory != '.')
- $fn = $directory.'/'.$fn;
-
- $st = stat($fn);
- $ino = $st[0].':'.$st[1];
-
- $inofil[$ino][] = $fn;
- $filino[$fn] = $ino;
-
- if(is_dir($fn))
- {
- $sub = FindInodes($fn);
- $filino = $filino + $sub['fi'];
-
- foreach($sub['if'] as $ino => $fil)
- {
- $tgt = &$inofil[$ino];
- if(is_array($tgt))
- $tgt = array_merge($tgt, $fil);
- else
- $tgt = $fil;
- }
- unset($tgt);
- }
- }
- closedir($fp);
- return array('if' => $inofil, 'fi' => $filino);
-}
-function MakePatch($progname, $v1, $v2, $paks1, $paks2)
-{
- // print "Make patch for $progname $v1 - $v2\n";
- // Available packages for prog1: print_r($paks1);
- // Available packages for prog2: print_r($paks2);
-
- $v1 = preg_replace('/(-----)*$/', '', $v1);
- $v2 = preg_replace('/(-----)*$/', '', $v2);
-
- $v1string = preg_replace('/\.$/', '', preg_replace('|(.....)|e', '(str_replace("-","","$1"))."."', $v1));
- $v2string = preg_replace('/\.$/', '', preg_replace('|(.....)|e', '(str_replace("-","","$1"))."."', $v2));
-
- $files1 = Array();
- foreach($paks1 as $ext)
- $files1[] = $progname . '-' . $v1string . '.' . $ext;
-
- $files2 = Array();
- foreach($paks2 as $ext)
- $files2[] = $progname . '-' . $v2string . '.' . $ext;
-
- $keeplist = array_merge($files1, $files2);
- $dir1 = Open($files1, $keeplist);
- $dir2 = Open($files2, $keeplist);
-
- $patchname = "patch-$progname-$v1string-$v2string";
-
- MakeDiff($dir1, $dir2, $patchname);
-
- GoTmp();
-
- $cmd = "gzip -9 ".shellfix($patchname);
- print "\t$cmd\n";
- exec($cmd);
-
- $cmd = "gzip -d < ".shellfix($patchname). ".gz | bzip2 -9 > ".shellfix($patchname).".bz2";
- print "\t$cmd\n";
- exec($cmd);
-
- $cmd = "mv -f ".shellfix($patchname).".{gz,bz2} ../";
- print "\t$cmd\n";
- exec($cmd);
-
- UnGoTmp();
-
- $cmd = "touch -r".shellfix($files2[0])." ".shellfix($patchname).".{gz,bz2}";
- print "\t$cmd\n";
- exec($cmd);
-
- $cmd = "chown --reference ".shellfix($files2[0])." ".shellfix($patchname).".{gz,bz2}";
- print "\t$cmd\n";
- exec($cmd);
-
- global $argv;
- if(!$argv[3])
- {
- $cmd = 'ln -f '.shellfix($patchname).'.{gz,bz2} /WWW/src/arch/';
- print "\t$cmd\n";
- exec($cmd);
- }
-}
-
-$progs = array();
-$fp = opendir('.');
-$f = array();
-while(($fn = readdir($fp)))
-{
- if(preg_match('@\.sh\.(gz|bz2)$@', $fn))continue;
- if(preg_match('@^patch-.*-[0-9].*-[0-9].*\...*@', $fn))
- {
- preg_match(
- '/^patch-(.*(?:-opt)?)-([0-9][0-9.a-z-]*)-([0-9][0-9.a-z-]*)\.([a-z0-9]+)$/', $fn, $tab);
- // tab[0] = fn
- // tab[1] = progname
- // tab[2] = old version
- // tab[3] = new version
- // tab[4] = compression type (gz, bz2)
-
- $progname = $tab[1];
- $version1 = calcversion($tab[2]);
- $version2 = calcversion($tab[3]);
- $archtype = $tab[4];
-
- # print "patch prog {$tab[1]} vers1 {$tab[2]} vers2 {$tab[3]} comp {$tab[4]}\n";
-
- $progs[$progname]['p'][$version1][$version2][$archtype] = $archtype;
- }
- else
- {
- preg_match('/(.*(?:-opt)?)-((?!-opt)[0-9][0-9.a-z-]*)\.(tar\.[a-z0-9]+|zip|rar)$/', $fn, $tab);
- // tab[0] = fn
- // tab[1] = progname
- // tab[2] = version
- // tab[3] = archive type (tar.gz, tar.bz2, zip, rar)
-
- #print "$fn:\n";
- #print_r($tab);
-
- $progname = $tab[1];
- $version = calcversion($tab[2]);
- $archtype = $tab[3];
-
- if($archtype != 'zip' && $archtype != 'rar')
- {
- # print "prog {$tab[1]} vers {$tab[2]} comp {$tab[3]}\n";
-
- $progs[$progname]['v'][$version][$archtype] = $archtype;
- }
- }
-}
-closedir($fp);
-
-$argv[1] = preg_replace('@^[^-]*(?:-opt)?-([0-9])@', '\1', $argv[1]);
-$wantversion = strlen($argv[1]) ? calcversion($argv[1]) : '';
-
-foreach($progs as $progname => $data)
-{
- $versions = $data['v'];
- ksort($versions);
-
- $wantpatches = Array();
-
- $verstabs = Array();
- for($c=1; $c<=6; $c++)
- {
- foreach($versions as $version => $paks)
- {
- $k = substr($version, 0, $c*5);
- $verstabs[$c][$k] = $k;
- }
- asort($verstabs[$c]);
- }
-
- $lastversio = '';
- foreach($versions as $version => $paks)
- {
- if($lastversio)
- {
- $did = Array($lastversio => 1);
-
- $wantpatches[$lastversio][$version] = 1;
-
- for($c=1; $c<=5; ++$c)
- {
- $prev = '';
- $k = substr($version, 0, $c*5);
-
- $test = str_pad($k, 5*6, '-');
- if($test != $version
- && isset($versions[$test])) continue;
- foreach($verstabs[$c] as $k2)
- {
- if($k2 == $k)break;
- $prev = $k2;
- }
-
- if($prev)
- {
- $prev = str_pad($prev, 5*6, '-');
- if(isset($versions[$prev]) && !$did[$prev])
- {
- $did[$prev] = 1;
-
- // Extra
- $wantpatches[$prev][$version] = 1;
- }
- }
- }
- }
- $lastversio = $version;
- }
-
- foreach($wantpatches as $version1 => $v2tab)
- {
- foreach($v2tab as $version2 => $dummy)
- {
- if(strlen($wantversion))
- {
- if($version2 != $wantversion)
- {
- continue;
- }
- }
- else if(isset($progs[$progname]['p'][$version1][$version2]))
- {
- continue;
- }
-
- MakePatch($progname, $version1, $version2,
- $versions[$version1],
- $versions[$version2]);
- }
- }
-}
-print_r($thisdir);
-CloseAll();
-UnGoTmp();
diff --git a/_old_files/midiplay.bas b/_old_files/midiplay.bas
deleted file mode 100644
index 2aa1324..0000000
--- a/_old_files/midiplay.bas
+++ /dev/null
@@ -1,590 +0,0 @@
-0 REM MIDI PLAYER EXAMPLE PROGRAM COPYRIGHT (C) 2010 JOEL YLILUOMA
-1 DEFINT A-Z: OPTION BASE 0: KEY OFF: REM http://iki.fi/bisqwit/
-
-2 DIM adl(180, 11), chins(17), chpan(17), chpit(17)
-3 FOR i = 0 TO 180: FOR x = 0 TO 11: READ adl(i, x): NEXT x, i
-4 GOTO 100 ' Begin program
-
-5 'Set up OPL parameters (In: c = channel (0..17))
-6 'Out: p=I/O port, q = per-OPL channel (0..8), o=operator offset
-7 p = &H388 + 2 * (c\9): q = c MOD 9: o = (q MOD 3) + 8 * (q\3): RETURN
-
-8 'OPL_NoteOff(c): c=channel. CHANGES: q,p,o
-9 GOSUB 5: OUT p, &HB0 + q: OUT p+1, chpit(c) AND &HDF: RETURN
-
-10 'OPL_NoteOn(c,h#): c=channel,h#=hertz (0..131071). CHANGES: q,p,o,x
-11 GOSUB 5
-12 x = &H2000: WHILE h# >= 1023.5: h# = h#/2: x=x+&H400: WEND 'Calculate octave
-13 x = x + CINT(h#)
-14 OUT p, &HA0 + q: OUT p+1, x AND 255: x = x \ 256
-15 OUT p, &HB0 + q: OUT p+1, x: chpit(c) = x: RETURN
-
-16 'Technically, AdLib requires some delay between consecutive OUT commands.
-17 'However, BASIC is slow enough, that this is not an issue really.
-18 'The paradigm "OUT p,index: OUT p+1,value" works perfectly.
-
-20 'OPL_Touch(c,v): c=channel, v=volume. CHANGES: q,p,o,i,v
-21 'The formula below: SOLVE(V=127*127 * 2^( (A-63) / 8), A)
-22 IF v < 72 THEN v = 0 ELSE v = LOG(v) * 11.541561# - 48.818955#
-25 'OPL_Touch_Real(c,v): Same as OPL_Touch, except takes logarithmic volume.
-26 GOSUB 5: i = chins(c)
-27 OUT p, &H40+o: q = adl(i, 2): GOSUB 29
-28 OUT p, &H43+o: q = adl(i, 3)
-29 OUT p+1, (q OR 63) - v + ((q AND 63) * v) \ 63: RETURN
-
-30 'OPL_Patch(c): c=channel. CHANGES: q,p,o,x,i
-31 GOSUB 5: i = chins(c): q = p+1
-32 FOR x = 0 TO 1
-33 OUT p, &H20+o+x*3: OUT q, adl(i, 0+x)
-34 OUT p, &H60+o+x*3: OUT q, adl(i, 4+x)
-35 OUT p, &H80+o+x*3: OUT q, adl(i, 6+x)
-36 OUT p, &HE0+o+x*3: OUT q, adl(i, 8+x)
-37 NEXT: RETURN
-
-38 'OPL_Pan(c): c=channel. CHANGES: q,p,o
-39 GOSUB 5: OUT p, &HC0+q: OUT p+1, adl(chins(c),10)-chpan(c): RETURN
-
-40 'OPL_Reset(). CHANGES: c,q,p,o,x,y,v,i
-41 'Detect OPL3 (send pulses to timer, opl3 enable register)
-42 c=0: GOSUB 5: FOR y = 3 TO 4: OUT p, 4: OUT p+1, y*32: NEXT: ?INP(p)
-43 c=9: GOSUB 5: FOR y = 0 TO 2: OUT p, 5: OUT p+1, y AND 1: NEXT
-44 'Reset OPL3 (turn off all notes, set vital settings)
-45 c=0: GOSUB 5: OUT p, 1: OUT p+1, 32 'Enable wave
-46 c=0: GOSUB 5: OUT p,&HBD:OUT p+1, 0 'Set melodic mode
-47 c=9: GOSUB 5: OUT p, 5: OUT p+1, 1 'Enable OPL3
-48 c=9: GOSUB 5: OUT p, 4: OUT p+1, 0 'Select mode 0 (also try 63 for fun!)
-50 'OPL_Silence(): Silence all OPL channels. CHANGES q,p,o,v,c,i
-51 v = 0: FOR c = 0 TO 17: GOSUB 8: GOSUB 25: NEXT: RETURN
-
-70 'ReadString(): Read N bytes from file. Input: x. Output: s$. CHANGES x
-71 s$ = "": WHILE x > 0: x = x - 1: GET #1: s$ = s$ + b$: WEND: RETURN
-
-75 'ReadVarLen(): Read variable length int from file. Output: x#. CHANGES x
-76 x# = 0
-77 GET #1: x = ASC(b$): x# = x# * 128 + (x AND 127): IF x >= 128 THEN 77
-78 RETURN
-
-80 'ConvertInteger(): Parses s$ as big-endian integer, stores to x#. CHANGES x
-81 x# = 0: FOR x=1 TO LEN(s$): x# = x# * 256 + ASC(MID$(s$, x, 1)): NEXT: RETURN
-82 'The reason why # (DOUBLE) is used to store integer values
-83 'is that GW-BASIC has only one integer type: INTEGER.
-84 'It supports values in the range -32768..+32737. Making it unsuitable
-85 'for storing values such as delta-times and track lengths, both of which
-86 'are often greater than +32767 in common MIDI files. QuickBASIC supports
-87 'the LONG datatype instead, but I was aiming for GW-BASIC compatibility
-88 'in order to utilize my cool syntax highlighter for the majority
-89 'of the duration of demonstrating this program on Youtube. :)
-
-94 'Ethical subroutine
-95 GOTO 97
-96 KILL filename$
-97 RETURN
-
-100 '*** MAIN MIDI PLAYER PROGRAM ***
-101 'Information about each track:
-102 DIM tkPtr%(100), tkDelay#(100), tkStatus(100), playwait#
-103 'The same, but for loop-beginning:
-104 DIM loPtr%(100), loDelay#(100), loStatus(100), loopwait#
-105 'The same, but cached just in case loop-beginning must be written:
-106 DIM rbPtr%(100), rbDelay#(100), rbStatus(100)
-
-109 'Persistent settings for each MIDI channel.
-110 DIM ChPatch(15), ChBend#(15), ChVolume(15), ChPanning(15), ChVibrato(15)
-
-120 'For each active note, we need the following:
-121 ' Original note number (ORIGINAL, not simulated)
-122 ' Keyoff (Search Key)
-123 ' Aftertouch (Search Key)
-124 ' Simulated note number
-125 ' Keyon -> OPL_NoteOn
-126 ' Bend -> OPL_NoteOn
-127 ' Keyon/touch pressure
-128 ' Ctrl:Volume
-129 ' Adlib channel number
-130 ' All of above
-131 ' MIDI channel (multi search key)
-132 ' Bend
-133 ' Ctrl:Volume
-134 ' Ctrl:Pan
-140 DIM ActCount(15) 'number of active notes on each midi channel
-141 DIM ActTone(15,127) 'orignotenumber -> simulated notenumber
-142 DIM ActAdlChn(15,127) 'orignotenumber -> adlib channel
-143 DIM ActVol(15,127) 'orignotenumber -> pressure
-144 DIM ActRev(15,127) 'orignotenumber -> activeindex (index to ActList)
-145 DIM ActList(15,99) 'activeindex -> orignotenumber (index to ActVol etc)
-
-146 DIM chon(17),chage#(17)'adlchannel -> is_on,age (for channel allocation)
-148 DIM chm(17),cha(17) 'adlchannel -> midichn,activeindex (for collisions)
-149 DIM chx(17),chc(17) 'adlchannel -> x coordinate, color (for graphics)
-
-160 filename$ = "chmmr.mid" '<- FILENAME OF THE MIDI TO BE PLAYED
-161 GOSUB 40 ' Reset AdLib
-162 GOSUB 40 ' ...twice (just in case someone misprogrammed OPL3 previously)
-163 PLAYmode$ = "T255P64"
-164 PLAYmode% = 255 * 64 'Event tick frequency
-165 PLAYbuflen = 2 'Number of events to keep buffered
-166 COLOR 8: CLS : txtline = 2: PRINT "Press Q to quit; Space to pause"
-169 GOSUB 200 ' Load and play MIDI file
-
-170 'Begin main program (this simply monitors the playing status)
-171 'Beware that the timer routine accesses a lot of global variables.
-172 paused = 0
-173 hlt(0) = &HCBF4' HLT; RETF.
-174 hlt = VARPTR(hlt(0))
-175 CALL hlt
-176 ' ^This subroutine saves power. It also makes DOSBox faster.
-177 ' However, QuickBASIC has a different syntax for calling ASM
-178 ' subroutines, so the line 175 will have to be changed when
-179 ' porting to QuickBASIC. Disable it, or try this (qb /Lqb.qlb):
-180 'DEF SEG = VARSEG(hlt(0)): CALL ABSOLUTE(hlt)
-
-182 y$ = INKEY$
-183 IF y$ <> " " THEN 186
-184 paused = 1 - paused
-185 IF paused THEN ? "Pause": PLAY STOP ELSE ? "Ok": PLAY ON
-186 IF y$ <> "q" AND y$ <> CHR$(27) AND y$ <> CHR$(3) THEN 174
-190 PLAY OFF: PRINT "End!": GOSUB 50: KEY ON: END
-
-200 'Subroutine: Load MIDI file
-210 OPEN filename$ FOR RANDOM AS #1 LEN = 1: FIELD #1, 1 AS b$ 'Open file
-
-211 'QuickBASIC has BINARY access mode, which allows to use INPUT$() rather
-212 'than the silly fixed-size GET command, but GW-BASIC does not support
-213 'BINARY, so we use RANDOM here. The difference between BINARY and INPUT
-214 'is that INPUT chokes on EOF characters and translates CRLFs, making it
-215 'unsuitable for working with MIDI files.
-
-220 x = 4: GOSUB 70: IF s$ <> "MThd" THEN ERROR 13'Invalid type file
-230 x = 4: GOSUB 70: GOSUB 80: IF x# <> 6 THEN ERROR 13
-231 x = 2: GOSUB 70: GOSUB 80: Fmt = x#
-232 x = 2: GOSUB 70: GOSUB 80: TrackCount = x#: IF TrackCount>100 THEN ERROR 6
-233 x = 2: GOSUB 70: GOSUB 80: DeltaTicks = x#
-234 InvDeltaTicks# = PLAYmode% / (240000000# * DeltaTicks)
-240 Tempo# = 1000000# * InvDeltaTicks#
-241 bendsense# = 2 / 8192#
-250 FOR tk = 1 TO TrackCount
-251 x = 4: GOSUB 70: IF s$ <> "MTrk" THEN ERROR 13'Invalid type file
-252 x = 4: GOSUB 70: GOSUB 80: TrackLength% = x#: y% = LOC(1)
-253 GOSUB 75: tkDelay#(tk) = x# 'Read next event time
-254 tkPtr%(tk) = LOC(1) 'Save first event file position
-255 GET #1, y% + TrackLength% 'Skip to beginning of next track header
-270 NEXT
-275 FOR a = 0 TO 15: ChVolume(a) = 127: NEXT
-281 PLAY ON: ON PLAY(PLAYbuflen) GOSUB 300 'Set up periodic event handler
-282 began = 0: loopStart = 1: playwait# = 0: PLAY "MLMB"
-
-300 'Subroutine: Timer callback. Called when the PLAY buffer is exhausted.
-301 IF began THEN playwait# = playwait# - 1#
-302 'For each track where delay=0, parse events and read new delay.
-303 WHILE playwait# < .5#: GOSUB 310: WEND
-304 'Repopulate the PLAY buffer
-305 WHILE PLAY(0) < PLAYbuflen: PLAY PLAYmode$: WEND: RETURN
-
-310 'Subroutine: Process events on any track that is due
-311 FOR tk = 1 TO TrackCount
-312 rbPtr%(tk) = tkPtr%(tk)
-313 rbDelay#(tk) = tkDelay#(tk)
-314 rbStatus(tk) = tkStatus(tk)
-315 IF tkStatus(tk) < 0 OR tkDelay#(tk) > 0 THEN 319
-316 GOSUB 350 'Handle event
-317 GOSUB 75: tkDelay#(tk) = tkDelay#(tk) + x# 'Read next event time
-318 tkPtr%(tk) = LOC(1) 'Save modified file position
-319 NEXT
-320 IF loopStart = 0 THEN 338
-321 'Save loop begin
-322 FOR tk = 1 TO TrackCount
-323 loPtr%(tk) = rbPtr%(tk)
-324 loDelay#(tk) = rbDelay#(tk)
-325 loStatus(tk) = rbStatus(tk)
-326 NEXT
-327 loopwait# = playwait#
-328 loopStart = 0
-329 GOTO 338
-330 'Return to loop beginning
-331 FOR tk = 1 TO TrackCount
-332 tkPtr%(tk) = loPtr%(tk)
-333 tkDelay#(tk) = loDelay#(tk)
-334 tkStatus(tk) = loStatus(tk)
-335 NEXT
-336 loopEnd = 0
-337 playwait# = loopwait#
-338 'Find shortest delay from all tracks
-339 nd# = -1
-340 FOR tk = 1 TO TrackCount
-341 IF tkStatus(tk) < 0 THEN 343
-342 IF nd# = -1 OR tkDelay#(tk) < nd# THEN nd# = tkDelay#(tk)
-343 NEXT
-344 'Schedule the next playevent to be processed after that delay
-345 FOR tk = 1 TO TrackCount: tkDelay#(tk) = tkDelay#(tk) - nd#: NEXT
-346 t# = nd# * Tempo#: IF began THEN playwait# = playwait# + t#
-347 FOR a = 0 TO 17: chage#(a) = chage#(a) + t#: NEXT
-348 IF t# < 0 OR loopEnd THEN 330 ELSE RETURN 'Loop or done
-
-350 'Subroutine: Read an event from track, and read next delay. Input: tk
-
-351 'Note that we continuously access the disk file during playback.
-352 'This is perfectly fine when we are running on a modern OS, possibly
-353 'under the encapsulation of DOSBox, but if you're running this on
-354 'vanilla MS-DOS without e.g. SMARTDRV, you are going to find this
-355 'program very unsuitable for your MIDI playing needs, for the disk
-356 'drive would probably make more noise than the soundcard does.
-357 'We cannot cache tracks because of memory constraints in GW-BASIC.
-358 'In QBASIC, we could do better, but it would be cumbersome to implement.
-
-359 GET #1, tkPtr%(tk) + 1: b = ASC(b$)
-360 IF b < &HF0 THEN 380
-361 'Subroutine for Fx special events
-362 '? tk;":";HEX$(b);" at $";hex$(LOC(1))
-363 IF b = &HF7 OR b = &HF0 THEN 76'SysEx. Ignore Varlen.
-364 IF b = &HF3 THEN GET #1: RETURN
-365 IF b = &HF2 THEN GET #1: GET #1: RETURN
-370 'Subroutine for special event FF
-371 GET #1: evtype = ASC(b$): GOSUB 75: x = x#: GOSUB 70
-372 IF evtype = &H2F THEN tkStatus(tk) = -1
-373 IF evtype = &H51 THEN GOSUB 80: Tempo# = x# * InvDeltaTicks#
-374 IF evtype = 6 AND s$ = "loopStart" THEN loopStart = 1
-375 IF evtype = 6 AND s$ = "loopEnd" THEN loopEnd = 1
-376 IF evtype < 1 OR evtype > 6 THEN RETURN
-377 txtline = 3 + (txtline - 2) MOD 20
-378 LOCATE txtline, 1: COLOR 8: PRINT "Meta"; evtype; ": "; s$: RETURN
-
-380 'Subroutine for any normal event (80..EF)
-381 IF b < 128 THEN b = tkStatus(tk) OR &H80: GET #1, tkPtr%(tk)
-382 MidCh = b AND 15: tkStatus(tk) = b
-383 '? tk;":";HEX$(b);" at $";hex$(LOC(1))
-384 ON b\16 - 7 GOTO 400,420,460,470,490,492,495 'Choose event handler
-
-400 'Event: 8x Note Off
-401 GET #1: note = ASC(b$): GET #1': vol=ASC(b$)
-402 ChBend#(MidCh) = 0
-403 n = ActRev(MidCh,note): IF n = 0 THEN RETURN
-404 m = MidCh: GOTO 600 'deallocate active note, and return
-
-420 'Event: 9x Note On
-421 GET #1: note = ASC(b$): GET #1: vol = ASC(b$)
-422 IF vol = 0 THEN 402' Sometimes noteoffs are optimized as 0-vol noteons
-423 IF ActRev(MidCh,note) THEN RETURN 'Ignore repeat notes w/o keyoffs
-424 'Determine the instrument and the note value (tone)
-425 tone = note: i = ChPatch(MidCh)
-426 IF MidCh = 9 THEN i = 128+note-35: tone = adl(i,11) 'Translate percussion
-427 '(MIDI channel 9 always plays percussion and ignores the patch number)
-429 'Allocate AdLib channel (the physical sound channel for the note)
-430 bs# = -9: c = -1
-431 FOR a = 0 TO 17
-432 s# = chage#(a)
-433 IF chon(a) = 0 THEN s# = s# + 3d3 ' Empty channel = privileged
-434 IF chins(a) = i THEN s# = s# + .2# ' Same instrument = good
-435 IF i<128 AND chins(a)>127 THEN s# = s#*2+9'Percussion is inferior to melody
-436 IF s# > bs# THEN bs# = s#: c = a ' Best candidate wins
-437 NEXT
-438 IF chon(c) THEN m=chm(c): n=cha(c): GOSUB 600 'Collision: Kill old note
-439 chon(c) = 1: chins(c) = i: chage#(c) = 0: began = 1
-440 'Allocate active note for MIDI channel
-441 '"Active note" helps dealing with further events affecting this note.
-442 n = ActCount(MidCh) + 1
-443 ActList(MidCh, n) = note
-444 ActRev(MidCh,note) = n
-445 ActCount(MidCh) = n
-449 'Record info about this note
-450 ActTone(MidCh,note) = tone
-451 ActAdlChn(MidCh,note) = c
-452 ActVol(MidCh,note) = vol
-453 chm(c) = MidCh: cha(c) = n ' Save this note's origin so collision works.
-454 GOSUB 30 ' OPL_Patch
-455 GOSUB 530' OPL_Pan with ChPanning
-456 GOSUB 540' OPL_Touch with ChVolume
-457 chx(c) = 1 + (tone+63)MOD 80: chc(c) = 9+(chins(c)MOD 6)
-458 LOCATE 20-c, chx(c): COLOR chc(c): PRINT "#";
-459 GOTO 520 ' OPL_NoteOn with ChBend, and return
-
-460 'Event: Ax Note touch
-461 GET #1: note = ASC(b$): GET #1: vol = ASC(b$)
-462 IF ActRev(MidCh,note) = 0 THEN RETURN'Ignore touch if note is not active
-463 c = ActAdlChn(MidCh,note)
-464 LOCATE 20-c, chx(c): COLOR chc(c): PRINT "&";
-465 ActVol(MidCh,note) = vol
-466 GOTO 540 'update note volume, and return
-
-470 'Event: Bx Controller change
-471 GET #1: ctrlno = ASC(b$): GET #1: value = ASC(b$)
-472 IF ctrlno = 1 THEN ChVibrato(MidCh) = value 'TODO: handle
-473 IF ctrlno = 6 THEN bendsense# = value / 8192#
-474 IF ctrlno = 7 THEN ChVolume(MidCh) = value: mop = 2: GOTO 500
-475 IF ctrlno = 10 THEN 482 'Pan
-476 IF ctrlno = 121 THEN 486 'Reset controllers
-477 IF ctrlno = 123 THEN mop=5: GOTO 500 'All notes off on channel
-478 'Other ctrls worth considering:
-479 ' 0 = choose bank (bank+patch identifies the instrument)
-480 ' 64 = sustain pedal (when used, noteoff does not produce an adlib keyoff)
-481 RETURN
-482 'Ctrl 10: Alter the panning of the channel:
-483 p = 0: IF value < 48 THEN p = 32 ELSE IF value > 79 THEN p = 16
-484 ChPanning(MidCh) = p
-485 mop=4: GOTO 500
-486 'Ctrl 121: Reset all controllers to their default values.
-487 ChBend#(MidCh)=0: ChVibrato(MidCh)=0: ChPan(MidCh)=0
-488 mop=1: GOSUB 500: mop=2: GOSUB 500: mop=4: GOTO 500
-
-490 'Event: Cx Patch change
-491 GET #1: ChPatch(MidCh) = ASC(b$): RETURN
-
-492 'Event: Dx Channel after-touch
-493 GET #1: vol = ASC(b$): mop=3:GOTO 500 'TODO: Verify, is this correct action?
-
-495 'Event: Ex Wheel/bend
-496 GET #1: a = ASC(b$): GET #1
-497 ChBend#(MidCh) = (a + ASC(b$) * 128 - 8192) * bendsense#
-498 mop = 1: GOTO 500 'Update pitches, and return
-
-500 'Subroutine: Update all live notes. Input: MidCh,mop
-501 'Update when mop: 1=pitches; 2=volumes; 3=pressures; 4=pans, 5=off
-502 x1 = ActCount(MidCh)
-503 FOR a = 1 TO x1
-504 note = ActList(MidCh, a)
-505 c = ActAdlChn(MidCh,note): ON mop GOSUB 508,509,510,530,511
-506 NEXT
-507 RETURN
-508 tone = ActTone(MidCh,note): GOTO 520
-509 vol = ActVol(MidCh, note): GOTO 540
-510 ActVol(MidCh,note) = vol: GOTO 540
-511 m = MidCh: n = a: GOTO 600
-
-520 'Subroutine: Update note pitch. Input: c,MidCh,tone. CHANGES q,p,o,x,h#
-521 ' 907*2^(n/12) * (8363) / 44100
-522 h# = 172.00093# * EXP(.057762265#*(tone+ChBend#(MidCh))): GOTO 10'OPL_NoteOn
-
-530 'Subroutine: Update note pan. Input: c,MidCh
-531 chpan(c) = ChPanning(MidCh): GOTO 38 'OPL_Pan
-
-540 'Subroutine: Update note volume. Input: c,MidCh,vol. CHANGES q,p,o,v
-541 v = vol * ChVolume(MidCh): GOTO 20 'OPL_Touch
-
-600 'Subroutine: Deallocate active note (m = MidCh, n = index). CHANGES c,x,q
-601 'Uses m instead of MidCh because called also from alloc-collision code.
-602 x = ActCount(m) ' Find how many active notes
-603 q = ActList(m,n) ' q=note to be deactivated
-604 ActRev(m,q) = 0 ' that note is no more
-605 ActCount(m) = x-1 ' The list is now shorter
-606 c = ActAdlChn(m,q) ' But wait, which adlib channel was it on, again?
-607 chon(c)=0: chage#(c)=0: GOSUB 8'OPL_NoteOff
-608 LOCATE 20-c, chx(c): COLOR 1: PRINT ".";
-610 IF n = x THEN RETURN' Did we delete the last note?
-611 q = ActList(m,x) ' q = last note in list
-612 ActList(m,n) = q ' move into the deleted slot
-613 ActRev(m,q) = n
-614 cha(ActAdlChn(m,q)) = n
-615 RETURN
-
-760 'This FM Instrument Data comes from Miles Sound System, as used
-761 'in the following PC games: Star Control III and Asterix, under
-762 'the name AIL (Audio Interface Library). Today, AIL has been
-763 'released as "open-source freeware" under the name Miles Sound System.
-764 'AIL was used in more than fifty PC games, but so far, I have found
-765 'this particular set of General MIDI FM patches only in SC3 and Asterix.
-766 'Other games using AIL used different sets of FM patches. There is no
-767 'particular reason for preferring this patch set, and in fact, the
-768 'descendant of this program, ADLMIDI, http://iki.fi/source/adlmidi.html ,
-769 'features a large set of different FM patch sets to choose from.
-
-773 'In the Youtube video, I enter this huge blob of DATA lines very quickly
-774 'by using a preprogrammed input TSR, "inputter", which I made just for
-775 'this purpose.
-776 'It inputs the inline command "COLOR 0,4", turning text into black on red,
-777 'and then starts entering DATA lines in an arbitrary geometrical fashion.
-778 'After inputting, the text color is reset to normal with "COLOR 7,0".
-779 'Of course, the whole time, the poor syntax highlighter TSR (synhili)
-780 'does its best to make sense of whatever is being displayed on the screen,
-781 'causing the text to stay red only for a short while, whereever the cursor
-782 'was last. The resulting effect looks very cool, and most importantly,
-783 'the long sequence of DATA gets input in a non-boring manner.
-
-790 'The data bytes are:
-791 ' [0,1] AM/VIB/EG/KSR/Multiple bits for carrier and modulator respectively
-792 ' [2,3] KSL/Attenuation settings for carrier and modulator respectively
-793 ' [4,5] Attack and decay rates for carrier and modulator respectively
-794 ' [6,7] Sustain and release rates for carrier and modulator respectively
-795 ' [8,9] Wave select settings for carrier and modulator respectively
-796 ' [10] Feedback/connection bits for the channel (also stereo/pan bits)
-797 ' [11] For percussive instruments (GP35..GP87), the tone to play
-
-800 DATA 1, 1,143, 6,242,242,244,247,0,0, 56, 0: REM GM1:AcouGrandPiano
-801 DATA 1, 1, 75, 0,242,242,244,247,0,0, 56, 0: REM GM2:BrightAcouGrand
-802 DATA 1, 1, 73, 0,242,242,244,246,0,0, 56, 0: REM GM3:ElecGrandPiano
-803 DATA 129, 65, 18, 0,242,242,247,247,0,0, 54, 0: REM GM4:Honky-tonkPiano
-804 DATA 1, 1, 87, 0,241,242,247,247,0,0, 48, 0: REM GM5:Rhodes Piano
-805 DATA 1, 1,147, 0,241,242,247,247,0,0, 48, 0: REM GM6:Chorused Piano
-806 DATA 1, 22,128, 14,161,242,242,245,0,0, 56, 0: REM GM7:Harpsichord
-807 DATA 1, 1,146, 0,194,194,248,248,0,0, 58, 0: REM GM8:Clavinet
-808 DATA 12,129, 92, 0,246,243,244,245,0,0, 48, 0: REM GM9:Celesta
-809 DATA 7, 17,151,128,243,242,242,241,0,0, 50, 0: REM GM10:Glockenspiel
-810 DATA 23, 1, 33, 0, 84,244,244,244,0,0, 50, 0: REM GM11:Music box
-811 DATA 152,129, 98, 0,243,242,246,246,0,0, 48, 0: REM GM12:Vibraphone
-812 DATA 24, 1, 35, 0,246,231,246,247,0,0, 48, 0: REM GM13:Marimba
-813 DATA 21, 1,145, 0,246,246,246,246,0,0, 52, 0: REM GM14:Xylophone
-814 DATA 69,129, 89,128,211,163,243,243,0,0, 60, 0: REM GM15:Tubular Bells
-815 DATA 3,129, 73,128,117,181,245,245,1,0, 52, 0: REM GM16:Dulcimer
-816 DATA 113, 49,146, 0,246,241, 20, 7,0,0, 50, 0: REM GM17:Hammond Organ
-817 DATA 114, 48, 20, 0,199,199, 88, 8,0,0, 50, 0: REM GM18:Percussive Organ
-818 DATA 112,177, 68, 0,170,138, 24, 8,0,0, 52, 0: REM GM19:Rock Organ
-819 DATA 35,177,147, 0,151, 85, 35, 20,1,0, 52, 0: REM GM20:Church Organ
-820 DATA 97,177, 19,128,151, 85, 4, 4,1,0, 48, 0: REM GM21:Reed Organ
-821 DATA 36,177, 72, 0,152, 70, 42, 26,1,0, 60, 0: REM GM22:Accordion
-822 DATA 97, 33, 19, 0,145, 97, 6, 7,1,0, 58, 0: REM GM23:Harmonica
-823 DATA 33,161, 19,137,113, 97, 6, 7,0,0, 54, 0: REM GM24:Tango Accordion
-824 DATA 2, 65,156,128,243,243,148,200,1,0, 60, 0: REM GM25:Acoustic Guitar1
-825 DATA 3, 17, 84, 0,243,241,154,231,1,0, 60, 0: REM GM26:Acoustic Guitar2
-826 DATA 35, 33, 95, 0,241,242, 58,248,0,0, 48, 0: REM GM27:Electric Guitar1
-827 DATA 3, 33,135,128,246,243, 34,248,1,0, 54, 0: REM GM28:Electric Guitar2
-828 DATA 3, 33, 71, 0,249,246, 84, 58,0,0, 48, 0: REM GM29:Electric Guitar3
-829 DATA 35, 33, 74, 5,145,132, 65, 25,1,0, 56, 0: REM GM30:Overdrive Guitar
-830 DATA 35, 33, 74, 0,149,148, 25, 25,1,0, 56, 0: REM GM31:Distorton Guitar
-831 DATA 9,132,161,128, 32,209, 79,248,0,0, 56, 0: REM GM32:Guitar Harmonics
-832 DATA 33,162, 30, 0,148,195, 6,166,0,0, 50, 0: REM GM33:Acoustic Bass
-833 DATA 49, 49, 18, 0,241,241, 40, 24,0,0, 58, 0: REM GM34:Electric Bass 1
-834 DATA 49, 49,141, 0,241,241,232,120,0,0, 58, 0: REM GM35:Electric Bass 2
-835 DATA 49, 50, 91, 0, 81,113, 40, 72,0,0, 60, 0: REM GM36:Fretless Bass
-836 DATA 1, 33,139, 64,161,242,154,223,0,0, 56, 0: REM GM37:Slap Bass 1
-837 DATA 33, 33,139, 8,162,161, 22,223,0,0, 56, 0: REM GM38:Slap Bass 2
-838 DATA 49, 49,139, 0,244,241,232,120,0,0, 58, 0: REM GM39:Synth Bass 1
-839 DATA 49, 49, 18, 0,241,241, 40, 24,0,0, 58, 0: REM GM40:Synth Bass 2
-840 DATA 49, 33, 21, 0,221, 86, 19, 38,1,0, 56, 0: REM GM41:Violin
-841 DATA 49, 33, 22, 0,221,102, 19, 6,1,0, 56, 0: REM GM42:Viola
-842 DATA 113, 49, 73, 0,209, 97, 28, 12,1,0, 56, 0: REM GM43:Cello
-843 DATA 33, 35, 77,128,113,114, 18, 6,1,0, 50, 0: REM GM44:Contrabass
-844 DATA 241,225, 64, 0,241,111, 33, 22,1,0, 50, 0: REM GM45:Tremulo Strings
-845 DATA 2, 1, 26,128,245,133,117, 53,1,0, 48, 0: REM GM46:Pizzicato String
-846 DATA 2, 1, 29,128,245,243,117,244,1,0, 48, 0: REM GM47:Orchestral Harp
-847 DATA 16, 17, 65, 0,245,242, 5,195,1,0, 50, 0: REM GM48:Timpany
-848 DATA 33,162,155, 1,177,114, 37, 8,1,0, 62, 0: REM GM49:String Ensemble1
-849 DATA 161, 33,152, 0,127, 63, 3, 7,1,1, 48, 0: REM GM50:String Ensemble2
-850 DATA 161, 97,147, 0,193, 79, 18, 5,0,0, 58, 0: REM GM51:Synth Strings 1
-851 DATA 33, 97, 24, 0,193, 79, 34, 5,0,0, 60, 0: REM GM52:SynthStrings 2
-852 DATA 49,114, 91,131,244,138, 21, 5,0,0, 48, 0: REM GM53:Choir Aahs
-853 DATA 161, 97,144, 0,116,113, 57,103,0,0, 48, 0: REM GM54:Voice Oohs
-854 DATA 113,114, 87, 0, 84,122, 5, 5,0,0, 60, 0: REM GM55:Synth Voice
-855 DATA 144, 65, 0, 0, 84,165, 99, 69,0,0, 56, 0: REM GM56:Orchestra Hit
-856 DATA 33, 33,146, 1,133,143, 23, 9,0,0, 60, 0: REM GM57:Trumpet
-857 DATA 33, 33,148, 5,117,143, 23, 9,0,0, 60, 0: REM GM58:Trombone
-858 DATA 33, 97,148, 0,118,130, 21, 55,0,0, 60, 0: REM GM59:Tuba
-859 DATA 49, 33, 67, 0,158, 98, 23, 44,1,1, 50, 0: REM GM60:Muted Trumpet
-860 DATA 33, 33,155, 0, 97,127,106, 10,0,0, 50, 0: REM GM61:French Horn
-861 DATA 97, 34,138, 6,117,116, 31, 15,0,0, 56, 0: REM GM62:Brass Section
-862 DATA 161, 33,134,131,114,113, 85, 24,1,0, 48, 0: REM GM63:Synth Brass 1
-863 DATA 33, 33, 77, 0, 84,166, 60, 28,0,0, 56, 0: REM GM64:Synth Brass 2
-864 DATA 49, 97,143, 0,147,114, 2, 11,1,0, 56, 0: REM GM65:Soprano Sax
-865 DATA 49, 97,142, 0,147,114, 3, 9,1,0, 56, 0: REM GM66:Alto Sax
-866 DATA 49, 97,145, 0,147,130, 3, 9,1,0, 58, 0: REM GM67:Tenor Sax
-867 DATA 49, 97,142, 0,147,114, 15, 15,1,0, 58, 0: REM GM68:Baritone Sax
-868 DATA 33, 33, 75, 0,170,143, 22, 10,1,0, 56, 0: REM GM69:Oboe
-869 DATA 49, 33,144, 0,126,139, 23, 12,1,1, 54, 0: REM GM70:English Horn
-870 DATA 49, 50,129, 0,117, 97, 25, 25,1,0, 48, 0: REM GM71:Bassoon
-871 DATA 50, 33,144, 0,155,114, 33, 23,0,0, 52, 0: REM GM72:Clarinet
-872 DATA 225,225, 31, 0,133,101, 95, 26,0,0, 48, 0: REM GM73:Piccolo
-873 DATA 225,225, 70, 0,136,101, 95, 26,0,0, 48, 0: REM GM74:Flute
-874 DATA 161, 33,156, 0,117,117, 31, 10,0,0, 50, 0: REM GM75:Recorder
-875 DATA 49, 33,139, 0,132,101, 88, 26,0,0, 48, 0: REM GM76:Pan Flute
-876 DATA 225,161, 76, 0,102,101, 86, 38,0,0, 48, 0: REM GM77:Bottle Blow
-877 DATA 98,161,203, 0,118, 85, 70, 54,0,0, 48, 0: REM GM78:Shakuhachi
-878 DATA 98,161,153, 0, 87, 86, 7, 7,0,0, 59, 0: REM GM79:Whistle
-879 DATA 98,161,147, 0,119,118, 7, 7,0,0, 59, 0: REM GM80:Ocarina
-880 DATA 34, 33, 89, 0,255,255, 3, 15,2,0, 48, 0: REM GM81:Lead 1 squareea
-881 DATA 33, 33, 14, 0,255,255, 15, 15,1,1, 48, 0: REM GM82:Lead 2 sawtooth
-882 DATA 34, 33, 70,128,134,100, 85, 24,0,0, 48, 0: REM GM83:Lead 3 calliope
-883 DATA 33,161, 69, 0,102,150, 18, 10,0,0, 48, 0: REM GM84:Lead 4 chiff
-884 DATA 33, 34,139, 0,146,145, 42, 42,1,0, 48, 0: REM GM85:Lead 5 charang
-885 DATA 162, 97,158, 64,223,111, 5, 7,0,0, 50, 0: REM GM86:Lead 6 voice
-886 DATA 32, 96, 26, 0,239,143, 1, 6,0,2, 48, 0: REM GM87:Lead 7 fifths
-887 DATA 33, 33,143,128,241,244, 41, 9,0,0, 58, 0: REM GM88:Lead 8 brass
-888 DATA 119,161,165, 0, 83,160,148, 5,0,0, 50, 0: REM GM89:Pad 1 new age
-889 DATA 97,177, 31,128,168, 37, 17, 3,0,0, 58, 0: REM GM90:Pad 2 warm
-890 DATA 97, 97, 23, 0,145, 85, 52, 22,0,0, 60, 0: REM GM91:Pad 3 polysynth
-891 DATA 113,114, 93, 0, 84,106, 1, 3,0,0, 48, 0: REM GM92:Pad 4 choir
-892 DATA 33,162,151, 0, 33, 66, 67, 53,0,0, 56, 0: REM GM93:Pad 5 bowedpad
-893 DATA 161, 33, 28, 0,161, 49,119, 71,1,1, 48, 0: REM GM94:Pad 6 metallic
-894 DATA 33, 97,137, 3, 17, 66, 51, 37,0,0, 58, 0: REM GM95:Pad 7 halo
-895 DATA 161, 33, 21, 0, 17,207, 71, 7,1,0, 48, 0: REM GM96:Pad 8 sweep
-896 DATA 58, 81,206, 0,248,134,246, 2,0,0, 50, 0: REM GM97:FX 1 rain
-897 DATA 33, 33, 21, 0, 33, 65, 35, 19,1,0, 48, 0: REM GM98:FX 2 soundtrack
-898 DATA 6, 1, 91, 0,116,165,149,114,0,0, 48, 0: REM GM99:FX 3 crystal
-899 DATA 34, 97,146,131,177,242,129, 38,0,0, 60, 0: REM GM100:FX 4 atmosphere
-900 DATA 65, 66, 77, 0,241,242, 81,245,1,0, 48, 0: REM GM101:FX 5 brightness
-901 DATA 97,163,148,128, 17, 17, 81, 19,1,0, 54, 0: REM GM102:FX 6 goblins
-902 DATA 97,161,140,128, 17, 29, 49, 3,0,0, 54, 0: REM GM103:FX 7 echoes
-903 DATA 164, 97, 76, 0,243,129,115, 35,1,0, 52, 0: REM GM104:FX 8 sci-fi
-904 DATA 2, 7,133, 3,210,242, 83,246,0,1, 48, 0: REM GM105:Sitar
-905 DATA 17, 19, 12,128,163,162, 17,229,1,0, 48, 0: REM GM106:Banjo
-906 DATA 17, 17, 6, 0,246,242, 65,230,1,2, 52, 0: REM GM107:Shamisen
-907 DATA 147,145,145, 0,212,235, 50, 17,0,1, 56, 0: REM GM108:Koto
-908 DATA 4, 1, 79, 0,250,194, 86, 5,0,0, 60, 0: REM GM109:Kalimba
-909 DATA 33, 34, 73, 0,124,111, 32, 12,0,1, 54, 0: REM GM110:Bagpipe
-910 DATA 49, 33,133, 0,221, 86, 51, 22,1,0, 58, 0: REM GM111:Fiddle
-911 DATA 32, 33, 4,129,218,143, 5, 11,2,0, 54, 0: REM GM112:Shanai
-912 DATA 5, 3,106,128,241,195,229,229,0,0, 54, 0: REM GM113:Tinkle Bell
-913 DATA 7, 2, 21, 0,236,248, 38, 22,0,0, 58, 0: REM GM114:Agogo Bells
-914 DATA 5, 1,157, 0,103,223, 53, 5,0,0, 56, 0: REM GM115:Steel Drums
-915 DATA 24, 18,150, 0,250,248, 40,229,0,0, 58, 0: REM GM116:Woodblock
-916 DATA 16, 0,134, 3,168,250, 7, 3,0,0, 54, 0: REM GM117:Taiko Drum
-917 DATA 17, 16, 65, 3,248,243, 71, 3,2,0, 52, 0: REM GM118:Melodic Tom
-918 DATA 1, 16,142, 0,241,243, 6, 2,2,0, 62, 0: REM GM119:Synth Drum
-919 DATA 14,192, 0, 0, 31, 31, 0,255,0,3, 62, 0: REM GM120:Reverse Cymbal
-920 DATA 6, 3,128,136,248, 86, 36,132,0,2, 62, 0: REM GM121:Guitar FretNoise
-921 DATA 14,208, 0, 5,248, 52, 0, 4,0,3, 62, 0: REM GM122:Breath Noise
-922 DATA 14,192, 0, 0,246, 31, 0, 2,0,3, 62, 0: REM GM123:Seashore
-923 DATA 213,218,149, 64, 55, 86,163, 55,0,0, 48, 0: REM GM124:Bird Tweet
-924 DATA 53, 20, 92, 8,178,244, 97, 21,2,0, 58, 0: REM GM125:Telephone
-925 DATA 14,208, 0, 0,246, 79, 0,245,0,3, 62, 0: REM GM126:Helicopter
-926 DATA 38,228, 0, 0,255, 18, 1, 22,0,1, 62, 0: REM GM127:Applause/Noise
-927 DATA 0, 0, 0, 0,243,246,240,201,0,2, 62, 0: REM GM128:Gunshot
-928 DATA 16, 17, 68, 0,248,243,119, 6,2,0, 56, 35: REM GP35:Ac Bass Drum
-929 DATA 16, 17, 68, 0,248,243,119, 6,2,0, 56, 35: REM GP36:Bass Drum 1
-930 DATA 2, 17, 7, 0,249,248,255,255,0,0, 56, 52: REM GP37:Side Stick
-931 DATA 0, 0, 0, 0,252,250, 5, 23,2,0, 62, 48: REM GP38:Acoustic Snare
-932 DATA 0, 1, 2, 0,255,255, 7, 8,0,0, 48, 58: REM GP39:Hand Clap
-933 DATA 0, 0, 0, 0,252,250, 5, 23,2,0, 62, 60: REM GP40:Electric Snare
-934 DATA 0, 0, 0, 0,246,246, 12, 6,0,0, 52, 47: REM GP41:Low Floor Tom
-935 DATA 12, 18, 0, 0,246,251, 8, 71,0,2, 58, 43: REM GP42:Closed High Hat
-936 DATA 0, 0, 0, 0,246,246, 12, 6,0,0, 52, 49: REM GP43:High Floor Tom
-937 DATA 12, 18, 0, 5,246,123, 8, 71,0,2, 58, 43: REM GP44:Pedal High Hat
-938 DATA 0, 0, 0, 0,246,246, 12, 6,0,0, 52, 51: REM GP45:Low Tom
-939 DATA 12, 18, 0, 0,246,203, 2, 67,0,2, 58, 43: REM GP46:Open High Hat
-940 DATA 0, 0, 0, 0,246,246, 12, 6,0,0, 52, 54: REM GP47:Low-Mid Tom
-941 DATA 0, 0, 0, 0,246,246, 12, 6,0,0, 52, 57: REM GP48:High-Mid Tom
-942 DATA 14,208, 0, 0,246,159, 0, 2,0,3, 62, 72: REM GP49:Crash Cymbal 1
-943 DATA 0, 0, 0, 0,246,246, 12, 6,0,0, 52, 60: REM GP50:High Tom
-944 DATA 14, 7, 8, 74,248,244, 66,228,0,3, 62, 76: REM GP51:Ride Cymbal 1
-945 DATA 14,208, 0, 10,245,159, 48, 2,0,0, 62, 84: REM GP52:Chinese Cymbal
-946 DATA 14, 7, 10, 93,228,245,228,229,3,1, 54, 36: REM GP53:Ride Bell
-947 DATA 2, 5, 3, 10,180,151, 4,247,0,0, 62, 65: REM GP54:Tambourine
-948 DATA 78,158, 0, 0,246,159, 0, 2,0,3, 62, 84: REM GP55:Splash Cymbal
-949 DATA 17, 16, 69, 8,248,243, 55, 5,2,0, 56, 83: REM GP56:Cow Bell
-950 DATA 14,208, 0, 0,246,159, 0, 2,0,3, 62, 84: REM GP57:Crash Cymbal 2
-951 DATA 128, 16, 0, 13,255,255, 3, 20,3,0, 60, 24: REM GP58:Vibraslap
-952 DATA 14, 7, 8, 74,248,244, 66,228,0,3, 62, 77: REM GP59:Ride Cymbal 2
-953 DATA 6, 2, 11, 0,245,245, 12, 8,0,0, 54, 60: REM GP60:High Bongo
-954 DATA 1, 2, 0, 0,250,200,191,151,0,0, 55, 65: REM GP61:Low Bongo
-955 DATA 1, 1, 81, 0,250,250,135,183,0,0, 54, 59: REM GP62:Mute High Conga
-956 DATA 1, 2, 84, 0,250,248,141,184,0,0, 54, 51: REM GP63:Open High Conga
-957 DATA 1, 2, 89, 0,250,248,136,182,0,0, 54, 45: REM GP64:Low Conga
-958 DATA 1, 0, 0, 0,249,250, 10, 6,3,0, 62, 71: REM GP65:High Timbale
-959 DATA 0, 0,128, 0,249,246,137,108,3,0, 62, 60: REM GP66:Low Timbale
-960 DATA 3, 12,128, 8,248,246,136,182,3,0, 63, 58: REM GP67:High Agogo
-961 DATA 3, 12,133, 0,248,246,136,182,3,0, 63, 53: REM GP68:Low Agogo
-962 DATA 14, 0, 64, 8,118,119, 79, 24,0,2, 62, 64: REM GP69:Cabasa
-963 DATA 14, 3, 64, 0,200,155, 73,105,0,2, 62, 71: REM GP70:Maracas
-964 DATA 215,199,220, 0,173,141, 5, 5,3,0, 62, 61: REM GP71:Short Whistle
-965 DATA 215,199,220, 0,168,136, 4, 4,3,0, 62, 61: REM GP72:Long Whistle
-966 DATA 128, 17, 0, 0,246,103, 6, 23,3,3, 62, 44: REM GP73:Short Guiro
-967 DATA 128, 17, 0, 9,245, 70, 5, 22,2,3, 62, 40: REM GP74:Long Guiro
-968 DATA 6, 21, 63, 0, 0,247,244,245,0,0, 49, 69: REM GP75:Claves
-969 DATA 6, 18, 63, 0, 0,247,244,245,3,0, 48, 68: REM GP76:High Wood Block
-970 DATA 6, 18, 63, 0, 0,247,244,245,0,0, 49, 63: REM GP77:Low Wood Block
-971 DATA 1, 2, 88, 0,103,117,231, 7,0,0, 48, 74: REM GP78:Mute Cuica
-972 DATA 65, 66, 69, 8,248,117, 72, 5,0,0, 48, 60: REM GP79:Open Cuica
-973 DATA 10, 30, 64, 78,224,255,240, 5,3,0, 56, 80: REM GP80:Mute Triangle
-974 DATA 10, 30,124, 82,224,255,240, 2,3,0, 56, 64: REM GP81:Open Triangle
-975 DATA 14, 0, 64, 8,122,123, 74, 27,0,2, 62, 72: REM GP82
-976 DATA 14, 7, 10, 64,228, 85,228, 57,3,1, 54, 73: REM GP83
-977 DATA 5, 4, 5, 64,249,214, 50,165,3,0, 62, 70: REM GP84
-978 DATA 2, 21, 63, 0, 0,247,243,245,3,0, 56, 68: REM GP85
-979 DATA 1, 2, 79, 0,250,248,141,181,0,0, 55, 48: REM GP86
-980 DATA 0, 0, 0, 0,246,246, 12, 6,0,0, 52, 53: REM GP87
diff --git a/_old_files/progdesc.php b/_old_files/progdesc.php
deleted file mode 100644
index 4f88998..0000000
--- a/_old_files/progdesc.php
+++ /dev/null
@@ -1,179 +0,0 @@
- "
-
-
-

-
-
This screenshot shows ADLMidi running on Linux, seen through
-a SSH
-session that runs in Cygwin
-XTerm on Windows 7.
-
The lovely dithering pattern is generated by
-animmerger,
-another one of my pet projects…(The image above has only 16 colors)
-
-AdlMIDI is a commandline program that plays MIDI files
-using software OPL3 emulation (FM synthesis).
-
-", 'features:1. Key features' => "
-
-
- - OPL3 emulation with four-operator mode support
- - FM patches from a number of known PC games, copied from
- files typical to
- AIL = Miles Sound System / DMX / HMI = Human Machine Interfaces
- / Creative IBK.
- - Stereo sound
- - Reverb filter based on code from SoX,
- based on code from Freeverb.
- A copy of either project is not needed.
- - Number of simulated soundcards can be specified as 1-100 (maximum channels 1800!)
- - xterm-256color support
- - WIN32 console support (also tested with HXRT / MS-DOS)
- - Pan (binary panning, i.e. left/right side on/off)
- - Pitch-bender with adjustable range
- - Vibrato that responds to RPN/NRPN parameters
- - Sustain enable/disable
- - MIDI and RMI file support
- - loopStart / loopEnd tag support (Final Fantasy VII)
- - Use automatic arpeggio with chords to relieve channel pressure
- - Support for multiple concurrent MIDI synthesizers (per-track device/port select FF 09 message), can be used to overcome 16 channel limit
- - Support for ScummVM, Doom, IMF and CMF files
-
-
-
-This project is developed in C++, but a GW-BASIC version is also provided
-(MIDIPLAY.BAS).
-This player was
-first implemented in GW-BASIC for a Youtube demonstration video!
-With alterations that take 15 seconds to implement,
-it can be run in QBasic and QuickBASIC too.
-Note: The GW-BASIC version does not contain all of the same features that the C++ version does.
-
-", 'usage: 1. Usage' => "
-
-Usage: adlmidi <midifilename> [ <options> ] [ <banknumber> [ <numcards> [ <numfourops>] ] ]
- adlmidi <midifilename> -1 To enter instrument tester
- -p Enables adlib percussion instrument mode (use with CMF files)
- -t Enables tremolo amplification mode
- -v Enables vibrato amplification mode
- -s Enables scaling of modulator volumes
- -nl Quit without looping
- -w Write WAV file rather than playing
- Banks: 0 = AIL (Star Control 3, Albion, Empire 2, Sensible Soccer, Settlers 2, many others)
- 1 = Bisqwit (selection of 4op and 2op)
- 2 = HMI (Descent, Asterix)
- 3 = HMI (Descent:: Int)
- 4 = HMI (Descent:: Ham)
- 5 = HMI (Descent:: Rick)
- 6 = HMI (Descent 2)
- 7 = HMI (Normality)
- 8 = HMI (Shattered Steel)
- 9 = HMI (Theme Park)
- 10 = HMI (3d Table Sports, Battle Arena Toshinden)
- 11 = HMI (Aces of the Deep)
- 12 = HMI (Earthsiege)
- 13 = HMI (Anvil of Dawn)
- 14 = DMX (Doom :: partially pseudo 4op)
- 15 = DMX (Hexen, Heretic :: partially pseudo 4op)
- 16 = DMX (MUS Play :: partially pseudo 4op)
- 17 = AIL (Discworld, Grandest Fleet, Pocahontas, Slob Zone 3d, Ultima 4, Zorro)
- 18 = AIL (Warcraft 2)
- 19 = AIL (Syndicate)
- 20 = AIL (Guilty, Orion Conspiracy, Terra Nova Strike Force Centauri :: 4op)
- 21 = AIL (Magic Carpet 2)
- 22 = AIL (Nemesis)
- 23 = AIL (Jagged Alliance)
- 24 = AIL (When Two Worlds War :: 4op, MISSING INSTRUMENTS)
- 25 = AIL (Bards Tale Construction :: MISSING INSTRUMENTS)
- 26 = AIL (Return to Zork)
- 27 = AIL (Theme Hospital)
- 28 = AIL (National Hockey League PA)
- 29 = AIL (Inherit The Earth)
- 30 = AIL (Inherit The Earth, file two)
- 31 = AIL (Little Big Adventure :: 4op)
- 32 = AIL (Wreckin Crew)
- 33 = AIL (Death Gate)
- 34 = AIL (FIFA International Soccer)
- 35 = AIL (Starship Invasion)
- 36 = AIL (Super Street Fighter 2 :: 4op)
- 37 = AIL (Lords of the Realm :: MISSING INSTRUMENTS)
- 38 = AIL (SimFarm, SimHealth :: 4op)
- 39 = AIL (SimFarm, Settlers, Serf City)
- 40 = AIL (Caesar 2 :: partially 4op, MISSING INSTRUMENTS)
- 41 = AIL (Syndicate Wars)
- 42 = AIL (Bubble Bobble Feat. Rainbow Islands, Z)
- 43 = AIL (Warcraft)
- 44 = AIL (Terra Nova Strike Force Centuri :: partially 4op)
- 45 = AIL (System Shock :: partially 4op)
- 46 = AIL (Advanced Civilization)
- 47 = AIL (Battle Chess 4000 :: partially 4op, melodic only)
- 48 = AIL (Ultimate Soccer Manager :: partially 4op)
- 49 = AIL (Air Bucks, Blue And The Gray, America Invades, Terminator 2029)
- 50 = AIL (Ultima Underworld 2)
- 51 = AIL (Kasparov's Gambit)
- 52 = AIL (High Seas Trader :: MISSING INSTRUMENTS)
- 53 = AIL (Master of Magic, Master of Orion 2 :: 4op, std percussion)
- 54 = AIL (Master of Magic, Master of Orion 2 :: 4op, orchestral percussion)
- 55 = SB (Action Soccer)
- 56 = SB (3d Cyberpuck :: melodic only)
- 57 = SB (Simon the Sorcerer :: melodic only)
- 58 = OP3 (The Fat Man 2op set)
- 59 = OP3 (The Fat Man 4op set)
- 60 = OP3 (JungleVision 2op set :: melodic only)
- 61 = OP3 (Wallace 2op set, Nitemare 3D :: melodic only)
- 62 = TMB (Duke Nukem 3D)
- 63 = TMB (Shadow Warrior)
- 64 = DMX (Raptor)
- 65 = TMB (Blood)
- Use banks 2-5 to play Descent \"q\" soundtracks.
- Look up the relevant bank number from descent.sng.
-
- <numfourops> can be used to specify the number
- of four-op channels to use. Each four-op channel eats
- the room of two regular channels. Use as many as required.
- The Doom & Hexen sets require one or two, while
- Miles four-op set requires the maximum of numcards*6.
-
- When playing Creative Music Files (CMF), try the
- -p and -v options if it sounds wrong otherwise.
-
-", 'copying:1. Copying and contributing' => "
-
-ADLMIDI is distributed under the terms of the
-General Public License
-version 3 (GPL3).
-
-The OPL3 emulator within is from DOSBox is licensed under GPL2+.
-
-The FM soundfonts (patches) used in the program are
-imported from various PC games without permission
-from their respective authors. The question of copyright, when
-it comes to sets of 11 numeric bytes, is somewhat vague, especially
-considering that most of those sets are simply descendants of the
-patch sets originally published by AdLib Inc. for everyone's free use.
-
-Patches (as in source code modifications)
-and other related material can be submitted
-to the primary author
-".GetEmail('by e-mail at:', 'Joel Yliluoma', 'bisqwi'. 't@iki.fi')."
-
-The author also wishes to hear if you use adlmidi, and for what you
-use it and what you think of it.
-
-");
-include '/WWW/progdesc.php';
--
cgit v1.2.3
From c75c232470117287c9e7865ff769fbf3155d1e80 Mon Sep 17 00:00:00 2001
From: Flamefire
Date: Sun, 16 Dec 2018 14:21:29 +0100
Subject: Use alias instead of interface
---
CMakeLists.txt | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d9a8244..c3c56c6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -230,11 +230,10 @@ if(NOT libADLMIDI_STATIC AND NOT libADLMIDI_SHARED)
You must enable at least one of them!")
endif()
-add_library(ADLMIDI INTERFACE)
if(libADLMIDI_SHARED)
- target_link_libraries(ADLMIDI INTERFACE ADLMIDI_shared)
+ add_library(ADLMIDI ALIAS ADLMIDI_shared)
else()
- target_link_libraries(ADLMIDI INTERFACE ADLMIDI_static)
+ add_library(ADLMIDI ALIAS ADLMIDI_static)
endif()
if(WITH_OLD_UTILS)
--
cgit v1.2.3
From 16d2602e043eeb2398bb3be9bb4498228f221be1 Mon Sep 17 00:00:00 2001
From: Flamefire
Date: Sun, 16 Dec 2018 14:43:07 +0100
Subject: Use target_* functions
---
CMakeLists.txt | 168 ++++++++++++++++++++-----------------------
utils/xmi2mid/CMakeLists.txt | 2 +
2 files changed, 80 insertions(+), 90 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c3c56c6..4355b75 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,12 +88,12 @@ endfunction()
option(libADLMIDI_STATIC "Build static library of libADLMIDI" ON)
option(libADLMIDI_SHARED "Build shared library of libADLMIDI" OFF)
-option(WITH_CPP_EXTRAS "Build with support for C++ extras (features are can be found in 'adlmidi.hpp' header)" OFF)
-option(WITH_MIDI_SEQUENCER "Build with embedded MIDI sequencer. Disable this if you want use library in real-time MIDI drivers or plugins.)" ON)
+option(WITH_CPP_EXTRAS "Build with support for C++ extras (features can be found in 'adlmidi.hpp' header)" OFF)
+option(WITH_MIDI_SEQUENCER "Build with embedded MIDI sequencer. Disable this if you want use library in real-time MIDI drivers or plugins." ON)
option(WITH_EMBEDDED_BANKS "Use embedded banks" ON)
option(WITH_HQ_RESAMPLER "Build with support for high quality resampling" OFF)
-option(WITH_MUS_SUPPORT "Build with support for DMX MUS files)" ON)
-option(WITH_XMI_SUPPORT "Build with support for AIL XMI files)" ON)
+option(WITH_MUS_SUPPORT "Build with support for DMX MUS files" ON)
+option(WITH_XMI_SUPPORT "Build with support for AIL XMI files" ON)
option(USE_DOSBOX_EMULATOR "Use DosBox 0.74 OPL3 emulator (semi-accurate, suggested for slow or mobile platforms)" ON)
option(USE_NUKED_EMULATOR "Use Nuked OPL3 emulator (most accurate, powerful)" ON)
@@ -109,81 +109,84 @@ option(WITH_OLD_UTILS "Build also old utilities" OFF)
option(WITH_XMI2MID "Build a XMI to MIDI converter" OFF)
option(EXAMPLE_SDL2_AUDIO "Build also a simple SDL2 demo MIDI player" OFF)
-set(libADLMIDI_INSTALLS)
-
-include_directories(${libADLMIDI_SOURCE_DIR}/include)
-include_directories(${libADLMIDI_SOURCE_DIR}/src/)
-link_directories(${libADLMIDI_BINARY_DIR}/)
-
-set(libADLMIDI_SOURCES)
+function(handle_options targetLib)
+ if(WITH_MIDI_SEQUENCER)
+ target_sources(${targetLib} PRIVATE ${libADLMIDI_SOURCE_DIR}/src/adlmidi_sequencer.cpp)
+ target_compile_definitions(${targetLib} PUBLIC ENABLE_END_SILENCE_SKIPPING)
+ endif()
-list(APPEND libADLMIDI_SOURCES
- ${libADLMIDI_SOURCE_DIR}/src/adlmidi.cpp
- ${libADLMIDI_SOURCE_DIR}/src/adlmidi_load.cpp
- ${libADLMIDI_SOURCE_DIR}/src/adlmidi_midiplay.cpp
- ${libADLMIDI_SOURCE_DIR}/src/adlmidi_opl3.cpp
- ${libADLMIDI_SOURCE_DIR}/src/adlmidi_private.cpp
- ${libADLMIDI_SOURCE_DIR}/src/wopl/wopl_file.c
-)
+ if(NOT WITH_MUS_SUPPORT OR NOT WITH_MIDI_SEQUENCER)
+ target_compile_definitions(${targetLib} PUBLIC BWMIDI_DISABLE_MUS_SUPPORT)
+ endif()
-if(WITH_MIDI_SEQUENCER)
- list(APPEND libADLMIDI_SOURCES
- ${libADLMIDI_SOURCE_DIR}/src/adlmidi_sequencer.cpp
- )
- add_definitions(-DENABLE_END_SILENCE_SKIPPING)
-endif()
+ if(NOT WITH_XMI_SUPPORT OR NOT WITH_MIDI_SEQUENCER)
+ target_compile_definitions(${targetLib} PUBLIC BWMIDI_DISABLE_XMI_SUPPORT)
+ endif()
-if(NOT WITH_MUS_SUPPORT OR NOT WITH_MIDI_SEQUENCER)
- add_definitions(-DBWMIDI_DISABLE_MUS_SUPPORT)
-endif()
+ if(NOT ADLMIDI_DOS)
+ if(USE_DOSBOX_EMULATOR)
+ set(HAS_EMULATOR TRUE)
+ target_sources(${targetLib} PRIVATE
+ ${libADLMIDI_SOURCE_DIR}/src/chips/dosbox_opl3.cpp
+ ${libADLMIDI_SOURCE_DIR}/src/chips/dosbox/dbopl.cpp
+ )
+ else()
+ target_compile_definitions(${targetLib} PUBLIC ADLMIDI_DISABLE_DOSBOX_EMULATOR)
+ endif()
-if(NOT WITH_XMI_SUPPORT OR NOT WITH_MIDI_SEQUENCER)
- add_definitions(-DBWMIDI_DISABLE_XMI_SUPPORT)
-endif()
+ if(USE_NUKED_EMULATOR)
+ set(HAS_EMULATOR TRUE)
+ target_sources(${targetLib} PRIVATE
+ ${libADLMIDI_SOURCE_DIR}/src/chips/nuked_opl3.cpp # v 1.8
+ ${libADLMIDI_SOURCE_DIR}/src/chips/nuked/nukedopl3.c
+ ${libADLMIDI_SOURCE_DIR}/src/chips/nuked_opl3_v174.cpp # v 1.7.4
+ ${libADLMIDI_SOURCE_DIR}/src/chips/nuked/nukedopl3_174.c
+ )
+ else()
+ target_compile_definitions(${targetLib} PUBLIC ADLMIDI_DISABLE_NUKED_EMULATOR)
+ endif()
-if(NOT ADLMIDI_DOS)
- if(USE_DOSBOX_EMULATOR)
- set(HAS_EMULATOR TRUE)
- list(APPEND libADLMIDI_SOURCES
- ${libADLMIDI_SOURCE_DIR}/src/chips/dosbox_opl3.cpp
- ${libADLMIDI_SOURCE_DIR}/src/chips/dosbox/dbopl.cpp
- )
- else()
- add_definitions(-DADLMIDI_DISABLE_DOSBOX_EMULATOR)
+ if(NOT HAS_EMULATOR)
+ message(FATAL_ERROR "No emulators enabled! You must enable at least one emulator!")
+ endif()
endif()
- if(USE_NUKED_EMULATOR)
- set(HAS_EMULATOR TRUE)
- list(APPEND libADLMIDI_SOURCES
- ${libADLMIDI_SOURCE_DIR}/src/chips/nuked_opl3.cpp # v 1.8
- ${libADLMIDI_SOURCE_DIR}/src/chips/nuked/nukedopl3.c
- ${libADLMIDI_SOURCE_DIR}/src/chips/nuked_opl3_v174.cpp # v 1.7.4
- ${libADLMIDI_SOURCE_DIR}/src/chips/nuked/nukedopl3_174.c
- )
+ if(WITH_EMBEDDED_BANKS)
+ target_sources(${targetLib} PRIVATE ${libADLMIDI_SOURCE_DIR}/src/adldata.cpp)
else()
- add_definitions(-DADLMIDI_DISABLE_NUKED_EMULATOR)
+ target_compile_definitions(${targetLib} PUBLIC DISABLE_EMBEDDED_BANKS)
endif()
- if(NOT HAS_EMULATOR)
- message(FATAL_ERROR "No emulators enabled! You must enable at least one emulator!")
+ if(NOT WITH_MIDI_SEQUENCER)
+ target_compile_definitions(${targetLib} PUBLIC ADLMIDI_DISABLE_MIDI_SEQUENCER)
endif()
-endif()
-
-if(WITH_EMBEDDED_BANKS)
- list(APPEND libADLMIDI_SOURCES
- ${libADLMIDI_SOURCE_DIR}/src/adldata.cpp
- )
-else()
- add_definitions(-DDISABLE_EMBEDDED_BANKS)
-endif()
-if(NOT WITH_MIDI_SEQUENCER)
- add_definitions(-DADLMIDI_DISABLE_MIDI_SEQUENCER)
-endif()
+ if(NOT WITH_CPP_EXTRAS)
+ target_compile_definitions(${targetLib} PUBLIC ADLMIDI_DISABLE_CPP_EXTRAS)
+ endif()
+
+ if(WITH_EMBEDDED_BANKS AND WITH_GENADLDATA AND NOT ADLMIDI_DOS)
+ add_dependencies(${targetLib} gen-adldata-run)
+ endif()
+
+ if(WITH_HQ_RESAMPLER AND NOT ADLMIDI_DOS)
+ find_library(ZITA_RESAMPLER_LIBRARY "zita-resampler")
+ if(NOT ZITA_RESAMPLER_LIBRARY)
+ message(FATAL_ERROR "zita-resampler library not found")
+ endif()
+ target_compile_definitions(${targetLib} PRIVATE ADLMIDI_ENABLE_HQ_RESAMPLER)
+ target_link_libraries(${targetLib} PUBLIC ${ZITA_RESAMPLER_LIBRARY})
+ endif()
+endfunction()
-if(NOT WITH_CPP_EXTRAS)
- add_definitions(-DADLMIDI_DISABLE_CPP_EXTRAS)
-endif()
+set(libADLMIDI_SOURCES
+ ${libADLMIDI_SOURCE_DIR}/src/adlmidi.cpp
+ ${libADLMIDI_SOURCE_DIR}/src/adlmidi_load.cpp
+ ${libADLMIDI_SOURCE_DIR}/src/adlmidi_midiplay.cpp
+ ${libADLMIDI_SOURCE_DIR}/src/adlmidi_opl3.cpp
+ ${libADLMIDI_SOURCE_DIR}/src/adlmidi_private.cpp
+ ${libADLMIDI_SOURCE_DIR}/src/wopl/wopl_file.c
+)
# === Static library ====
if(libADLMIDI_STATIC OR WITH_VLC_PLUGIN)
@@ -192,10 +195,7 @@ if(libADLMIDI_STATIC OR WITH_VLC_PLUGIN)
target_include_directories(ADLMIDI_static PUBLIC ${libADLMIDI_SOURCE_DIR}/include)
set_legacy_standard(ADLMIDI_static)
set_visibility_hidden(ADLMIDI_static)
- list(APPEND libADLMIDI_INSTALLS ADLMIDI_static)
- if(WITH_EMBEDDED_BANKS AND WITH_GENADLDATA AND NOT ADLMIDI_DOS)
- add_dependencies(ADLMIDI_static gen-adldata-run)
- endif()
+ handle_options(ADLMIDI_static)
if(NOT libADLMIDI_STATIC)
set_target_properties(ADLMIDI_static PROPERTIES EXCLUDE_FROM_ALL TRUE)
endif()
@@ -208,7 +208,7 @@ if(libADLMIDI_SHARED)
target_include_directories(ADLMIDI_shared PUBLIC ${libADLMIDI_SOURCE_DIR}/include)
set_legacy_standard(ADLMIDI_shared)
set_visibility_hidden(ADLMIDI_shared)
- list(APPEND libADLMIDI_INSTALLS ADLMIDI_shared)
+ handle_options(ADLMIDI_shared)
if(WIN32)
target_compile_definitions(ADLMIDI_shared PRIVATE ADLMIDI_BUILD_DLL)
if(CMAKE_COMPILER_IS_GNUCXX)
@@ -219,9 +219,6 @@ if(libADLMIDI_SHARED)
if(OPENBSD_LOCALBASE)
set_property(TARGET ADLMIDI_shared APPEND_STRING PROPERTY LINK_FLAGS " -lc")
endif()
- if(WITH_EMBEDDED_BANKS AND WITH_GENADLDATA)
- add_dependencies(ADLMIDI_shared gen-adldata-run)
- endif()
set_target_properties(ADLMIDI_shared PROPERTIES SOVERSION "1")
endif()
@@ -239,26 +236,10 @@ endif()
if(WITH_OLD_UTILS)
# Old utility to dump AdLib bank files
add_subdirectory(utils/dumpbank)
-
# Old utility to dump AIL bank files
add_subdirectory(utils/dumpmiles)
endif()
-if(WITH_HQ_RESAMPLER AND NOT ADLMIDI_DOS)
- find_library(ZITA_RESAMPLER_LIBRARY "zita-resampler")
- if(NOT ZITA_RESAMPLER_LIBRARY)
- message(FATAL_ERROR "zita-resampler library not found")
- endif()
- if(TARGET ADLMIDI_shared)
- target_compile_definitions(ADLMIDI_shared PRIVATE ADLMIDI_ENABLE_HQ_RESAMPLER)
- target_link_libraries(ADLMIDI_shared PUBLIC "${ZITA_RESAMPLER_LIBRARY}")
- endif()
- if(TARGET ADLMIDI_static)
- target_compile_definitions(ADLMIDI_static PRIVATE ADLMIDI_ENABLE_HQ_RESAMPLER)
- target_link_libraries(ADLMIDI_static PUBLIC "${ZITA_RESAMPLER_LIBRARY}")
- endif()
-endif()
-
if(WITH_EMBEDDED_BANKS AND WITH_GENADLDATA AND NOT ADLMIDI_DOS)
add_subdirectory(utils/gen_adldata)
endif()
@@ -283,6 +264,13 @@ if(WITH_VLC_PLUGIN AND NOT ADLMIDI_DOS)
add_subdirectory(utils/vlc_codec)
endif()
+set(libADLMIDI_INSTALLS )
+foreach(lib ADLMIDI_static ADLMIDI_shared)
+ if(TARGET ${lib})
+ list(APPEND libADLMIDI_INSTALLS ${lib})
+ endif()
+endforeach()
+
install(TARGETS ${libADLMIDI_INSTALLS}
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
diff --git a/utils/xmi2mid/CMakeLists.txt b/utils/xmi2mid/CMakeLists.txt
index f4a7c94..38dba77 100644
--- a/utils/xmi2mid/CMakeLists.txt
+++ b/utils/xmi2mid/CMakeLists.txt
@@ -1,4 +1,6 @@
add_executable(xmi2mid xmi2mid.cpp)
+# TODO: Use own library
+target_include_directories(xmi2mid PRIVATE ${PROJECT_SOURCE_DIR}/src)
install(TARGETS xmi2mid
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
--
cgit v1.2.3