Squashed 'src/dp_doom/' content from commit 1909924
git-subtree-dir: src/dp_doom git-subtree-split: 190992421c7c643afc99d7f7c511c162f65bea85
This commit is contained in:
commit
a191a82bdc
283 changed files with 149309 additions and 0 deletions
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
build*/
|
||||
.cache/
|
||||
.clangd/
|
||||
.cmake/
|
||||
CMakeLists.txt.user*
|
||||
linuxdoom-1.10/linux
|
||||
**/*.sw?
|
||||
.vscode/
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[submodule "external/SDL"]
|
||||
path = external/SDL
|
||||
url = https://github.com/libsdl-org/SDL
|
216
CMakeLists.txt
Normal file
216
CMakeLists.txt
Normal file
|
@ -0,0 +1,216 @@
|
|||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
project(clowndoom LANGUAGES C)
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set(BACKEND "SDL2" CACHE STRING "Which backend to use: Xlib, SDL1, or SDL2")
|
||||
option(WILDMIDI "Render MIDI using the WildMIDI library" ON)
|
||||
|
||||
add_executable(clowndoom WIN32
|
||||
"linuxdoom-1.10/am_map.c"
|
||||
"linuxdoom-1.10/am_map.h"
|
||||
"linuxdoom-1.10/d_englsh.h"
|
||||
"linuxdoom-1.10/d_event.h"
|
||||
"linuxdoom-1.10/d_french.h"
|
||||
"linuxdoom-1.10/d_items.c"
|
||||
"linuxdoom-1.10/d_items.h"
|
||||
"linuxdoom-1.10/d_main.c"
|
||||
"linuxdoom-1.10/d_main.h"
|
||||
"linuxdoom-1.10/d_net.c"
|
||||
"linuxdoom-1.10/d_net.h"
|
||||
"linuxdoom-1.10/doomdata.h"
|
||||
"linuxdoom-1.10/doomdef.c"
|
||||
"linuxdoom-1.10/doomdef.h"
|
||||
"linuxdoom-1.10/doomstat.c"
|
||||
"linuxdoom-1.10/doomstat.h"
|
||||
"linuxdoom-1.10/doomtype.h"
|
||||
"linuxdoom-1.10/d_player.h"
|
||||
"linuxdoom-1.10/dstrings.c"
|
||||
"linuxdoom-1.10/dstrings.h"
|
||||
"linuxdoom-1.10/d_textur.h"
|
||||
"linuxdoom-1.10/d_think.h"
|
||||
"linuxdoom-1.10/d_ticcmd.h"
|
||||
"linuxdoom-1.10/f_finale.c"
|
||||
"linuxdoom-1.10/f_finale.h"
|
||||
"linuxdoom-1.10/f_wipe.c"
|
||||
"linuxdoom-1.10/f_wipe.h"
|
||||
"linuxdoom-1.10/g_game.c"
|
||||
"linuxdoom-1.10/g_game.h"
|
||||
"linuxdoom-1.10/hu_lib.c"
|
||||
"linuxdoom-1.10/hu_lib.h"
|
||||
"linuxdoom-1.10/hu_stuff.c"
|
||||
"linuxdoom-1.10/hu_stuff.h"
|
||||
"linuxdoom-1.10/ib_sound.h"
|
||||
"linuxdoom-1.10/ib_system.h"
|
||||
"linuxdoom-1.10/ib_video.h"
|
||||
"linuxdoom-1.10/i_main.c"
|
||||
"linuxdoom-1.10/i_net.c"
|
||||
"linuxdoom-1.10/i_net.h"
|
||||
"linuxdoom-1.10/info.c"
|
||||
"linuxdoom-1.10/info.h"
|
||||
"linuxdoom-1.10/i_sound.c"
|
||||
"linuxdoom-1.10/i_sound.h"
|
||||
"linuxdoom-1.10/i_system.c"
|
||||
"linuxdoom-1.10/i_system.h"
|
||||
"linuxdoom-1.10/i_video.c"
|
||||
"linuxdoom-1.10/i_video.h"
|
||||
"linuxdoom-1.10/m_argv.c"
|
||||
"linuxdoom-1.10/m_argv.h"
|
||||
"linuxdoom-1.10/m_bbox.c"
|
||||
"linuxdoom-1.10/m_bbox.h"
|
||||
"linuxdoom-1.10/m_cheat.c"
|
||||
"linuxdoom-1.10/m_cheat.h"
|
||||
"linuxdoom-1.10/m_fixed.c"
|
||||
"linuxdoom-1.10/m_fixed.h"
|
||||
"linuxdoom-1.10/m_menu.c"
|
||||
"linuxdoom-1.10/m_menu.h"
|
||||
"linuxdoom-1.10/m_misc.c"
|
||||
"linuxdoom-1.10/m_misc.h"
|
||||
"linuxdoom-1.10/m_random.c"
|
||||
"linuxdoom-1.10/m_random.h"
|
||||
"linuxdoom-1.10/m_swap.c"
|
||||
"linuxdoom-1.10/m_swap.h"
|
||||
"linuxdoom-1.10/p_ceilng.c"
|
||||
"linuxdoom-1.10/p_doors.c"
|
||||
"linuxdoom-1.10/p_enemy.c"
|
||||
"linuxdoom-1.10/p_floor.c"
|
||||
"linuxdoom-1.10/p_inter.c"
|
||||
"linuxdoom-1.10/p_inter.h"
|
||||
"linuxdoom-1.10/p_lights.c"
|
||||
"linuxdoom-1.10/p_local.h"
|
||||
"linuxdoom-1.10/p_map.c"
|
||||
"linuxdoom-1.10/p_maputl.c"
|
||||
"linuxdoom-1.10/p_mobj.c"
|
||||
"linuxdoom-1.10/p_mobj.h"
|
||||
"linuxdoom-1.10/p_plats.c"
|
||||
"linuxdoom-1.10/p_pspr.c"
|
||||
"linuxdoom-1.10/p_pspr.h"
|
||||
"linuxdoom-1.10/p_saveg.c"
|
||||
"linuxdoom-1.10/p_saveg.h"
|
||||
"linuxdoom-1.10/p_setup.c"
|
||||
"linuxdoom-1.10/p_setup.h"
|
||||
"linuxdoom-1.10/p_sight.c"
|
||||
"linuxdoom-1.10/p_spec.c"
|
||||
"linuxdoom-1.10/p_spec.h"
|
||||
"linuxdoom-1.10/p_switch.c"
|
||||
"linuxdoom-1.10/p_telept.c"
|
||||
"linuxdoom-1.10/p_tick.c"
|
||||
"linuxdoom-1.10/p_tick.h"
|
||||
"linuxdoom-1.10/p_user.c"
|
||||
"linuxdoom-1.10/r_bsp.c"
|
||||
"linuxdoom-1.10/r_bsp.h"
|
||||
"linuxdoom-1.10/r_data.c"
|
||||
"linuxdoom-1.10/r_data.h"
|
||||
"linuxdoom-1.10/r_defs.h"
|
||||
"linuxdoom-1.10/r_draw.c"
|
||||
"linuxdoom-1.10/r_draw.h"
|
||||
"linuxdoom-1.10/r_local.h"
|
||||
"linuxdoom-1.10/r_main.c"
|
||||
"linuxdoom-1.10/r_main.h"
|
||||
"linuxdoom-1.10/r_plane.c"
|
||||
"linuxdoom-1.10/r_plane.h"
|
||||
"linuxdoom-1.10/r_segs.c"
|
||||
"linuxdoom-1.10/r_segs.h"
|
||||
"linuxdoom-1.10/r_sky.c"
|
||||
"linuxdoom-1.10/r_sky.h"
|
||||
"linuxdoom-1.10/r_state.h"
|
||||
"linuxdoom-1.10/r_things.c"
|
||||
"linuxdoom-1.10/r_things.h"
|
||||
"linuxdoom-1.10/sounds.c"
|
||||
"linuxdoom-1.10/sounds.h"
|
||||
"linuxdoom-1.10/s_sound.c"
|
||||
"linuxdoom-1.10/s_sound.h"
|
||||
"linuxdoom-1.10/st_lib.c"
|
||||
"linuxdoom-1.10/st_lib.h"
|
||||
"linuxdoom-1.10/st_stuff.c"
|
||||
"linuxdoom-1.10/st_stuff.h"
|
||||
"linuxdoom-1.10/tables.c"
|
||||
"linuxdoom-1.10/tables.h"
|
||||
"linuxdoom-1.10/v_video.c"
|
||||
"linuxdoom-1.10/v_video.h"
|
||||
"linuxdoom-1.10/wi_stuff.c"
|
||||
"linuxdoom-1.10/wi_stuff.h"
|
||||
"linuxdoom-1.10/w_wad.c"
|
||||
"linuxdoom-1.10/w_wad.h"
|
||||
"linuxdoom-1.10/z_zone.c"
|
||||
)
|
||||
|
||||
set_target_properties(clowndoom PROPERTIES C_STANDARD 99)
|
||||
|
||||
# Handling linking/building WildMIDI
|
||||
if(WILDMIDI)
|
||||
target_compile_definitions(clowndoom PRIVATE WILDMIDI)
|
||||
|
||||
# TODO - Add support for system library
|
||||
#find_package(WildMidi)
|
||||
find_library(WILDMID_LIBRARY WildMidi)
|
||||
|
||||
#if(NOT WildMidi-FOUND)
|
||||
# Set and hide these internal options
|
||||
set(WANT_ALSA OFF CACHE INTERNAL "" FORCE)
|
||||
set(WANT_DEVTEST OFF CACHE INTERNAL "" FORCE)
|
||||
set(WANT_OPENAL OFF CACHE INTERNAL "" FORCE)
|
||||
set(WANT_OSS OFF CACHE INTERNAL "" FORCE)
|
||||
set(WANT_OSX_DEPLOYMENT OFF CACHE INTERNAL "" FORCE)
|
||||
set(WANT_STATIC ON CACHE INTERNAL "" FORCE)
|
||||
|
||||
add_subdirectory("external/wildmidi-0.4.5" EXCLUDE_FROM_ALL)
|
||||
#endif()
|
||||
|
||||
target_link_libraries(clowndoom PRIVATE libwildmidi-static m)
|
||||
endif()
|
||||
|
||||
# Handle backends
|
||||
if(BACKEND STREQUAL "Xlib")
|
||||
target_sources(clowndoom PRIVATE
|
||||
"linuxdoom-1.10/ib_sound/miniaudio.c"
|
||||
"linuxdoom-1.10/ib_sound/miniaudio.h"
|
||||
"linuxdoom-1.10/ib_system/posix.c"
|
||||
"linuxdoom-1.10/ib_video/xlib.c"
|
||||
)
|
||||
|
||||
# These are for the X11 stuff.
|
||||
target_link_libraries(clowndoom PRIVATE Xext X11)
|
||||
|
||||
# These are for miniaudio.
|
||||
target_link_libraries(clowndoom PRIVATE m ${CMAKE_DL_LIBS} pthread)
|
||||
elseif(BACKEND STREQUAL "SDL1")
|
||||
target_sources(clowndoom PRIVATE
|
||||
"linuxdoom-1.10/ib_sound/sdl.c"
|
||||
"linuxdoom-1.10/ib_system/sdl.c"
|
||||
"linuxdoom-1.10/ib_video/sdl.c"
|
||||
)
|
||||
|
||||
find_package(SDL REQUIRED)
|
||||
|
||||
# TODO - Add support for in-tree builds (I don't think it's
|
||||
# actually possible with SDL1 since it lacks a CMake build system)
|
||||
#if(NOT SDL-FOUND)
|
||||
# add_subdirectory("external/sdl1" EXCLUDE_FROM_ALL)
|
||||
#endif()
|
||||
|
||||
target_link_libraries(clowndoom PRIVATE SDL::SDL)
|
||||
elseif(BACKEND STREQUAL "SDL2")
|
||||
target_sources(clowndoom PRIVATE
|
||||
"linuxdoom-1.10/ib_sound/sdl.c"
|
||||
"linuxdoom-1.10/ib_system/sdl.c"
|
||||
"linuxdoom-1.10/ib_video/sdl.c"
|
||||
)
|
||||
|
||||
find_package(SDL2)
|
||||
|
||||
if(NOT SDL2_FOUND)
|
||||
add_subdirectory("external/SDL" EXCLUDE_FROM_ALL)
|
||||
if(SDL_STATIC)
|
||||
target_link_libraries(clowndoom PRIVATE SDL2::SDL2main SDL2::SDL2-static)
|
||||
else()
|
||||
target_link_libraries(clowndoom PRIVATE SDL2::SDL2main SDL2::SDL2)
|
||||
endif()
|
||||
else()
|
||||
target_link_libraries(clowndoom PRIVATE SDL2::SDL2main SDL2::SDL2)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(clowndoom PRIVATE INCLUDE_SDL2_MAIN)
|
||||
else()
|
||||
message(FATAL_ERROR "Invalid BACKEND")
|
||||
endif()
|
25
README.md
Normal file
25
README.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
# clowndoom
|
||||
|
||||
Yet another purist DOOM port.
|
||||
|
||||
This project aims to repair the Linux Doom source code, restoring
|
||||
features that were lost from the DOS version. Additionally, minor
|
||||
quality-of-life improvements have been made, such as a `novert` option.
|
||||
|
||||
Features:
|
||||
* Music support (through WildMIDI)
|
||||
* Proper sound effect support (the original source release lacked
|
||||
features like stopping mid-playback and updating positional effects)
|
||||
* `novert` and `always_run` options have been added to the configuration
|
||||
file
|
||||
* Compiler warnings have been addressed
|
||||
* 64-bit support (warning: save files are incompatible with 32-bit)
|
||||
* X11 code converted from 8bpp to 24bpp (supported by modern X11
|
||||
servers)
|
||||
* OSS audio code converted to miniaudio middleware library (supports
|
||||
OSS, ALSA, PulseAudio, JACK, and more)
|
||||
* Assorted bug fixes
|
||||
* Low-detail mode has been restored to full working order
|
||||
* Mouse-grab is no longer optional, and is instead toggled by the menu
|
||||
being open
|
||||
* Better than CuckyDOOM
|
96
doomsrc.txt
Normal file
96
doomsrc.txt
Normal file
|
@ -0,0 +1,96 @@
|
|||
===========================================================================
|
||||
Archive Maintainer : Please place in /source
|
||||
Primary purpose : Coding or reference
|
||||
Uploaded by : Miguel Folatelli, email: myk@fibertel.com.ar
|
||||
(include "DOOM" in the message subject)
|
||||
===========================================================================
|
||||
Title : Doom source code, under the GNU GPL
|
||||
Filename : linuxdoom-1.10.src.tgz
|
||||
Release date : October 3rd 1999 (relicensed by John Carmack)
|
||||
Author : id Software
|
||||
Email Address : johnc@idsoftware.com
|
||||
(Keep in mind before you bother John about this
|
||||
file that there is tons of info on the net about
|
||||
this source put forth by the "DOOM community"
|
||||
and that John is not actively supporting this
|
||||
file. He did more than enough by releasing it.)
|
||||
Other Files By Author : id Software's game engines
|
||||
Misc. Author Info : One of the id Software founders
|
||||
|
||||
Description : This is a copy of the source code for DOOM's
|
||||
executable, v1.10 (public release version).
|
||||
This source code was initially released under
|
||||
the DOOM license in 1997, but then dual licensed
|
||||
(DOOM/GPL) in 1997 to encourage transparency in
|
||||
the development of ports and extensions of the
|
||||
DOOM game engines. A copy of the source under the
|
||||
DOOM license may be obtained at id Software's
|
||||
FTP, or at one of its mirrors on /idgames in the
|
||||
/idstuff/source directory.
|
||||
|
||||
Additional Credits to : Everyone who's contributed to the understanding
|
||||
and development of the DOOM source code, and Bernd
|
||||
Kreimeier for preparing the source for release.
|
||||
===========================================================================
|
||||
* What is included *
|
||||
|
||||
New levels : 0
|
||||
Sounds : No
|
||||
Music : No
|
||||
Graphics : No
|
||||
Dehacked/BEX Patch : No
|
||||
Demos : No
|
||||
Other : Yes (source code)
|
||||
Other files required : App to open TGZ files (GZip, 7-Zip, WinRAR, etc.)
|
||||
|
||||
|
||||
* Play Information *
|
||||
|
||||
Game : The Ultimate DOOM, DOOM II v1.9, or Final DOOM
|
||||
Map # : N/A
|
||||
Single Player : N/A
|
||||
Cooperative 2-4 Player : N/A
|
||||
Deathmatch 2-4 Player : N/A
|
||||
Other game styles : N/A
|
||||
Difficulty Settings : N/A
|
||||
|
||||
|
||||
* Construction *
|
||||
|
||||
Base : New from scratch
|
||||
Build Time : 1992-1997 (mostly 1992-1993)
|
||||
Editor(s) used : ?
|
||||
Known Bugs : More or less the bugs you find playing DOOM
|
||||
May Not Run With : As it stands, non-Linux OSs
|
||||
Tested With : Probably old Linux builds from 1997
|
||||
|
||||
|
||||
|
||||
* Copyright / Permissions *
|
||||
|
||||
Authors MAY use the contents of this file as a base for modification or
|
||||
reuse as long as they respect the following:
|
||||
|
||||
Copyright (C) 1999 id Software
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
|
||||
* Where to get the file that this text file describes *
|
||||
|
||||
The Usual: ftp://archives.3dgamers.com/pub/idgames/
|
||||
Web sites: http://www.3ddownloads.com/doomworld/ports/doomsrc.zip
|
||||
FTP sites: Any mirrors of the /idgames adchive
|
||||
|
1
external/SDL
vendored
Submodule
1
external/SDL
vendored
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit f17058b562c8a1090c0c996b42982721ace90903
|
19
external/wildmidi-0.4.5/.chklist
vendored
Normal file
19
external/wildmidi-0.4.5/.chklist
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
Edit files for version number (and possibly other changes) :
|
||||
- djgpp/config.h
|
||||
- os2/config.h
|
||||
- amiga/config.h
|
||||
- android/jni/config.h
|
||||
- macosx/config.h
|
||||
- macosx/Makefile
|
||||
- mingw/config.h
|
||||
|
||||
Edit files for possibly other changes:
|
||||
- djgpp/Makefile
|
||||
- os2/makefile
|
||||
- amiga/Makefile*
|
||||
- amiga/*.cfg
|
||||
- android/*
|
||||
- android/jni/*.mk
|
||||
- macosx/Makefile (make sure to update dylib versions here..)
|
||||
- mingw/makefile
|
||||
|
33
external/wildmidi-0.4.5/.github/workflows/main.yml
vendored
Normal file
33
external/wildmidi-0.4.5/.github/workflows/main.yml
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
name: build
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- { os: macos-latest, c: "clang", player: "ON", static: "ON", alsa: "OFF", openal: "ON", oss: "OFF" }
|
||||
- { os: ubuntu-latest, c: "clang", player: "ON", static: "ON", alsa: "ON", openal: "ON", oss: "ON" }
|
||||
- { os: ubuntu-latest, c: "gcc", player: "ON", static: "ON", alsa: "ON", openal: "ON", oss: "ON" }
|
||||
- { os: windows-latest, c: "cl", player: "OFF", static: "ON", alsa: "OFF", openal: "OFF", oss: "OFF" }
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Install dependencies (Linux)
|
||||
if: matrix.config.os == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install libasound2-dev libopenal-dev
|
||||
- name: Install dependencies (macOS)
|
||||
if: matrix.config.os == 'macos-latest'
|
||||
run: |
|
||||
brew install openal-soft
|
||||
- name: Build with ${{ matrix.config.os }} / ${{ matrix.config.c }}
|
||||
env:
|
||||
CC: ${{ matrix.config.c }}
|
||||
run: |
|
||||
cmake -B build -DWANT_PLAYER=${{ matrix.config.player }} -DWANT_STATIC=${{ matrix.config.static }} -DWANT_ALSA=${{ matrix.config.alsa }} -DWANT_OPENAL=${{ matrix.config.openal }} -DWANT_OSS=${{ matrix.config.oss }}
|
||||
cmake --build build -j2
|
||||
|
30
external/wildmidi-0.4.5/.gitignore
vendored
Normal file
30
external/wildmidi-0.4.5/.gitignore
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
# compiled objects #
|
||||
*.o
|
||||
*.so
|
||||
*.dll
|
||||
|
||||
# logs and other texts #
|
||||
*.log
|
||||
|
||||
# OS generated files #
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
Icon?
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
# Eclipse
|
||||
.cproject
|
||||
.preferences.xml
|
||||
.project
|
||||
.settings/
|
||||
|
||||
# CLion
|
||||
.idea/
|
||||
|
||||
# config files
|
||||
include/config.h
|
||||
wildmidi.pc
|
40
external/wildmidi-0.4.5/.travis.yml
vendored
Normal file
40
external/wildmidi-0.4.5/.travis.yml
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
os:
|
||||
- linux
|
||||
- osx
|
||||
dist: focal
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libopenal-dev
|
||||
homebrew:
|
||||
packages:
|
||||
- openal-soft
|
||||
- pkg-config
|
||||
|
||||
language: c
|
||||
env:
|
||||
- BUILD_TYPE=Debug
|
||||
- BUILD_TYPE=Release
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
env:
|
||||
ANALYZE="scan-build --use-cc clang --use-c++ clang++"
|
||||
compiler: clang
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- coverity_scan
|
||||
- /wildmidi-.*$/
|
||||
|
||||
script:
|
||||
- cmake -B build -DWANT_PLAYER=ON -DWANT_ALSA=OFF -DWANT_OPENAL=ON -DWANT_OSS=OFF
|
||||
- ${ANALYZE} cmake --build build -j3 --verbose
|
||||
|
||||
notifications:
|
||||
irc:
|
||||
channels:
|
||||
- "chat.freenode.net#wildmidi"
|
||||
on_success: change
|
||||
on_failure: always
|
344
external/wildmidi-0.4.5/CI/before_script.msvc.sh
vendored
Normal file
344
external/wildmidi-0.4.5/CI/before_script.msvc.sh
vendored
Normal file
|
@ -0,0 +1,344 @@
|
|||
#!/bin/bash
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
ARGSTR=$1
|
||||
shift
|
||||
|
||||
if [ ${ARGSTR:0:1} != "-" ]; then
|
||||
echo "Unknown argument $ARGSTR"
|
||||
echo "Try '$0 -h'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for (( i=1; i<${#ARGSTR}; i++ )); do
|
||||
ARG=${ARGSTR:$i:1}
|
||||
case $ARG in
|
||||
V )
|
||||
VERBOSE=true ;;
|
||||
|
||||
v )
|
||||
VS_VERSION=$1
|
||||
shift ;;
|
||||
|
||||
d )
|
||||
SKIP_DOWNLOAD=true ;;
|
||||
|
||||
e )
|
||||
SKIP_EXTRACT=true ;;
|
||||
|
||||
k )
|
||||
KEEP=true ;;
|
||||
|
||||
u )
|
||||
UNITY_BUILD=true ;;
|
||||
|
||||
p )
|
||||
PLATFORM=$1
|
||||
shift ;;
|
||||
|
||||
c )
|
||||
CONFIGURATION=$1
|
||||
shift ;;
|
||||
|
||||
h )
|
||||
cat <<EOF
|
||||
Usage: $0 [-cdehkpuvV]
|
||||
|
||||
Options:
|
||||
-c <Release/Debug>
|
||||
Set the configuration, can also be set with environment variable CONFIGURATION.
|
||||
-d
|
||||
Skip checking the downloads.
|
||||
-e
|
||||
Skip extracting dependencies.
|
||||
-h
|
||||
Show this message.
|
||||
-k
|
||||
Keep the old build directory, default is to delete it.
|
||||
-p <Win32/Win64>
|
||||
Set the build platform, can also be set with environment variable PLATFORM.
|
||||
-u
|
||||
Configure for unity builds.
|
||||
-v <2013/2015>
|
||||
Choose the Visual Studio version to use.
|
||||
-V
|
||||
Run verbosely
|
||||
EOF
|
||||
exit 0
|
||||
;;
|
||||
|
||||
* )
|
||||
echo "Unknown argument $ARG."
|
||||
echo "Try '$0 -h'"
|
||||
exit 1 ;;
|
||||
esac
|
||||
done
|
||||
done
|
||||
|
||||
if [ -z $VERBOSE ]; then
|
||||
STRIP="> /dev/null 2>&1"
|
||||
fi
|
||||
if [ -z $VS_VERSION ]; then
|
||||
VS_VERSION="2013"
|
||||
fi
|
||||
|
||||
if [ -z $APPVEYOR ]; then
|
||||
echo "Running prebuild outside of Appveyor."
|
||||
|
||||
DIR=$(echo "$0" | sed "s,\\\\,/,g" | sed "s,\(.\):,/\\1,")
|
||||
cd $(dirname "$DIR")/..
|
||||
else
|
||||
echo "Running prebuild in Appveyor."
|
||||
|
||||
cd $APPVEYOR_BUILD_FOLDER
|
||||
VERSION="$(cat README.md | grep Version: | awk '{ print $3; }')-$(git rev-parse --short HEAD)"
|
||||
appveyor UpdateBuild -Version "$VERSION" > /dev/null &
|
||||
fi
|
||||
|
||||
run_cmd() {
|
||||
CMD="$1"
|
||||
shift
|
||||
|
||||
if [ -z $VERBOSE ]; then
|
||||
eval $CMD $@ > output.log 2>&1
|
||||
RET=$?
|
||||
|
||||
if [ $RET -ne 0 ]; then
|
||||
if [ -z $APPVEYOR ]; then
|
||||
echo "Command $CMD failed, output can be found in `real_pwd`/output.log"
|
||||
else
|
||||
echo
|
||||
echo "Command $CMD failed;"
|
||||
cat output.log
|
||||
fi
|
||||
else
|
||||
rm output.log
|
||||
fi
|
||||
|
||||
return $RET
|
||||
else
|
||||
eval $CMD $@
|
||||
return $?
|
||||
fi
|
||||
}
|
||||
|
||||
download() {
|
||||
if [ $# -lt 3 ]; then
|
||||
echo "Invalid parameters to download."
|
||||
return 1
|
||||
fi
|
||||
|
||||
NAME=$1
|
||||
shift
|
||||
|
||||
echo "$NAME..."
|
||||
|
||||
while [ $# -gt 1 ]; do
|
||||
URL=$1
|
||||
FILE=$2
|
||||
shift
|
||||
shift
|
||||
|
||||
if ! [ -f $FILE ]; then
|
||||
printf " Downloading $FILE... "
|
||||
|
||||
if [ -z $VERBOSE ]; then
|
||||
curl --silent --retry 10 -kLy 5 -o $FILE $URL
|
||||
RET=$?
|
||||
else
|
||||
curl --retry 10 -kLy 5 -o $FILE $URL
|
||||
RET=$?
|
||||
fi
|
||||
|
||||
if [ $RET -ne 0 ]; then
|
||||
echo "Failed!"
|
||||
else
|
||||
echo "Done."
|
||||
fi
|
||||
else
|
||||
echo " $FILE exists, skipping."
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $# -ne 0 ]; then
|
||||
echo "Missing parameter."
|
||||
fi
|
||||
}
|
||||
|
||||
real_pwd() {
|
||||
pwd | sed "s,/\(.\),\1:,"
|
||||
}
|
||||
|
||||
CMAKE_OPTS=""
|
||||
add_cmake_opts() {
|
||||
CMAKE_OPTS="$CMAKE_OPTS $@"
|
||||
}
|
||||
|
||||
RUNTIME_DLLS=""
|
||||
add_runtime_dlls() {
|
||||
RUNTIME_DLLS="$RUNTIME_DLLS $@"
|
||||
}
|
||||
|
||||
OSG_PLUGINS=""
|
||||
add_osg_dlls() {
|
||||
OSG_PLUGINS="$OSG_PLUGINS $@"
|
||||
}
|
||||
|
||||
if [ -z $PLATFORM ]; then
|
||||
PLATFORM=`uname -m`
|
||||
fi
|
||||
|
||||
if [ -z $CONFIGURATION ]; then
|
||||
CONFIGURATION="Debug"
|
||||
fi
|
||||
|
||||
case $VS_VERSION in
|
||||
14|2015 )
|
||||
GENERATOR="Visual Studio 14 2015"
|
||||
XP_TOOLSET="v140_xp"
|
||||
;;
|
||||
|
||||
# 12|2013|
|
||||
* )
|
||||
GENERATOR="Visual Studio 12 2013"
|
||||
XP_TOOLSET="v120_xp"
|
||||
;;
|
||||
esac
|
||||
|
||||
case $PLATFORM in
|
||||
x64|x86_64|x86-64|win64|Win64 )
|
||||
ARCHNAME=x86-64
|
||||
ARCHSUFFIX=64
|
||||
BITS=64
|
||||
|
||||
BASE_OPTS="-G\"$GENERATOR Win64\""
|
||||
add_cmake_opts "-G\"$GENERATOR Win64\""
|
||||
;;
|
||||
|
||||
x32|x86|i686|i386|win32|Win32 )
|
||||
ARCHNAME=x86
|
||||
ARCHSUFFIX=86
|
||||
BITS=32
|
||||
|
||||
BASE_OPTS="-G\"$GENERATOR\" -T$XP_TOOLSET"
|
||||
add_cmake_opts "-G\"$GENERATOR\"" -T$XP_TOOLSET
|
||||
;;
|
||||
|
||||
* )
|
||||
echo "Unknown platform $PLATFORM."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
case $CONFIGURATION in
|
||||
debug|Debug|DEBUG )
|
||||
CONFIGURATION=Debug
|
||||
;;
|
||||
|
||||
release|Release|RELEASE )
|
||||
CONFIGURATION=Release
|
||||
;;
|
||||
|
||||
relwithdebinfo|RelWithDebInfo|RELWITHDEBINFO )
|
||||
CONFIGURATION=RelWithDebInfo
|
||||
;;
|
||||
esac
|
||||
|
||||
echo
|
||||
echo "=========================="
|
||||
echo "Starting prebuild on win$BITS"
|
||||
echo "=========================="
|
||||
echo
|
||||
|
||||
mkdir -p deps
|
||||
cd deps
|
||||
|
||||
DEPS="`pwd`"
|
||||
|
||||
if [ -z $SKIP_DOWNLOAD ]; then
|
||||
echo "Downloading dependency packages."
|
||||
echo
|
||||
|
||||
# OpenAL
|
||||
download "OpenAL-Soft 1.16.0" \
|
||||
https://openal-soft.org/openal-binaries/openal-soft-1.16.0-bin.zip \
|
||||
OpenAL-Soft-1.16.0.zip
|
||||
|
||||
fi
|
||||
|
||||
cd .. #/..
|
||||
|
||||
# Set up dependencies
|
||||
if [ -z $KEEP ]; then
|
||||
echo
|
||||
printf "Preparing build directory... "
|
||||
|
||||
rm -rf Build_$BITS
|
||||
mkdir -p Build_$BITS/deps
|
||||
|
||||
echo Done.
|
||||
fi
|
||||
mkdir -p Build_$BITS/deps
|
||||
cd Build_$BITS/deps
|
||||
|
||||
DEPS_INSTALL=`pwd`
|
||||
cd $DEPS
|
||||
|
||||
echo
|
||||
echo "Extracting dependencies..."
|
||||
|
||||
# OpenAL
|
||||
printf "OpenAL-Soft 1.16.0... "
|
||||
{
|
||||
if [ -d openal-soft-1.16.0-bin ]; then
|
||||
printf "Exists. "
|
||||
elif [ -z $SKIP_EXTRACT ]; then
|
||||
rm -rf openal-soft-1.16.0-bin
|
||||
eval 7z x -y OpenAL-Soft-1.16.0.zip $STRIP
|
||||
fi
|
||||
|
||||
OPENAL_SDK="`real_pwd`/openal-soft-1.16.0-bin"
|
||||
|
||||
add_cmake_opts -DOPENAL_INCLUDE_DIR="$OPENAL_SDK/include/AL" \
|
||||
-DOPENAL_LIBRARY="$OPENAL_SDK/libs/Win$BITS/OpenAL32.lib"
|
||||
|
||||
echo Done.
|
||||
}
|
||||
|
||||
cd $DEPS_INSTALL/..
|
||||
|
||||
echo
|
||||
echo "Setting up WildMIDI build..."
|
||||
|
||||
if [ -z $VERBOSE ]; then
|
||||
printf " Configuring... "
|
||||
else
|
||||
echo " cmake .. $CMAKE_OPTS"
|
||||
fi
|
||||
|
||||
run_cmd cmake .. $CMAKE_OPTS
|
||||
RET=$?
|
||||
|
||||
if [ -z $VERBOSE ]; then
|
||||
if [ $RET -eq 0 ]; then echo Done.
|
||||
else echo Failed.; fi
|
||||
fi
|
||||
|
||||
echo
|
||||
|
||||
# NOTE: Disable this when/if we want to run test cases
|
||||
if [ -z $CI ]; then
|
||||
echo "Copying Runtime DLLs..."
|
||||
mkdir -p $CONFIGURATION
|
||||
for DLL in $RUNTIME_DLLS; do
|
||||
echo " `basename $DLL`."
|
||||
cp "$DLL" $CONFIGURATION/
|
||||
done
|
||||
|
||||
echo "Copying Runtime Resources/Config Files"
|
||||
|
||||
echo " wildmidi.cfg"
|
||||
cp $CONFIGURATION/../cfg/wildmidi.cfg $CONFIGURATION/wildmidi.cfg
|
||||
fi
|
||||
|
||||
exit $RET
|
59
external/wildmidi-0.4.5/CI/build.msvc.sh
vendored
Normal file
59
external/wildmidi-0.4.5/CI/build.msvc.sh
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -z $PLATFORM ]; then
|
||||
PLATFORM=`uname -m`
|
||||
fi
|
||||
|
||||
if [ -z $CONFIGURATION ]; then
|
||||
CONFIGURATION="Debug"
|
||||
fi
|
||||
|
||||
case $PLATFORM in
|
||||
x32|x86|i686|i386|win32|Win32 )
|
||||
BITS=32
|
||||
PLATFORM=Win32
|
||||
;;
|
||||
|
||||
x64|x86_64|x86-64|win64|Win64 )
|
||||
BITS=64
|
||||
PLATFORM=x64
|
||||
;;
|
||||
|
||||
* )
|
||||
echo "Unknown platform $PLATFORM."
|
||||
exit 1 ;;
|
||||
esac
|
||||
|
||||
if [ -z $APPVEYOR ]; then
|
||||
echo "Running $BITS-bit $CONFIGURATION build outside of Appveyor."
|
||||
|
||||
DIR=$(echo "$0" | sed "s,\\\\,/,g" | sed "s,\(.\):,/\\1,")
|
||||
cd $(dirname "$DIR")/..
|
||||
else
|
||||
echo "Running $BITS-bit $CONFIGURATION build in Appveyor."
|
||||
|
||||
cd $APPVEYOR_BUILD_FOLDER
|
||||
fi
|
||||
|
||||
cd build_$BITS
|
||||
|
||||
which msbuild > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
msbuild() {
|
||||
/c/Program\ Files\ \(x86\)/MSBuild/12.0/Bin/MSBuild.exe "$@"
|
||||
}
|
||||
fi
|
||||
|
||||
if [ -z $APPVEYOR ]; then
|
||||
msbuild WildMIDI.sln //t:Build //m:8
|
||||
else
|
||||
msbuild WildMIDI.sln //t:Build //m:8 //logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||
fi
|
||||
|
||||
RET=$?
|
||||
if [ $RET -eq 0 ] && [ ! -z $PACKAGE ]; then
|
||||
msbuild PACKAGE.vcxproj //t:Build //m:8
|
||||
RET=$?
|
||||
fi
|
||||
|
||||
exit $RET
|
280
external/wildmidi-0.4.5/CMakeLists.txt
vendored
Normal file
280
external/wildmidi-0.4.5/CMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,280 @@
|
|||
# ########## Project setup ##########
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
|
||||
PROJECT(wildmidi LANGUAGES C VERSION 0.4.5)
|
||||
|
||||
# WildMIDI Version
|
||||
SET(WILDMIDI_VERSION ${PROJECT_VERSION})
|
||||
|
||||
# Lib Versions
|
||||
SET(SOVERSION 2)
|
||||
SET(VERSION 2.1.0)
|
||||
|
||||
# Find Macros
|
||||
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
||||
|
||||
INCLUDE(CMakeDependentOption)
|
||||
INCLUDE(CheckCCompilerFlag)
|
||||
INCLUDE(CheckCSourceCompiles)
|
||||
INCLUDE(CheckIncludeFile)
|
||||
INCLUDE(GNUInstallDirs)
|
||||
INCLUDE(TestBigEndian)
|
||||
|
||||
# Set a default build type if none was specified
|
||||
IF (NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
|
||||
MESSAGE(STATUS "Setting build type to 'Debug' as none was specified.")
|
||||
SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
|
||||
# Set the possible values of build type for cmake-gui
|
||||
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
ENDIF ()
|
||||
SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_BUILD_TYPE}")
|
||||
MESSAGE(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
|
||||
|
||||
# Set our options
|
||||
OPTION(BUILD_SHARED_LIBS "Build a dynamic wildmidi library" ON)
|
||||
OPTION(WANT_PLAYER "Build WildMIDI player in addition to the libraries" ON)
|
||||
OPTION(WANT_STATIC "Build static library in addition to dynamic library" OFF)
|
||||
CMAKE_DEPENDENT_OPTION(WANT_PLAYERSTATIC "Build a statically linked WildMIDI player" ON "WANT_STATIC;WANT_PLAYER" OFF)
|
||||
OPTION(WANT_ALSA "Include ALSA (Advanced Linux Sound Architecture) support" OFF)
|
||||
OPTION(WANT_OSS "Include OSS (Open Sound System) support" OFF)
|
||||
OPTION(WANT_OPENAL "Include OpenAL (Cross Platform) support" OFF)
|
||||
OPTION(WANT_DEVTEST "Build WildMIDI DevTest file to check files" OFF)
|
||||
OPTION(WANT_OSX_DEPLOYMENT "OSX Deployment" OFF)
|
||||
IF (WIN32 AND MSVC)
|
||||
OPTION(WANT_MP_BUILD "Build with Multiple Processes (/MP)" OFF)
|
||||
ENDIF ()
|
||||
IF (UNIX AND NOT APPLE AND NOT RISCOS)
|
||||
SET(WILDMIDI_CFG "/etc/wildmidi/wildmidi.cfg" CACHE STRING "default config location")
|
||||
ELSE ()
|
||||
SET(WILDMIDI_CFG "wildmidi.cfg" CACHE STRING "default config location")
|
||||
ENDIF ()
|
||||
|
||||
IF ((NOT BUILD_SHARED_LIBS) AND (NOT WANT_STATIC))
|
||||
MESSAGE(FATAL_ERROR "Neither dynamic nor static library build is selected.")
|
||||
ENDIF ()
|
||||
|
||||
|
||||
# Platform specific defines
|
||||
IF (UNIX)
|
||||
# allow 'large' files in 32 bit builds
|
||||
ADD_DEFINITIONS(
|
||||
-D_LARGEFILE_SOURCE
|
||||
-D_FILE_OFFSET_BITS=64
|
||||
-D_LARGE_FILES
|
||||
)
|
||||
ENDIF (UNIX)
|
||||
|
||||
IF (OPENBSD) # Set RPATH for OpenBSD so WildMIDI can find libWildMidi.so
|
||||
# use, i.e. don't skip the full RPATH for the build tree
|
||||
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
|
||||
# when building, don't use the install RPATH already
|
||||
# (but later on when installing)
|
||||
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
|
||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
|
||||
# add the automatically determined parts of the RPATH
|
||||
# which point to directories outside the build tree to the install RPATH
|
||||
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
# the RPATH to be used when installing, but only if it's not a system directory
|
||||
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
|
||||
IF ("${isSystemDir}" STREQUAL "-1")
|
||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
ENDIF ()
|
||||
ENDIF (OPENBSD)
|
||||
|
||||
IF (WIN32)
|
||||
ADD_DEFINITIONS(
|
||||
-DNOMINMAX
|
||||
-DWIN32_LEAN_AND_MEAN
|
||||
-D_CRT_SECURE_NO_WARNINGS
|
||||
)
|
||||
ENDIF (WIN32)
|
||||
|
||||
# Compiler specific settings
|
||||
IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
||||
ADD_DEFINITIONS(
|
||||
-Wall -W
|
||||
-fno-common
|
||||
)
|
||||
|
||||
IF (NOT WIN32 AND NOT CYGWIN)
|
||||
SET(OLD_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||
SET(CMAKE_REQUIRED_FLAGS "${OLD_REQUIRED_FLAGS} -Werror")
|
||||
CHECK_C_SOURCE_COMPILES("int foo(void) __attribute__((visibility(\"default\")));
|
||||
int main(void) {return 0;}" HAVE_VISIBILITY_DEFAULT)
|
||||
IF (HAVE_VISIBILITY_DEFAULT)
|
||||
CHECK_C_COMPILER_FLAG(-fvisibility=hidden HAVE_VISIBILITY_HIDDEN)
|
||||
ENDIF ()
|
||||
SET(CMAKE_REQUIRED_FLAGS "${OLD_REQUIRED_FLAGS}")
|
||||
ENDIF ()
|
||||
|
||||
IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
ADD_DEFINITIONS(-ggdb3 -O0)
|
||||
ELSEIF (CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
ADD_DEFINITIONS(-O3)
|
||||
ENDIF (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
ENDIF ()
|
||||
|
||||
IF (CMAKE_C_COMPILER_ID MATCHES "SunPro")
|
||||
SET(OLD_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||
SET(CMAKE_REQUIRED_FLAGS "${OLD_REQUIRED_FLAGS} -xldscope=hidden")
|
||||
# __SUNPRO_C >= 0x590
|
||||
# CHECK_C_SOURCE_COMPILES("int foo(void) __attribute__((visibility(\"default\")));
|
||||
# int main(void) {return 0;}" HAVE_VISIBILITY_DEFAULT)
|
||||
# __SUNPRO_C >= 0x550
|
||||
CHECK_C_SOURCE_COMPILES("__global int foo(void);
|
||||
int main(void) {return 0;}" HAVE_LDSCOPE_GLOBAL)
|
||||
IF (HAVE_LDSCOPE_GLOBAL)# OR HAVE_VISIBILITY_DEFAULT
|
||||
SET(HAVE_LDSCOPE_HIDDEN 1)
|
||||
ENDIF ()
|
||||
SET(CMAKE_REQUIRED_FLAGS "${OLD_REQUIRED_FLAGS}")
|
||||
ENDIF ()
|
||||
|
||||
CHECK_C_SOURCE_COMPILES("int main(void) {__builtin_expect(0,0); return 0;}" HAVE___BUILTIN_EXPECT)
|
||||
|
||||
CHECK_C_SOURCE_COMPILES("static inline int static_foo() {return 0;}
|
||||
int main(void) {return 0;}" HAVE_C_INLINE)
|
||||
CHECK_C_SOURCE_COMPILES("static __inline__ int static_foo() {return 0;}
|
||||
int main(void) {return 0;}" HAVE_C___INLINE__)
|
||||
CHECK_C_SOURCE_COMPILES("static __inline int static_foo() {return 0;}
|
||||
int main(void) {return 0;}" HAVE_C___INLINE)
|
||||
|
||||
# we must not have any unresolved symbols:
|
||||
if (APPLE)
|
||||
SET(EXTRA_LDFLAGS "-Wl,-undefined,error")
|
||||
ELSE()
|
||||
SET(OLD_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||
SET(CMAKE_REQUIRED_FLAGS "${OLD_REQUIRED_FLAGS} -Wl,--no-undefined")
|
||||
CHECK_C_COMPILER_FLAG("" HAVE_NO_UNDEFINED)
|
||||
SET(CMAKE_REQUIRED_FLAGS "${OLD_REQUIRED_FLAGS}")
|
||||
IF (HAVE_NO_UNDEFINED)
|
||||
SET(EXTRA_LDFLAGS "-Wl,--no-undefined")
|
||||
ELSE()
|
||||
SET(EXTRA_LDFLAGS "")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
|
||||
CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
|
||||
|
||||
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
|
||||
|
||||
SET(AUDIODRV_ALSA)
|
||||
SET(AUDIODRV_OSS)
|
||||
SET(AUDIODRV_OPENAL)
|
||||
|
||||
# UNIX-like environments
|
||||
IF (UNIX AND NOT APPLE)
|
||||
|
||||
# Go looking for available sound packages for WildMIDI player
|
||||
IF (WANT_PLAYER)
|
||||
FIND_PACKAGE(ALSA)
|
||||
FIND_PACKAGE(OpenAL)
|
||||
FIND_PACKAGE(OSS)
|
||||
|
||||
# Set preferred output
|
||||
IF (WANT_ALSA)
|
||||
IF (NOT ALSA_FOUND)
|
||||
MESSAGE(FATAL_ERROR "ALSA required but not found.")
|
||||
ENDIF ()
|
||||
SET(AUDIODRV_ALSA 1)
|
||||
SET(AUDIO_LIBRARY ${ALSA_LIBRARY})
|
||||
|
||||
ELSEIF (WANT_OSS)
|
||||
IF (NOT OSS_FOUND)
|
||||
MESSAGE(FATAL_ERROR "OSS required but not found.")
|
||||
ENDIF ()
|
||||
# no special header paths
|
||||
SET(AUDIODRV_OSS 1)
|
||||
SET(AUDIO_LIBRARY ${OSS_LIBRARY})
|
||||
|
||||
ELSEIF (WANT_OPENAL)
|
||||
IF (NOT OPENAL_FOUND)
|
||||
MESSAGE(FATAL_ERROR "OpenAL required but not found.")
|
||||
ENDIF ()
|
||||
SET(AUDIODRV_OPENAL 1)
|
||||
SET(AUDIO_LIBRARY ${OPENAL_LIBRARY})
|
||||
|
||||
ELSE () # Try to auto-detect
|
||||
|
||||
IF (ALSA_FOUND)
|
||||
SET(AUDIO_LIBRARY ${ALSA_LIBRARY})
|
||||
SET(AUDIODRV_ALSA 1)
|
||||
|
||||
ELSEIF (OSS_FOUND)
|
||||
# no special header paths
|
||||
SET(AUDIO_LIBRARY ${OSS_LIBRARY})
|
||||
SET(AUDIODRV_OSS 1)
|
||||
|
||||
ELSEIF (OPENAL_FOUND)
|
||||
SET(AUDIO_LIBRARY ${OPENAL_LIBRARY})
|
||||
SET(AUDIODRV_OPENAL 1)
|
||||
|
||||
ELSE ()
|
||||
MESSAGE(WARNING "Could not find an audio sub-system!")
|
||||
SET(AUDIO_LIBRARY "")
|
||||
ENDIF ()
|
||||
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
||||
# find our math lib
|
||||
FIND_LIBRARY(M_LIBRARY m)
|
||||
MESSAGE(STATUS "M_LIBRARY: ${M_LIBRARY}")
|
||||
IF (NOT M_LIBRARY)
|
||||
SET(M_LIBRARY "")
|
||||
ENDIF ()
|
||||
ENDIF (UNIX AND NOT APPLE)
|
||||
|
||||
IF (APPLE AND WANT_PLAYER)
|
||||
FIND_PACKAGE(OpenAL)
|
||||
|
||||
IF (WANT_OPENAL)
|
||||
IF (NOT OPENAL_FOUND)
|
||||
MESSAGE(FATAL_ERROR "OpenAL required but not found.")
|
||||
ENDIF ()
|
||||
SET(AUDIO_LIBRARY ${OPENAL_LIBRARY})
|
||||
|
||||
ELSE ()
|
||||
IF (OPENAL_FOUND)
|
||||
SET(AUDIO_LIBRARY ${OPENAL_LIBRARY})
|
||||
SET(AUDIODRV_OPENAL 1)
|
||||
|
||||
ELSE ()
|
||||
MESSAGE(WARNING "Could not find an audio sub-system!")
|
||||
SET(AUDIO_LIBRARY "")
|
||||
ENDIF ()
|
||||
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
||||
# ######### General setup ##########
|
||||
INCLUDE_DIRECTORIES(BEFORE "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include")
|
||||
IF (NOT HAVE_STDINT_H) # AND NOT HAVE_INTTYPES_H
|
||||
INCLUDE_DIRECTORIES(BEFORE "${PROJECT_SOURCE_DIR}/include/stdint")
|
||||
ENDIF ()
|
||||
|
||||
IF (AMIGA OR AROS)
|
||||
SET(WILDMIDI_AMIGA 1)
|
||||
ENDIF ()
|
||||
|
||||
IF (APPLE)
|
||||
SET(APP_BUNDLE_NAME "${CMAKE_PROJECT_NAME}.app")
|
||||
SET(APP_BUNDLE_DIR "${wildmidi_BINARY_DIR}/${APP_BUNDLE_NAME}")
|
||||
IF (WANT_OSX_DEPLOYMENT)
|
||||
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
ENDIF ()
|
||||
ENDIF (APPLE)
|
||||
|
||||
IF (APPLE)
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${APP_BUNDLE_DIR}/Contents/MacOS")
|
||||
ELSE (APPLE)
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${wildmidi_BINARY_DIR}")
|
||||
ENDIF (APPLE)
|
||||
|
||||
# Setup up our config file
|
||||
CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/include/config.h.cmake" "${PROJECT_BINARY_DIR}/include/config.h")
|
||||
|
||||
ADD_SUBDIRECTORY(src)
|
4
external/wildmidi-0.4.5/COPYING
vendored
Normal file
4
external/wildmidi-0.4.5/COPYING
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
For the player see docs/license/GPLv3.txt
|
||||
|
||||
For the library see docs/license/LGPLv3.txt
|
||||
|
200
external/wildmidi-0.4.5/README.md
vendored
Normal file
200
external/wildmidi-0.4.5/README.md
vendored
Normal file
|
@ -0,0 +1,200 @@
|
|||
WildMIDI is a simple software midi player which has a core softsynth
|
||||
library that can be used in other applications.
|
||||
|
||||
The WildMIDI library uses Gravis Ultrasound patch files to convert MIDI
|
||||
files into audio which is then passed back to the calling application.
|
||||
The library API is designed so that it is easy to include WildMIDI into
|
||||
applications that wish to include MIDI file playback.
|
||||
|
||||
Version: 0.4.5
|
||||
Licenses: GPLv3+ and LGPLv3
|
||||
Website: http://www.mindwerks.net/projects/wildmidi
|
||||
|
||||
PLATFORMS:
|
||||
|
||||
* Linux: Arch, Debian, Fedora, Ubuntu (player: ALSA, OSS, OpenAL output)
|
||||
* Windows: x86 and x64
|
||||
* OSX: x86, x64 and powerpc (player: OpenAL output)
|
||||
* BSD: Debian, FreeBSD, NetBSD, OpenBSD. (player: OSS output)
|
||||
* kFreeBSD: Debian (player: OSS output)
|
||||
* Hurd: Debian
|
||||
* DOS (player: sound blaster or compatibles output.)
|
||||
* OS/2 (player: Dart output.)
|
||||
* AmigaOS & variants like MorphOS, AROS. (player: AHI output)
|
||||
|
||||
BUILD FROM SOURCE:
|
||||
|
||||
Requirements:
|
||||
* cmake
|
||||
* GCC or clang / Xcode / VisualStudio / MinGW or MinGW-w64
|
||||
* DOS port: DJGPP / GNU make
|
||||
* OS/2 port: OpenWatcom (tested with version 1.9)
|
||||
* Nintendo 3DS port: devkitARM
|
||||
* Nintendo Wii port: devkitPPC
|
||||
* Nintendo Switch port: devkitA64
|
||||
* PSVita port: Vitasdk
|
||||
|
||||
CHANGELOG
|
||||
|
||||
0.4.5
|
||||
* Fixed MUS drum channels 9 and 15 being swapped if the same file
|
||||
is played twice from the same memory buffer (bug #234).
|
||||
* Player: Fixed save midi reading wrong argv if there are no path
|
||||
seperators (bug #227).
|
||||
* Other code and build system clean-ups.
|
||||
|
||||
0.4.4
|
||||
* Fixed integer overflow in midi parser sample count calculation
|
||||
(bug #200).
|
||||
* Fixed 8 bit ping pong GUS patch loaders (bug #207).
|
||||
* Fixed wrong variable use in reverb code (bug #210).
|
||||
* Reset block status of tty after playback (bug #211).
|
||||
* Fixed broken file name handling for 'save as midi' command during
|
||||
playback.
|
||||
* Clamp MUS volume commands (PR #226).
|
||||
* CMake project improvements (bugs: #214, #216, #217, #218) - cmake
|
||||
version 3.1 or newer is now required.
|
||||
|
||||
0.4.3
|
||||
* New API addition: WildMidi_InitVIO(). It is like WildMidi_Init(),
|
||||
but tells the library to use caller-provided functions for file IO.
|
||||
See wildmidi_lib.h or the man page WildMidi_InitVIO(3) for details.
|
||||
This was suggested and implemented by Christian Breitwieser.
|
||||
* Fixed Visual Studio optimized builds (bug #192, function ptr issue.)
|
||||
* Fixed a thinko in one of the buffer size checks added in v0.4.2.
|
||||
* Fixed possible out of bounds reads in sysex commands (bug #190).
|
||||
* Fixed invalid reads during config parse with short patch file names.
|
||||
* Do not treat a missing end-of-track marker as an error for type-0
|
||||
midi files (bug #183).
|
||||
* Fixed bad reading of high delta values in XMI converter (bug #199).
|
||||
* Fixed a memory leak when freeing a midi (bug #204).
|
||||
* Fixed slurred/echoy playback at quick tempos on looped instruments
|
||||
(bug #185).
|
||||
* Fixed certain midis sounding different compared to timidity, as if
|
||||
instruments not turned off (bug #186).
|
||||
* Fixed compilation on systems without libm.
|
||||
* Support for RISC OS, Nintendo Switch and PS Vita.
|
||||
* Several clean-ups.
|
||||
|
||||
0.4.2
|
||||
* Fixed CVE-2017-11661, CVE-2017-11662, CVE-2017-11663, CVE-2017-11664
|
||||
(bug #175).
|
||||
* Fixed CVE-2017-1000418 (bug #178).
|
||||
* Fixed a buffer overflow during playback with malformed midi files
|
||||
(bug #180).
|
||||
* GUS patch processing changes to meet users expectations (bug #132).
|
||||
* Worked around a build failure with newer FreeBSD versions failing to
|
||||
retrieve the ONLCR constant (bug #171).
|
||||
* Fixed a minor Windows unicode issue (PR #170).
|
||||
* A few other fixes / clean-ups.
|
||||
|
||||
0.4.1
|
||||
* Fixed bug in handling of the "source" directive in config files.
|
||||
* Fixed a nasty bug in dBm_pan_volume. Other fixes and clean-ups.
|
||||
* Build system updates. Install a pkg-config file on supported platforms
|
||||
such as Linux. New android ndk makefile.
|
||||
* File i/o updates.
|
||||
* Support for OS/2.
|
||||
* Support for Nintendo 3DS
|
||||
* Support for Nintendo Wii
|
||||
* Support for AmigaOS and its variants like MorphOS and AROS.
|
||||
|
||||
0.4.0
|
||||
* API change: The library now returns audio data in host-endian format,
|
||||
not little-endian.
|
||||
* API change: WildMidi_GetVersion() added to the api, along with new
|
||||
numeric version macros in the wildmidi_lib.h header. the dso version
|
||||
is changed from 1 to 2.
|
||||
* API change: All long or unsigned long type _WM_Info fields changed
|
||||
into strictly 32bit fields (int32_t or uint32_t.)
|
||||
* API change: WildMidi_OpenBuffer() and WildMidi_GetOutput() changed
|
||||
to accept strictly 32bit size parameters, i.e. uint32_t, instead of
|
||||
unsigned long.
|
||||
* API change: WildMidi_ConvertToMidi() and WildMidi_ConvertBufferToMidi()
|
||||
added for MIDI-like files to be converted to MIDI.
|
||||
* API change: WildMidi_SetCvtOption() added to support conversion options.
|
||||
* API change: WildMidi_SongSeek() added to support Type 2 MIDI files.
|
||||
* API change: WildMidi_GetLyric() added to support embedded text,
|
||||
such as KAR files.
|
||||
* API change: WildMidi_GetError() and WildMidi_ClearError() added to
|
||||
cleanly check for, retrieve and clear error messages. They no longer
|
||||
go to stderr.
|
||||
* Support for loading XMI (XMIDI format) and XFM files, such as from Arena.
|
||||
Thanks Ryan Nunn for releasing his code under the LGPL.
|
||||
* Support for loading MUS (MUS Id format) files, such as from Doom.
|
||||
* Support for loading HMP/HMI files, such as from Daggerfall.
|
||||
* Support for loading KAR (MIDI with Lyrics) and Type 2 MIDI files.
|
||||
* Build requires cmake-2.8.11 or newer now.
|
||||
|
||||
0.3.9
|
||||
* Library: Fixed a segmentation fault with bad midi files.
|
||||
|
||||
0.3.8
|
||||
* Library: Fixed a seek-to-0 bug in order to cure an issue of truncated
|
||||
start (bug #100, gnome/gstreamer bug #694811.)
|
||||
* Player, OpenAL: reduced buffers from 8 to 4 so as to cure some output
|
||||
delay issues (bug #85.)
|
||||
|
||||
0.3.7
|
||||
* Plug a memory leak in case of broken midis.
|
||||
* Properly reset global state upon library shutdown.
|
||||
* Support for type-2 midi files.
|
||||
* Fix a possible crash in WildMidi_SetOption.
|
||||
* DOS port: Support for Sound Blaster output in player.
|
||||
* Uglify the library's private global variable and function names.
|
||||
* Build: Add option for a statically linked player.
|
||||
* Build: Add headers to project files. Use -fno-common flag.
|
||||
* Other small fixes/clean-ups.
|
||||
|
||||
0.3.6
|
||||
* Fix some portability issues.
|
||||
* Fix a double-free issue during library shutdown when several midis
|
||||
were alive.
|
||||
* Fix the invalid option checking in WildMidi_Init().
|
||||
* Fix the roundtempo option which had been broken since its invention
|
||||
in 0.2.3.5 (WM_MO_ROUNDTEMPO: was 0xA000 instead of 0x2000.)
|
||||
* Fix cfg files without a newline at the end weren't parsed correctly.
|
||||
* Handle cfg files with mac line-endings.
|
||||
* Refuse loading suspiciously long files.
|
||||
|
||||
0.3.5
|
||||
* Greatly reduced the heap usage (was a regression introduced in 0.2.3)
|
||||
* OpenAL support: Fixed audio output on big-endian systems. Fixed audio
|
||||
skips at song start.
|
||||
* OSS support: No longer uses mmap mode for better compatibility. This
|
||||
gains us NetBSD and OpenBSD support.
|
||||
* Worked around an invalid memory read found by valgrind when playing
|
||||
Beethoven's Fur Elise.rmi at 44100 Hz using the old MIDIA patch-set
|
||||
from 1994.
|
||||
* Build fixes for MSVC. Revised visibility attributes usage.
|
||||
|
||||
0.3.4
|
||||
* OpenAL support: This gains us OSX and other platforms that OpenAL
|
||||
supports for sound output!
|
||||
* DOS (DJGPP) support: This goes a long way to helping other DOS
|
||||
based applications.
|
||||
* MinGW support: This gains us win32 and win64 support using this
|
||||
toolchain.
|
||||
* OSS fixes.
|
||||
* Add missing parts of the absolute paths fix in config parsing.
|
||||
* New portable file and path-name system to handle cross-platform
|
||||
support.
|
||||
* Support for Debian/kFreeBSD, Debian/Hurd and other Debian archs.
|
||||
* Many bug fixes, code clean-ups and cosmetic fixes.
|
||||
|
||||
0.3.3
|
||||
* default to hidden visibility and only export our API functions
|
||||
* windows lean and mean to help compile times on Windows
|
||||
* cli and xcode work now on OSX
|
||||
* better FreeBSD support
|
||||
* Supported platforms are Debian, FreeBSD, Windows and OSX (but only
|
||||
for WAV output)
|
||||
|
||||
0.3.1 - 0.3.2
|
||||
* Cmake updates/fixes/cleanups.
|
||||
|
||||
0.3.0
|
||||
* initial CMake support.
|
||||
* process non-registered params. fix issue of notes ending before
|
||||
attack envelope completed. (sf.net svn r149/r151.)
|
||||
|
86
external/wildmidi-0.4.5/amiga/Makefile
vendored
Normal file
86
external/wildmidi-0.4.5/amiga/Makefile
vendored
Normal file
|
@ -0,0 +1,86 @@
|
|||
# GNU Makefile to build for AmigaOS variants using gcc
|
||||
#
|
||||
# make aros : build for i386-aros
|
||||
# make morphos : build for ppc-morphos
|
||||
# make amigaos : build for m68k-amigaos
|
||||
# make amigaos4 : build for ppc-amigaos4
|
||||
|
||||
# Set to 1 for debug build
|
||||
DEBUG = 0
|
||||
|
||||
# The tools
|
||||
ifeq ($(CROSS),)
|
||||
CC=gcc
|
||||
AS=as
|
||||
AR=ar
|
||||
RANLIB=ranlib
|
||||
else
|
||||
CC=$(CROSS)-gcc
|
||||
AS=$(CROSS)-as
|
||||
AR=$(CROSS)-ar
|
||||
RANLIB=$(CROSS)-ranlib
|
||||
endif
|
||||
|
||||
INCLUDE = -I. -I../include
|
||||
CFLAGS = $(INCLUDE) -Wall -W -fno-common
|
||||
ARFLAGS = cr
|
||||
LD = $(CC)
|
||||
LDFLAGS = -L. -lWildMidi
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
CFLAGS += -g
|
||||
else
|
||||
CFLAGS += -O2
|
||||
endif
|
||||
|
||||
ifeq ($(AROS),1)
|
||||
include gcc_aros.cfg
|
||||
endif
|
||||
ifeq ($(MORPHOS),1)
|
||||
include gcc_morphos.cfg
|
||||
endif
|
||||
ifeq ($(AOS3),1)
|
||||
include gcc_aos3.cfg
|
||||
endif
|
||||
ifeq ($(AOS4),1)
|
||||
include gcc_aos4.cfg
|
||||
endif
|
||||
|
||||
# Build rules
|
||||
%.o: %.c
|
||||
$(CC) -c $(CFLAGS) -o $@ $<
|
||||
%.o: ../src/%.c
|
||||
$(CC) -c $(CFLAGS) -o $@ $<
|
||||
|
||||
# Objects
|
||||
LIB_OBJ= wm_error.o file_io.o lock.o wildmidi_lib.o reverb.o gus_pat.o f_xmidi.o f_mus.o f_hmp.o f_midi.o f_hmi.o mus2mid.o xmi2mid.o internal_midi.o patches.o sample.o
|
||||
PLAYER_OBJ= getopt_long.o wm_tty.o amiga.o wildmidi.o
|
||||
|
||||
# Build targets
|
||||
.PHONY: clean distclean
|
||||
all: libWildMidi.a wildmidi
|
||||
|
||||
libWildMidi.a: $(LIB_OBJ)
|
||||
$(AR) $(ARFLAGS) $@ $^
|
||||
$(RANLIB) $@
|
||||
|
||||
wildmidi: libWildMidi.a $(PLAYER_OBJ)
|
||||
$(LD) -o $@ $(PLAYER_OBJ) $(LDFLAGS)
|
||||
|
||||
aros:
|
||||
@echo Building for i386-aros
|
||||
$(MAKE) AROS=1
|
||||
morphos:
|
||||
@echo Building for ppc-morphos
|
||||
$(MAKE) MORPHOS=1
|
||||
amigaos:
|
||||
@echo Building for m68k-amigaos
|
||||
$(MAKE) AOS3=1
|
||||
amigaos4:
|
||||
@echo Building for ppc-amigaos4
|
||||
$(MAKE) AOS4=1
|
||||
|
||||
clean:
|
||||
rm -rf $(LIB_OBJ) $(PLAYER_OBJ)
|
||||
distclean: clean
|
||||
rm -rf libWildMidi.a WildMidi.lib wildmidi
|
61
external/wildmidi-0.4.5/amiga/Makefile.vbcc
vendored
Normal file
61
external/wildmidi-0.4.5/amiga/Makefile.vbcc
vendored
Normal file
|
@ -0,0 +1,61 @@
|
|||
# GNU Makefile to build for AmigaOS variants using VBCC
|
||||
#
|
||||
# make amigaos : build for m68k-amigaos
|
||||
|
||||
# for now, only tested for m68k-amigaos:
|
||||
AOS3 := 1
|
||||
|
||||
# The tools
|
||||
CC=vc
|
||||
#MKLIB=join $(LIB_OBJ) as WildMidi.lib
|
||||
MKLIB=cat $(LIB_OBJ) > WildMidi.lib
|
||||
|
||||
INCLUDE = -I. -I../include
|
||||
CFLAGS = -O1 -speed -c99
|
||||
CFLAGS += $(INCLUDE)
|
||||
LDFLAGS = -L. -lWildMidi
|
||||
|
||||
ifeq ($(MORPHOS),1)
|
||||
include vbcc_morphos.cfg
|
||||
endif
|
||||
ifeq ($(AOS3),1)
|
||||
include vbcc_aos3.cfg
|
||||
endif
|
||||
ifeq ($(AOS4),1)
|
||||
include vbcc_aos4.cfg
|
||||
endif
|
||||
|
||||
# Build rules
|
||||
%.o: %.c
|
||||
$(CC) -c $(CFLAGS) -o $@ $<
|
||||
%.o: ../src/%.c
|
||||
$(CC) -c $(CFLAGS) -o $@ $<
|
||||
|
||||
# Objects
|
||||
LIB_OBJ= wm_error.o file_io.o lock.o wildmidi_lib.o reverb.o gus_pat.o f_xmidi.o f_mus.o f_hmp.o f_midi.o f_hmi.o mus2mid.o xmi2mid.o internal_midi.o patches.o sample.o
|
||||
PLAYER_OBJ= getopt_long.o wm_tty.o amiga.o wildmidi.o
|
||||
|
||||
# Build targets
|
||||
.PHONY: clean distclean
|
||||
all: WildMidi.lib wildmidi
|
||||
|
||||
WildMidi.lib: $(LIB_OBJ)
|
||||
$(MKLIB)
|
||||
|
||||
wildmidi: WildMidi.lib $(PLAYER_OBJ)
|
||||
$(CC) -o $@ $(PLAYER_OBJ) $(LDFLAGS)
|
||||
|
||||
amigaos:
|
||||
@echo Building for m68k-amigaos
|
||||
$(MAKE) -f Makefile.vbcc AOS3=1
|
||||
amigaos4:
|
||||
@echo Building for ppc-amigaos4
|
||||
$(MAKE) -f Makefile.vbcc AOS4=1
|
||||
morphos:
|
||||
@echo Building for ppc-morphos
|
||||
$(MAKE) -f Makefile.vbcc MORPHOS=1
|
||||
|
||||
clean:
|
||||
rm -rf $(LIB_OBJ) $(PLAYER_OBJ)
|
||||
distclean: clean
|
||||
rm -rf libWildMidi.a WildMidi.lib wildmidi
|
20
external/wildmidi-0.4.5/amiga/config.h
vendored
Normal file
20
external/wildmidi-0.4.5/amiga/config.h
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
/* wildmidi config for amigaos variants */
|
||||
#define WILDMIDI_AMIGA 1
|
||||
|
||||
#define WILDMIDI_CFG "wildmidi.cfg"
|
||||
|
||||
#define PACKAGE_URL "http://www.mindwerks.net/projects/wildmidi/"
|
||||
#define PACKAGE_BUGREPORT "https://github.com/Mindwerks/wildmidi/issues"
|
||||
|
||||
#define PACKAGE_VERSION "0.4.5"
|
||||
|
||||
#define HAVE_C_INLINE
|
||||
|
||||
#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR >= 96))
|
||||
#define HAVE___BUILTIN_EXPECT
|
||||
#endif
|
||||
#ifndef HAVE___BUILTIN_EXPECT
|
||||
#define __builtin_expect(x,c) x
|
||||
#endif
|
||||
|
||||
#define AUDIODRV_AHI 1 /* AHI output for player app */
|
14
external/wildmidi-0.4.5/amiga/gcc_aos3.cfg
vendored
Normal file
14
external/wildmidi-0.4.5/amiga/gcc_aos3.cfg
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
# makefile fragment for m68k-amigaos / gcc
|
||||
|
||||
#CRT_FLAGS = -mcrt=clib2
|
||||
CRT_FLAGS = -noixemul
|
||||
|
||||
CFLAGS += $(CRT_FLAGS)
|
||||
LDFLAGS+= $(CRT_FLAGS)
|
||||
|
||||
INCLUDE+= -I../include/stdint
|
||||
LDFLAGS+= -lm
|
||||
CFLAGS += -DWORDS_BIGENDIAN=1
|
||||
|
||||
# avoid conflicts between our stdint.h and ixemul sys/types.h
|
||||
CFLAGS += -D_ANSI_SOURCE
|
15
external/wildmidi-0.4.5/amiga/gcc_aos4.cfg
vendored
Normal file
15
external/wildmidi-0.4.5/amiga/gcc_aos4.cfg
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
# makefile fragment for ppc-amigaos4 / gcc
|
||||
|
||||
#CRT_FLAGS = -mcrt=clib2
|
||||
#CRT_FLAGS = -noixemul
|
||||
CRT_FLAGS = -mcrt=newlib
|
||||
|
||||
CFLAGS += $(CRT_FLAGS)
|
||||
LDFLAGS+= $(CRT_FLAGS)
|
||||
|
||||
LDFLAGS+= -lm
|
||||
CFLAGS += -DWORDS_BIGENDIAN=1
|
||||
|
||||
CFLAGS += -D__USE_INLINE__
|
||||
CFLAGS += -D__USE_OLD_TIMEVAL__
|
||||
|
2
external/wildmidi-0.4.5/amiga/gcc_aros.cfg
vendored
Normal file
2
external/wildmidi-0.4.5/amiga/gcc_aros.cfg
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# makefile fragment for i386-aros / gcc
|
||||
|
5
external/wildmidi-0.4.5/amiga/gcc_morphos.cfg
vendored
Normal file
5
external/wildmidi-0.4.5/amiga/gcc_morphos.cfg
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
# makefile fragment for ppc-morphos / gcc
|
||||
|
||||
LDFLAGS+= -noixemul
|
||||
CFLAGS += -noixemul
|
||||
CFLAGS += -DWORDS_BIGENDIAN=1
|
8
external/wildmidi-0.4.5/amiga/vbcc_aos3.cfg
vendored
Normal file
8
external/wildmidi-0.4.5/amiga/vbcc_aos3.cfg
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
# makefile fragment for m68k-amigaos / vbcc
|
||||
|
||||
LDFLAGS+= -lm881
|
||||
CFLAGS += -cpu=68020 -fpu=68881
|
||||
CFLAGS += -D__AMIGA__
|
||||
CFLAGS += -DWORDS_BIGENDIAN=1
|
||||
# bullshit -- until the code is adjusted
|
||||
CFLAGS += -D__FUNCTION__=__func__
|
1
external/wildmidi-0.4.5/android/.gitignore
vendored
Normal file
1
external/wildmidi-0.4.5/android/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
obj/
|
9
external/wildmidi-0.4.5/android/Android.mk
vendored
Normal file
9
external/wildmidi-0.4.5/android/Android.mk
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := WildMidi_shared
|
||||
LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libWildMidi.so
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/jni $(LOCAL_PATH)/../include
|
||||
TARGET_PLATFORM = android-10
|
||||
|
||||
include $(PREBUILT_SHARED_LIBRARY)
|
28
external/wildmidi-0.4.5/android/jni/Android.mk
vendored
Normal file
28
external/wildmidi-0.4.5/android/jni/Android.mk
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
LOCAL_PATH := $(call my-dir)/../..
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := WildMidi
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/android/jni $(LOCAL_PATH)/include
|
||||
LOCAL_ARM_MODE := arm
|
||||
LOCAL_CFLAGS += -DWILDMIDI_BUILD
|
||||
LOCAL_CFLAGS += -fvisibility=hidden -DSYM_VISIBILITY
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
src/f_hmi.c \
|
||||
src/f_hmp.c \
|
||||
src/f_midi.c \
|
||||
src/f_mus.c \
|
||||
src/f_xmidi.c \
|
||||
src/file_io.c \
|
||||
src/gus_pat.c \
|
||||
src/internal_midi.c \
|
||||
src/lock.c \
|
||||
src/mus2mid.c \
|
||||
src/patches.c \
|
||||
src/reverb.c \
|
||||
src/sample.c \
|
||||
src/wildmidi_lib.c \
|
||||
src/wm_error.c \
|
||||
src/xmi2mid.c
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
5
external/wildmidi-0.4.5/android/jni/Application.mk
vendored
Normal file
5
external/wildmidi-0.4.5/android/jni/Application.mk
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
APP_ABI := armeabi-v7a x86
|
||||
APP_MODULES := WildMidi
|
||||
APP_PLATFORM := android-10
|
||||
APP_OPTIM := release
|
||||
NDK_TOOLCHAIN_VERSION := 4.9
|
70
external/wildmidi-0.4.5/android/jni/config.h
vendored
Normal file
70
external/wildmidi-0.4.5/android/jni/config.h
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
/* config.h -- generated from config.h.cmake */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "wildmidi"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL "http://www.mindwerks.net/projects/wildmidi/"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "https://github.com/Mindwerks/wildmidi/issues"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "WildMidi"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "WildMidi 0.4.5"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "wildmidi"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "0.4.5"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.4.5"
|
||||
|
||||
/* Define this to the location of the wildmidi config file */
|
||||
/* #undef WILDMIDI_CFG "/etc/wildmidi/wildmidi.cfg" */
|
||||
|
||||
/* Define if the C compiler supports the `inline' keyword. */
|
||||
#define HAVE_C_INLINE
|
||||
/* Define if the C compiler supports the `__inline__' keyword. */
|
||||
#define HAVE_C___INLINE__
|
||||
/* Define if the C compiler supports the `__inline' keyword. */
|
||||
#define HAVE_C___INLINE
|
||||
#if !defined(HAVE_C_INLINE) && !defined(__cplusplus)
|
||||
# ifdef HAVE_C___INLINE__
|
||||
# define inline __inline__
|
||||
# elif defined(HAVE_C___INLINE)
|
||||
# define inline __inline
|
||||
# else
|
||||
# define inline
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Define if the compiler has the `__builtin_expect' built-in function */
|
||||
#define HAVE___BUILTIN_EXPECT
|
||||
#ifndef HAVE___BUILTIN_EXPECT
|
||||
#define __builtin_expect(x,c) x
|
||||
#endif
|
||||
|
||||
/* define this if you are running a bigendian system (motorola, sparc, etc) */
|
||||
/* #undef WORDS_BIGENDIAN */
|
||||
|
||||
/* define this if building for AmigaOS variants */
|
||||
/* #undef WILDMIDI_AMIGA */
|
||||
|
||||
/* Define if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H
|
||||
|
||||
/* Define if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H
|
||||
|
||||
/* Define our audio drivers */
|
||||
/* #undef HAVE_SYS_SOUNDCARD_H */
|
||||
|
||||
/* #undef AUDIODRV_ALSA */
|
||||
/* #undef AUDIODRV_OSS */
|
||||
/* #undef AUDIODRV_OPENAL */
|
||||
/* #undef AUDIODRV_AHI */
|
11
external/wildmidi-0.4.5/android/project.properties
vendored
Normal file
11
external/wildmidi-0.4.5/android/project.properties
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system use,
|
||||
# "ant.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
|
||||
# Project target.
|
||||
target=android-10
|
58
external/wildmidi-0.4.5/appveyor.yml
vendored
Normal file
58
external/wildmidi-0.4.5/appveyor.yml
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
version: "{build}"
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /wildmidi-.*$/
|
||||
- appveyor
|
||||
|
||||
platform:
|
||||
- Win32
|
||||
- x64
|
||||
|
||||
configuration: Debug
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
# For the Qt, Boost, CMake, etc installs
|
||||
os: unstable
|
||||
|
||||
# We want the git revision for versioning,
|
||||
# so shallow clones don't work.
|
||||
clone_depth: 1
|
||||
|
||||
#cache:
|
||||
# - C:\projects\wildmidi\deps\ffmpeg32-2.5.2.7z
|
||||
# - C:\projects\wildmidi\deps\ffmpeg32-2.5.2-dev.7z
|
||||
# - C:\projects\wildmidi\deps\ffmpeg64-2.5.2.7z
|
||||
# - C:\projects\wildmidi\deps\ffmpeg64-2.5.2-dev.7z
|
||||
|
||||
clone_folder: C:\projects\wildmidi
|
||||
|
||||
before_build:
|
||||
- cmd: sh %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh -u -p %PLATFORM%
|
||||
|
||||
build_script:
|
||||
- cmd: if %PLATFORM%==Win32 set build=Build_32
|
||||
- cmd: if %PLATFORM%==x64 set build=Build_64
|
||||
- cmd: msbuild %build%\WildMIDI.sln /t:Build /p:Configuration=%configuration% /m:2 /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||
|
||||
after_build:
|
||||
- cmd: if %PLATFORM%==Win32 7z a WildMIDI_x32.zip %APPVEYOR_BUILD_FOLDER%\Build_32\Debug\wildmidi*
|
||||
- cmd: if %PLATFORM%==x64 7z a WildMIDI_x64.zip %APPVEYOR_BUILD_FOLDER%\Build_64\Debug\wildmidi*
|
||||
|
||||
test: off
|
||||
|
||||
#notifications:
|
||||
# - provider: Email
|
||||
# to:
|
||||
# -
|
||||
# on_build_failure: true
|
||||
# on_build_status_changed: true
|
||||
|
||||
artifacts:
|
||||
- path: WildMIDI_x32.zip
|
||||
name: WildMIDI_x32
|
||||
- path: WildMIDI_x64.zip
|
||||
name: WildMIDI_x64
|
139
external/wildmidi-0.4.5/cfg/wildmidi.cfg
vendored
Normal file
139
external/wildmidi-0.4.5/cfg/wildmidi.cfg
vendored
Normal file
|
@ -0,0 +1,139 @@
|
|||
dir /usr/share/midi/freepats
|
||||
|
||||
# Automatically generated on Sun Feb 19 19:22:39 EST 2006
|
||||
# by http://freepats.opensrc.org/mkcfg.sh.txt
|
||||
|
||||
drumset 0
|
||||
|
||||
25 Drum_000/025_Snare_Roll.pat
|
||||
26 Drum_000/026_Snap.pat
|
||||
27 Drum_000/027_High_Q.pat
|
||||
31 Drum_000/031_Sticks.pat
|
||||
32 Drum_000/032_Square_Click.pat
|
||||
33 Drum_000/033_Metronome_Click.pat
|
||||
34 Drum_000/034_Metronome_Bell.pat
|
||||
35 Drum_000/035_Kick_1.pat amp=100
|
||||
36 Drum_000/036_Kick_2.pat amp=100
|
||||
37 Drum_000/037_Stick_Rim.pat
|
||||
38 Drum_000/038_Snare_1.pat
|
||||
39 Drum_000/039_Clap_Hand.pat amp=100
|
||||
40 Drum_000/040_Snare_2.pat
|
||||
41 Drum_000/041_Tom_Low_2.pat amp=100
|
||||
42 Drum_000/042_Hi-Hat_Closed.pat
|
||||
43 Drum_000/043_Tom_Low_1.pat amp=100
|
||||
44 Drum_000/044_Hi-Hat_Pedal.pat
|
||||
45 Drum_000/045_Tom_Mid_2.pat amp=100
|
||||
46 Drum_000/046_Hi-Hat_Open.pat
|
||||
47 Drum_000/047_Tom_Mid_1.pat amp=100
|
||||
48 Drum_000/048_Tom_High_2.pat amp=100
|
||||
49 Drum_000/049_Cymbal_Crash_1.pat
|
||||
50 Drum_000/050_Tom_High_1.pat amp=100
|
||||
51 Drum_000/051_Cymbal_Ride_1.pat
|
||||
52 Drum_000/052_Cymbal_Chinese.pat
|
||||
53 Drum_000/053_Cymbal_Ride_Bell.pat amp=100
|
||||
54 Drum_000/054_Tombourine.pat
|
||||
55 Drum_000/055_Cymbal_Splash.pat
|
||||
56 Drum_000/056_Cow_Bell.pat
|
||||
57 Drum_000/057_Cymbal_Crash_2.pat
|
||||
58 Drum_000/058_Vibra-Slap.pat
|
||||
59 Drum_000/059_Cymbal_Ride_2.pat
|
||||
60 Drum_000/060_Bongo_High.pat
|
||||
61 Drum_000/061_Bongo_Low.pat
|
||||
62 Drum_000/062_Conga_High_1_Mute.pat
|
||||
63 Drum_000/063_Conga_High_2_Open.pat
|
||||
64 Drum_000/064_Conga_Low.pat
|
||||
65 Drum_000/065_Timbale_High.pat
|
||||
66 Drum_000/066_Timbale_Low.pat
|
||||
67 Drum_000/067_Agogo_High.pat
|
||||
68 Drum_000/068_Agogo_Low.pat
|
||||
69 Drum_000/069_Cabasa.pat amp=100
|
||||
70 Drum_000/070_Maracas.pat
|
||||
71 Drum_000/071_Whistle_1_High_Short.pat
|
||||
72 Drum_000/072_Whistle_2_Low_Long.pat
|
||||
73 Drum_000/073_Guiro_1_Short.pat
|
||||
74 Drum_000/074_Guiro_2_Long.pat
|
||||
75 Drum_000/075_Claves.pat amp=100
|
||||
76 Drum_000/076_Wood_Block_1_High.pat
|
||||
77 Drum_000/077_Wood_Block_2_Low.pat
|
||||
78 Drum_000/078_Cuica_1_Mute.pat amp=100
|
||||
79 Drum_000/079_Cuica_2_Open.pat amp=100
|
||||
80 Drum_000/080_Triangle_1_Mute.pat
|
||||
81 Drum_000/081_Triangle_2_Open.pat
|
||||
82 Drum_000/082_Shaker.pat
|
||||
84 Drum_000/084_Belltree.pat
|
||||
|
||||
bank 0
|
||||
|
||||
0 Tone_000/000_Acoustic_Grand_Piano.pat amp=120 pan=center
|
||||
1 Tone_000/001_Acoustic_Brite_Piano.pat
|
||||
2 Tone_000/002_Electric_Grand_Piano.pat
|
||||
4 Tone_000/004_Electric_Piano_1_Rhodes.pat
|
||||
5 Tone_000/005_Electric_Piano_2_Chorused_Yamaha_DX.pat
|
||||
6 Tone_000/006_Harpsichord.pat
|
||||
7 Tone_000/007_Clavinet.pat
|
||||
8 Tone_000/008_Celesta.pat
|
||||
9 Tone_000/009_Glockenspiel.pat
|
||||
13 Tone_000/013_Xylophone.pat
|
||||
14 Tone_000/014_Tubular_Bells.pat
|
||||
15 Tone_000/015_Dulcimer.pat
|
||||
16 Tone_000/016_Hammond_Organ.pat
|
||||
19 Tone_000/019_Church_Organ.pat
|
||||
21 Tone_000/021_Accordion.pat
|
||||
23 Tone_000/023_Tango_Accordion.pat
|
||||
24 Tone_000/024_Nylon_Guitar.pat
|
||||
25 Tone_000/025_Steel_Guitar.pat
|
||||
26 Tone_000/026_Jazz_Guitar.pat
|
||||
27 Tone_000/027_Clean_Electric_Guitar.pat
|
||||
28 Tone_000/028_Muted_Electric_Guitar.pat
|
||||
29 Tone_000/029_Overdriven_Guitar.pat
|
||||
30 Tone_000/030_Distortion_Guitar.pat
|
||||
32 Tone_000/032_Acoustic_Bass.pat
|
||||
33 Tone_000/033_Finger_Bass.pat
|
||||
34 Tone_000/034_Pick_Bass.pat
|
||||
35 Tone_000/035_Fretless_Bass.pat
|
||||
36 Tone_000/036_Slap_Bass_1.pat
|
||||
37 Tone_000/037_Slap_Bass_2.pat
|
||||
38 Tone_000/038_Synth_Bass_1.pat
|
||||
40 Tone_000/040_Violin.pat
|
||||
42 Tone_000/042_Cello.pat
|
||||
44 Tone_000/044_Tremolo_Strings.pat
|
||||
45 Tone_000/045_Pizzicato_Strings.pat
|
||||
46 Tone_000/046_Harp.pat
|
||||
47 Tone_000/047_Timpani.pat
|
||||
48 Tone_000/048_String_Ensemble_1_Marcato.pat
|
||||
53 Tone_000/053_Voice_Oohs.pat
|
||||
56 Tone_000/056_Trumpet.pat
|
||||
57 Tone_000/057_Trombone.pat
|
||||
58 Tone_000/058_Tuba.pat
|
||||
59 Tone_000/059_Muted_Trumpet.pat
|
||||
60 Tone_000/060_French_Horn.pat
|
||||
61 Tone_000/061_Brass_Section.pat
|
||||
64 Tone_000/064_Soprano_Sax.pat
|
||||
65 Tone_000/065_Alto_Sax.pat
|
||||
66 Tone_000/066_Tenor_Sax.pat
|
||||
67 Tone_000/067_Baritone_Sax.pat
|
||||
68 Tone_000/068_Oboe.pat
|
||||
69 Tone_000/069_English_Horn.pat
|
||||
70 Tone_000/070_Bassoon.pat
|
||||
71 Tone_000/071_Clarinet.pat
|
||||
72 Tone_000/072_Piccolo.pat
|
||||
73 Tone_000/073_Flute.pat
|
||||
74 Tone_000/074_Recorder.pat
|
||||
75 Tone_000/075_Pan_Flute.pat
|
||||
76 Tone_000/076_Bottle_Blow.pat
|
||||
79 Tone_000/079_Ocarina.pat
|
||||
80 Tone_000/080_Square_Wave.pat
|
||||
84 Tone_000/084_Charang.pat
|
||||
88 Tone_000/088_New_Age.pat
|
||||
94 Tone_000/094_Halo_Pad.pat
|
||||
95 Tone_000/095_Sweep_Pad.pat
|
||||
98 Tone_000/098_Crystal.pat
|
||||
101 Tone_000/101_Goblins--Unicorn.pat
|
||||
102 Tone_000/102_Echo_Voice.pat
|
||||
104 Tone_000/104_Sitar.pat
|
||||
114 Tone_000/114_Steel_Drums.pat
|
||||
115 Tone_000/115_Wood_Block.pat
|
||||
120 Tone_000/120_Guitar_Fret_Noise.pat
|
||||
122 Tone_000/122_Seashore.pat
|
||||
125 Tone_000/125_Helicopter.pat
|
||||
|
56
external/wildmidi-0.4.5/cmake/FindOSS.cmake
vendored
Normal file
56
external/wildmidi-0.4.5/cmake/FindOSS.cmake
vendored
Normal file
|
@ -0,0 +1,56 @@
|
|||
# - Find OSS
|
||||
# Find OSS headers and libraries.
|
||||
#
|
||||
# OSS_INCLUDE_DIR - where to find soundcard.h, etc.
|
||||
# OSS_LIBRARY - link library, if any, needed for OSS.
|
||||
# OSS_FOUND - True if OSS found.
|
||||
|
||||
INCLUDE(CheckIncludeFiles)
|
||||
INCLUDE(CheckCSourceCompiles)
|
||||
|
||||
SET(OSS_LIBRARY "")
|
||||
SET(OSS_INCLUDE_DIR) # system header must suffice
|
||||
SET(OSS_FOUND)
|
||||
|
||||
MESSAGE(STATUS "Looking for OSS...")
|
||||
|
||||
CHECK_INCLUDE_FILES(sys/soundcard.h HAVE_SYS_SOUNDCARD_H)
|
||||
|
||||
# NetBSD uses ossaudio emulation layer,
|
||||
# otherwise no link library is needed.
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*") # AND HAVE_SOUNDCARD_H ???
|
||||
FIND_LIBRARY(OSSAUDIO_LIBRARIES "ossaudio")
|
||||
IF(OSSAUDIO_LIBRARIES STREQUAL "OSSAUDIO_LIBRARIES-NOTFOUND")
|
||||
SET(OSSAUDIO_LIBRARIES)
|
||||
ELSE()
|
||||
MESSAGE(STATUS "Found libossaudio: ${OSSAUDIO_LIBRARIES}")
|
||||
SET(OSS_LIBRARY ${OSSAUDIO_LIBRARIES})
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(OSSAUDIO_LIBRARIES)
|
||||
ENDIF()
|
||||
|
||||
SET(OLD_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
|
||||
IF(OSSAUDIO_LIBRARIES)
|
||||
SET(CMAKE_REQUIRED_LIBRARIES ${OSSAUDIO_LIBRARIES})
|
||||
ENDIF()
|
||||
|
||||
IF(HAVE_SYS_SOUNDCARD_H)
|
||||
CHECK_C_SOURCE_COMPILES("#include <sys/ioctl.h>
|
||||
#include <sys/soundcard.h>
|
||||
int main() {return SNDCTL_DSP_RESET;}" OSS_FOUND)
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_REQUIRED_LIBRARIES "${OLD_REQUIRED_LIBRARIES}")
|
||||
|
||||
MARK_AS_ADVANCED (
|
||||
OSS_FOUND
|
||||
OSS_INCLUDE_DIR
|
||||
OSS_LIBRARY
|
||||
)
|
||||
|
||||
IF(OSS_FOUND)
|
||||
MESSAGE(STATUS "Found OSS.")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "Could not find OSS.")
|
||||
ENDIF()
|
19
external/wildmidi-0.4.5/cmake/Toolchain-MinGW32.cmake
vendored
Normal file
19
external/wildmidi-0.4.5/cmake/Toolchain-MinGW32.cmake
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
# toolchain file I use to cross compile on Linux
|
||||
# targetting Windows (x86/mingw). running:
|
||||
# cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/Toolchain-MinGW32.cmake ....
|
||||
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
SET(CMAKE_C_COMPILER /usr/local/cross-win32/bin/i686-pc-mingw32-gcc)
|
||||
SET(CMAKE_CXX_COMPILER /usr/local/cross-win32/bin/i686-pc-mingw32-g++)
|
||||
SET(CMAKE_RC_COMPILER /usr/local/cross-win32/bin/i686-pc-mingw32-windres)
|
||||
|
||||
# where is the target environment
|
||||
SET(CMAKE_FIND_ROOT_PATH /usr/local/cross-win32)
|
||||
|
||||
# adjust the default behaviour of the FIND_XXX() commands:
|
||||
# search headers and libraries in the target environment, search
|
||||
# programs in the host environment
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
19
external/wildmidi-0.4.5/cmake/Toolchain-MinGW64.cmake
vendored
Normal file
19
external/wildmidi-0.4.5/cmake/Toolchain-MinGW64.cmake
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
# toolchain file I use to cross compile on Linux
|
||||
# targetting Windows (x64/mingw-w64). running:
|
||||
# cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/Toolchain-MinGW64.cmake ....
|
||||
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
SET(CMAKE_C_COMPILER /opt/cross_win64/bin/x86_64-w64-mingw32-gcc)
|
||||
SET(CMAKE_CXX_COMPILER /opt/cross_win64/bin/x86_64-w64-mingw32-g++)
|
||||
SET(CMAKE_RC_COMPILER /opt/cross_win64/bin/x86_64-w64-mingw32-windres)
|
||||
|
||||
# where is the target environment
|
||||
SET(CMAKE_FIND_ROOT_PATH /opt/cross_win64 /opt/cross_win64/x86_64-w64-mingw32)
|
||||
|
||||
# adjust the default behaviour of the FIND_XXX() commands:
|
||||
# search headers and libraries in the target environment, search
|
||||
# programs in the host environment
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
18
external/wildmidi-0.4.5/cmake/Toolchain-OSX-ppc.cmake
vendored
Normal file
18
external/wildmidi-0.4.5/cmake/Toolchain-OSX-ppc.cmake
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
# toolchain file I use to cross compile on Linux
|
||||
# targetting OSX/Darwin (powerpc). running:
|
||||
# cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/Toolchain-OSX-ppc.cmake ....
|
||||
|
||||
SET(CMAKE_SYSTEM_NAME Darwin)
|
||||
|
||||
SET(CMAKE_C_COMPILER /opt/cross_osx-ppc/bin/powerpc-apple-darwin9-gcc)
|
||||
SET(CMAKE_CXX_COMPILER /opt/cross_osx-ppc/bin/powerpc-apple-darwin9-g++)
|
||||
|
||||
# where is the target environment
|
||||
SET(CMAKE_FIND_ROOT_PATH /opt/cross_osx-ppc)
|
||||
|
||||
# adjust the default behaviour of the FIND_XXX() commands:
|
||||
# search headers and libraries in the target environment, search
|
||||
# programs in the host environment
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
18
external/wildmidi-0.4.5/cmake/Toolchain-OSX-x86.cmake
vendored
Normal file
18
external/wildmidi-0.4.5/cmake/Toolchain-OSX-x86.cmake
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
# toolchain file I use to cross compile on Linux
|
||||
# targetting OSX/Darwin (x86). running:
|
||||
# cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/Toolchain-OSX-x86.cmake ....
|
||||
|
||||
SET(CMAKE_SYSTEM_NAME Darwin)
|
||||
|
||||
SET(CMAKE_C_COMPILER /opt/cross_osx-x86/bin/i686-apple-darwin9-gcc)
|
||||
SET(CMAKE_CXX_COMPILER /opt/cross_osx-x86/bin/i686-apple-darwin9-g++)
|
||||
|
||||
# where is the target environment
|
||||
SET(CMAKE_FIND_ROOT_PATH /opt/cross_osx-x86)
|
||||
|
||||
# adjust the default behaviour of the FIND_XXX() commands:
|
||||
# search headers and libraries in the target environment, search
|
||||
# programs in the host environment
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
18
external/wildmidi-0.4.5/cmake/Toolchain-OSX-x86_64.cmake
vendored
Normal file
18
external/wildmidi-0.4.5/cmake/Toolchain-OSX-x86_64.cmake
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
# toolchain file I use to cross compile on Linux
|
||||
# targetting OSX/Darwin (x86_64). running:
|
||||
# cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/Toolchain-OSX-x86_64.cmake ....
|
||||
|
||||
SET(CMAKE_SYSTEM_NAME Darwin)
|
||||
|
||||
SET(CMAKE_C_COMPILER /opt/cross_osx-x86_64/usr/bin/x86_64-apple-darwin9-gcc)
|
||||
SET(CMAKE_CXX_COMPILER /opt/cross_osx-x86_64/usr/bin/x86_64-apple-darwin9-g++)
|
||||
|
||||
# where is the target environment
|
||||
SET(CMAKE_FIND_ROOT_PATH /opt/cross_osx-x86_64)
|
||||
|
||||
# adjust the default behaviour of the FIND_XXX() commands:
|
||||
# search headers and libraries in the target environment, search
|
||||
# programs in the host environment
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
83
external/wildmidi-0.4.5/djgpp/Makefile
vendored
Normal file
83
external/wildmidi-0.4.5/djgpp/Makefile
vendored
Normal file
|
@ -0,0 +1,83 @@
|
|||
#------------------------------------------------------------------------------#
|
||||
# Makefile for building WildMidi library and player for DOS.
|
||||
# You will need a DJGPP build environment and GNU make to do it painlessly.
|
||||
# To build natively on DOS, you need long file names support (e.g. doslfn.)
|
||||
#------------------------------------------------------------------------------#
|
||||
|
||||
# Set to 1 for debug build
|
||||
DEBUG = 0
|
||||
|
||||
# DXE3 version of the library requires DJGPP-2.05 or newer.
|
||||
# Set to 0 if dont want to build / use a DXE3 version of the library.
|
||||
USE_DXE = 1
|
||||
|
||||
# The tools
|
||||
ifeq ($(CROSS),)
|
||||
CC=gcc
|
||||
AS=as
|
||||
AR=ar
|
||||
RANLIB=ranlib
|
||||
else
|
||||
CC=$(CROSS)-gcc
|
||||
AS=$(CROSS)-as
|
||||
AR=$(CROSS)-ar
|
||||
RANLIB=$(CROSS)-ranlib
|
||||
endif
|
||||
DXE3GEN=dxe3gen
|
||||
|
||||
INCLUDE = -I. -I../include/stdint -I../include
|
||||
CFLAGS = $(INCLUDE) -Wall -W -fno-common
|
||||
ARFLAGS = cr
|
||||
|
||||
# SB output support (comment out if not wanted)
|
||||
CFLAGS+= -DAUDIODRV_DOSSB
|
||||
SB_OBJ = dosirq.o dosdma.o dossb.o
|
||||
|
||||
LD = $(CC)
|
||||
ifneq ($(USE_DXE),1)
|
||||
WM_LINK = WildMidi
|
||||
else
|
||||
WM_LINK = WildMidi_dxe
|
||||
endif
|
||||
LDFLAGS = -L. -l$(WM_LINK)
|
||||
|
||||
# build for pentium and newer (comment out if not wanted)
|
||||
CFLAGS += -march=i586
|
||||
ifeq ($(DEBUG),1)
|
||||
CFLAGS += -g
|
||||
else
|
||||
CFLAGS += -O2 -fomit-frame-pointer -ffast-math
|
||||
endif
|
||||
|
||||
# Build rules
|
||||
%.o: %.c
|
||||
$(CC) -c $(CFLAGS) -o $@ $<
|
||||
%.o: ../src/%.c
|
||||
$(CC) -c $(CFLAGS) -o $@ $<
|
||||
|
||||
# Objects
|
||||
LIB_OBJ= wm_error.o file_io.o lock.o wildmidi_lib.o reverb.o gus_pat.o f_xmidi.o f_mus.o f_hmp.o f_midi.o f_hmi.o mus2mid.o xmi2mid.o internal_midi.o patches.o sample.o
|
||||
PLAYER_OBJ= $(SB_OBJ) getopt_long.o wm_tty.o wildmidi.o
|
||||
|
||||
# Build targets
|
||||
TARGETS = libWildMidi.a wildmidi.exe libWildMidi_dxe.a wildmidi.dxe
|
||||
|
||||
.PHONY: clean distclean
|
||||
all: $(TARGETS)
|
||||
|
||||
libWildMidi.a: $(LIB_OBJ)
|
||||
$(AR) $(ARFLAGS) $@ $^
|
||||
$(RANLIB) $@
|
||||
|
||||
libWildMidi_dxe.a: wildmidi.dxe
|
||||
wildmidi.dxe: $(LIB_OBJ)
|
||||
-$(DXE3GEN) -Y libWildMidi_dxe.a -o $@ -E _WildMidi_ -U $^
|
||||
|
||||
wildmidi.exe: lib$(WM_LINK).a $(PLAYER_OBJ)
|
||||
$(LD) -o $@ $(PLAYER_OBJ) $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
rm -rf $(LIB_OBJ) $(PLAYER_OBJ)
|
||||
distclean: clean
|
||||
rm -rf $(TARGETS)
|
||||
|
31
external/wildmidi-0.4.5/djgpp/README
vendored
Normal file
31
external/wildmidi-0.4.5/djgpp/README
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
This directory contains the Makefile and config.h needed to compile
|
||||
libWilMidi library and wildmidi player for DOS using DJGPP.
|
||||
|
||||
|
||||
To compile, you need DJGPP library and its associated compiler suite.
|
||||
Both djgpp-v2.03 and v2.05 should work. DJGPP is available from its
|
||||
official site at <http://www.delorie.com/djgpp/>
|
||||
Cd in to the djgpp directory and run 'make', i.e.:
|
||||
|
||||
cd djgpp
|
||||
make
|
||||
|
||||
.. which will generate libWildMidi.a and wildmidi.exe. If necessary,
|
||||
edit the Makefile to meet your needs/environment.
|
||||
|
||||
|
||||
The player (wildmidi.exe) can either output to a Sound Blaster (SB1,
|
||||
SB2, SBPro, SB16, or compatible) hardware:
|
||||
|
||||
wildmidi mymidi.mid
|
||||
|
||||
... or, it can generate a wav file:
|
||||
|
||||
wildmidi -o output.wav mymidi.mid
|
||||
|
||||
Use -r <SampleRate> to specify a sample rate, use -c <ConfigFile> to
|
||||
point to your wildmidi.cfg config file:
|
||||
|
||||
wildmidi -c c:\wildmidi.cfg -r 22050 mymidi.mid
|
||||
|
||||
Run "wildmidi -h" to see other command line switches.
|
17
external/wildmidi-0.4.5/djgpp/config.h
vendored
Normal file
17
external/wildmidi-0.4.5/djgpp/config.h
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
#define WILDMIDI_CFG "wildmidi.cfg"
|
||||
|
||||
#define PACKAGE_URL "http://www.mindwerks.net/projects/wildmidi/"
|
||||
#define PACKAGE_BUGREPORT "https://github.com/Mindwerks/wildmidi/issues"
|
||||
|
||||
#define PACKAGE_VERSION "0.4.5"
|
||||
|
||||
#define HAVE_C_INLINE
|
||||
|
||||
#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR >= 96)
|
||||
#define HAVE___BUILTIN_EXPECT
|
||||
#endif
|
||||
#ifndef HAVE___BUILTIN_EXPECT
|
||||
#define __builtin_expect(x,c) x
|
||||
#endif
|
||||
|
||||
#define WM_NO_LOCK 1 /* don't need locking in MSDOS */
|
213
external/wildmidi-0.4.5/djgpp/dosdma.c
vendored
Normal file
213
external/wildmidi-0.4.5/djgpp/dosdma.c
vendored
Normal file
|
@ -0,0 +1,213 @@
|
|||
/* Implementation of DMA routines on DOS - from libMikMod.
|
||||
Copyright (C) 1999 by Andrew Zabolotny, <bit@eltech.ru>
|
||||
|
||||
This file is part of WildMIDI.
|
||||
|
||||
WildMIDI is free software: you can redistribute and/or modify the player
|
||||
under the terms of the GNU General Public License and you can redistribute
|
||||
and/or modify the library under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation, either version 3 of
|
||||
the licenses, or(at your option) any later version.
|
||||
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License and the
|
||||
GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "dosdma.h"
|
||||
|
||||
#include <go32.h> /* includes sys/version.h (djgpp >= 2.02) */
|
||||
#include <dos.h>
|
||||
#include <dpmi.h>
|
||||
#include <sys/nearptr.h>
|
||||
#include <malloc.h>
|
||||
|
||||
/* BUG WARNING: there is an error in DJGPP libraries <= 2.01:
|
||||
* src/libc/dpmi/api/d0102.s loads the selector and allocsize
|
||||
* arguments in the wrong order. DJGPP >= 2.02 have it fixed. */
|
||||
#if !defined(__DJGPP_MINOR__) || (__DJGPP_MINOR__-0 < 2)
|
||||
#warning __dpmi_resize_dos_memory() from DJGPP <= 2.01 is broken!
|
||||
#endif
|
||||
|
||||
__dma_regs dma[8] = {
|
||||
/* *INDENT-OFF* */
|
||||
{DMA_ADDR_0, DMA_PAGE_0, DMA_SIZE_0,
|
||||
DMA1_MASK_REG, DMA1_CLEAR_FF_REG, DMA1_MODE_REG},
|
||||
{DMA_ADDR_1, DMA_PAGE_1, DMA_SIZE_1,
|
||||
DMA1_MASK_REG, DMA1_CLEAR_FF_REG, DMA1_MODE_REG},
|
||||
|
||||
{DMA_ADDR_2, DMA_PAGE_2, DMA_SIZE_2,
|
||||
DMA1_MASK_REG, DMA1_CLEAR_FF_REG, DMA1_MODE_REG},
|
||||
{DMA_ADDR_3, DMA_PAGE_3, DMA_SIZE_3,
|
||||
DMA1_MASK_REG, DMA1_CLEAR_FF_REG, DMA1_MODE_REG},
|
||||
|
||||
{DMA_ADDR_4, 0, DMA_SIZE_4,
|
||||
DMA2_MASK_REG, DMA2_CLEAR_FF_REG, DMA2_MODE_REG},
|
||||
{DMA_ADDR_5, DMA_PAGE_5, DMA_SIZE_5,
|
||||
DMA2_MASK_REG, DMA2_CLEAR_FF_REG, DMA2_MODE_REG},
|
||||
|
||||
{DMA_ADDR_6, DMA_PAGE_6, DMA_SIZE_6,
|
||||
DMA2_MASK_REG, DMA2_CLEAR_FF_REG, DMA2_MODE_REG},
|
||||
{DMA_ADDR_7, DMA_PAGE_7, DMA_SIZE_7,
|
||||
DMA2_MASK_REG, DMA2_CLEAR_FF_REG, DMA2_MODE_REG}
|
||||
/* *INDENT-ON* */
|
||||
};
|
||||
|
||||
static int __initialized = 0;
|
||||
static int __buffer_count = 0;
|
||||
static __dpmi_meminfo __locked_data;
|
||||
|
||||
int dma_initialize()
|
||||
{
|
||||
if (!__djgpp_nearptr_enable())
|
||||
return 0;
|
||||
|
||||
/* Trick: Avoid re-setting DS selector limit on each memory allocation
|
||||
call */
|
||||
__djgpp_selector_limit = 0xffffffff;
|
||||
|
||||
__locked_data.address = __djgpp_base_address + (unsigned long)dma;
|
||||
__locked_data.size = sizeof(dma);
|
||||
if (__dpmi_lock_linear_region(&__locked_data))
|
||||
return 0;
|
||||
|
||||
return (__initialized = 1);
|
||||
}
|
||||
|
||||
void dma_finalize()
|
||||
{
|
||||
if (!__initialized)
|
||||
return;
|
||||
__dpmi_unlock_linear_region(&__locked_data);
|
||||
__djgpp_nearptr_disable();
|
||||
}
|
||||
|
||||
dma_buffer *dma_allocate(unsigned int channel, unsigned int size)
|
||||
{
|
||||
int parsize = (size + 15) >> 4; /* size in paragraphs */
|
||||
int par = 0; /* Real-mode paragraph */
|
||||
int selector = 0; /* Protected-mode selector */
|
||||
int mask = channel <= 3 ? 0xfff : 0x1fff; /* Alignment mask in para. */
|
||||
int allocsize = parsize; /* Allocated size in paragraphs */
|
||||
int count; /* Try count */
|
||||
int bound = 0; /* Nearest bound address */
|
||||
int maxsize; /* Maximal possible block size */
|
||||
dma_buffer *buffer = NULL;
|
||||
__dpmi_meminfo buff_info, struct_info;
|
||||
|
||||
if (!dma_initialize())
|
||||
return NULL;
|
||||
|
||||
/* Loop until we'll get a properly aligned memory block */
|
||||
for (count = 8; count; count--) {
|
||||
int resize = (selector != 0);
|
||||
|
||||
/* Try first to resize (possibly previously) allocated block */
|
||||
if (resize) {
|
||||
maxsize = (bound + parsize) - par;
|
||||
if (maxsize > parsize * 2)
|
||||
maxsize = parsize * 2;
|
||||
if (maxsize == allocsize)
|
||||
resize = 0;
|
||||
else {
|
||||
allocsize = maxsize;
|
||||
if (__dpmi_resize_dos_memory(selector, allocsize, &maxsize) !=
|
||||
0) resize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!resize) {
|
||||
if (selector)
|
||||
__dpmi_free_dos_memory(selector), selector = 0;
|
||||
par = __dpmi_allocate_dos_memory(allocsize, &selector);
|
||||
}
|
||||
|
||||
if ((par == 0) || (par == -1))
|
||||
goto exit;
|
||||
|
||||
/* If memory block contains a properly aligned portion, quit loop */
|
||||
bound = (par + mask + 1) & ~mask;
|
||||
if (par + parsize <= bound)
|
||||
break;
|
||||
if (bound + parsize <= par + allocsize) {
|
||||
par = bound;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!count) {
|
||||
__dpmi_free_dos_memory(selector);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
buffer = (dma_buffer *) malloc(sizeof(dma_buffer));
|
||||
buffer->linear = (unsigned char *)(__djgpp_conventional_base + bound * 16);
|
||||
buffer->physical = bound * 16;
|
||||
buffer->size = parsize * 16;
|
||||
buffer->selector = selector;
|
||||
buffer->channel = channel;
|
||||
|
||||
buff_info.address = buffer->physical;
|
||||
buff_info.size = buffer->size;
|
||||
/*
|
||||
Don't pay attention to return code since under plain DOS it often
|
||||
returns error (at least under HIMEM/CWSDPMI and EMM386/DPMI)
|
||||
*/
|
||||
__dpmi_lock_linear_region(&buff_info);
|
||||
|
||||
/* Lock the DMA buffer control structure as well */
|
||||
struct_info.address = __djgpp_base_address + (unsigned long)buffer;
|
||||
struct_info.size = sizeof(dma_buffer);
|
||||
if (__dpmi_lock_linear_region(&struct_info)) {
|
||||
__dpmi_unlock_linear_region(&buff_info);
|
||||
__dpmi_free_dos_memory(selector);
|
||||
free(buffer);
|
||||
buffer = NULL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
exit:
|
||||
if (buffer)
|
||||
__buffer_count++;
|
||||
else if (--__buffer_count == 0)
|
||||
dma_finalize();
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void dma_free(dma_buffer * buffer)
|
||||
{
|
||||
__dpmi_meminfo buff_info;
|
||||
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
buff_info.address = buffer->physical;
|
||||
buff_info.size = buffer->size;
|
||||
__dpmi_unlock_linear_region(&buff_info);
|
||||
|
||||
__dpmi_free_dos_memory(buffer->selector);
|
||||
free(buffer);
|
||||
|
||||
if (--__buffer_count == 0)
|
||||
dma_finalize();
|
||||
}
|
||||
|
||||
void dma_start(dma_buffer * buffer, unsigned long count, unsigned char mode)
|
||||
{
|
||||
/* Disable interrupts */
|
||||
int old_ints = disable();
|
||||
dma_disable(buffer->channel);
|
||||
dma_set_mode(buffer->channel, mode);
|
||||
dma_clear_ff(buffer->channel);
|
||||
dma_set_addr(buffer->channel, buffer->physical);
|
||||
dma_clear_ff(buffer->channel);
|
||||
dma_set_count(buffer->channel, count);
|
||||
dma_enable(buffer->channel);
|
||||
/* Re-enable interrupts */
|
||||
if (old_ints)
|
||||
enable();
|
||||
}
|
190
external/wildmidi-0.4.5/djgpp/dosdma.h
vendored
Normal file
190
external/wildmidi-0.4.5/djgpp/dosdma.h
vendored
Normal file
|
@ -0,0 +1,190 @@
|
|||
/* Interface for DMA routines on DOS -- from libMikMod.
|
||||
Copyright (C) 1999 by Andrew Zabolotny, <bit@eltech.ru>
|
||||
|
||||
This file is part of WildMIDI.
|
||||
|
||||
WildMIDI is free software: you can redistribute and/or modify the player
|
||||
under the terms of the GNU General Public License and you can redistribute
|
||||
and/or modify the library under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation, either version 3 of
|
||||
the licenses, or(at your option) any later version.
|
||||
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License and the
|
||||
GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __DOSDMA_H__
|
||||
#define __DOSDMA_H__
|
||||
|
||||
#include <pc.h>
|
||||
|
||||
#define DMA1_BASE 0x00 /* 8 bit slave DMA, channels 0..3 */
|
||||
#define DMA2_BASE 0xC0 /* 16 bit master DMA, ch 4(=slave input)..7 */
|
||||
|
||||
#define DMA1_CMD_REG 0x08 /* command register (w) */
|
||||
#define DMA1_STAT_REG 0x08 /* status register (r) */
|
||||
#define DMA1_REQ_REG 0x09 /* request register (w) */
|
||||
#define DMA1_MASK_REG 0x0A /* single-channel mask (w) */
|
||||
#define DMA1_MODE_REG 0x0B /* mode register (w) */
|
||||
#define DMA1_CLEAR_FF_REG 0x0C /* clear pointer flip-flop (w) */
|
||||
#define DMA1_TEMP_REG 0x0D /* Temporary Register (r) */
|
||||
#define DMA1_RESET_REG 0x0D /* Master Clear (w) */
|
||||
#define DMA1_CLR_MASK_REG 0x0E /* Clear Mask */
|
||||
#define DMA1_MASK_ALL_REG 0x0F /* all-channels mask (w) */
|
||||
|
||||
#define DMA2_CMD_REG 0xD0 /* command register (w) */
|
||||
#define DMA2_STAT_REG 0xD0 /* status register (r) */
|
||||
#define DMA2_REQ_REG 0xD2 /* request register (w) */
|
||||
#define DMA2_MASK_REG 0xD4 /* single-channel mask (w) */
|
||||
#define DMA2_MODE_REG 0xD6 /* mode register (w) */
|
||||
#define DMA2_CLEAR_FF_REG 0xD8 /* clear pointer flip-flop (w) */
|
||||
#define DMA2_TEMP_REG 0xDA /* Temporary Register (r) */
|
||||
#define DMA2_RESET_REG 0xDA /* Master Clear (w) */
|
||||
#define DMA2_CLR_MASK_REG 0xDC /* Clear Mask */
|
||||
#define DMA2_MASK_ALL_REG 0xDE /* all-channels mask (w) */
|
||||
|
||||
#define DMA_ADDR_0 0x00 /* DMA address registers */
|
||||
#define DMA_ADDR_1 0x02
|
||||
#define DMA_ADDR_2 0x04
|
||||
#define DMA_ADDR_3 0x06
|
||||
#define DMA_ADDR_4 0xC0
|
||||
#define DMA_ADDR_5 0xC4
|
||||
#define DMA_ADDR_6 0xC8
|
||||
#define DMA_ADDR_7 0xCC
|
||||
|
||||
#define DMA_SIZE_0 0x01 /* DMA transfer size registers */
|
||||
#define DMA_SIZE_1 0x03
|
||||
#define DMA_SIZE_2 0x05
|
||||
#define DMA_SIZE_3 0x07
|
||||
#define DMA_SIZE_4 0xC2
|
||||
#define DMA_SIZE_5 0xC6
|
||||
#define DMA_SIZE_6 0xCA
|
||||
#define DMA_SIZE_7 0xCE
|
||||
|
||||
#define DMA_PAGE_0 0x87 /* DMA page registers */
|
||||
#define DMA_PAGE_1 0x83
|
||||
#define DMA_PAGE_2 0x81
|
||||
#define DMA_PAGE_3 0x82
|
||||
#define DMA_PAGE_5 0x8B
|
||||
#define DMA_PAGE_6 0x89
|
||||
#define DMA_PAGE_7 0x8A
|
||||
|
||||
#define DMA_MODE_AUTOINIT 0x10 /* Auto-init mode bit */
|
||||
#define DMA_MODE_READ 0x44 /* I/O to memory, no autoinit, increment, single mode */
|
||||
#define DMA_MODE_WRITE 0x48 /* memory to I/O, no autoinit, increment, single mode */
|
||||
#define DMA_MODE_CASCADE 0xC0 /* pass thru DREQ->HRQ, DACK<-HLDA only */
|
||||
|
||||
/* Indexable specific DMA registers */
|
||||
typedef struct __dma_regs_s {
|
||||
unsigned char addr; /* DMA transfer address register */
|
||||
unsigned char page; /* DMA page register */
|
||||
unsigned char size; /* DMA transfer size register */
|
||||
unsigned char mask; /* DMA mask/unmask register */
|
||||
unsigned char flip; /* DMA flip-flop reset register */
|
||||
unsigned char mode; /* DMA mode register */
|
||||
} __dma_regs;
|
||||
|
||||
extern __dma_regs dma[8];
|
||||
|
||||
/* Enable a specific DMA channel */
|
||||
static inline void dma_enable(unsigned int channel)
|
||||
{
|
||||
outportb(dma[channel].mask, channel & 3);
|
||||
}
|
||||
|
||||
/* Disable a specific DMA channel */
|
||||
static inline void dma_disable(unsigned int channel)
|
||||
{
|
||||
outportb(dma[channel].mask, (channel & 3) | 0x04);
|
||||
}
|
||||
|
||||
/* Clear the 'DMA Flip Flop' flag */
|
||||
static inline void dma_clear_ff(unsigned int channel)
|
||||
{
|
||||
outportb(dma[channel].flip, 0);
|
||||
}
|
||||
|
||||
/* Set mode for a specific DMA channel */
|
||||
static inline void dma_set_mode(unsigned int channel, char mode)
|
||||
{
|
||||
outportb(dma[channel].mode, mode | (channel & 3));
|
||||
}
|
||||
|
||||
/* Set DMA page register */
|
||||
static inline void dma_set_page(unsigned int channel, char page)
|
||||
{
|
||||
if (channel > 3)
|
||||
page &= 0xfe;
|
||||
outportb(dma[channel].page, page);
|
||||
}
|
||||
|
||||
/*
|
||||
Set transfer address & page bits for specific DMA channel.
|
||||
Assumes dma flipflop is clear.
|
||||
*/
|
||||
static inline void dma_set_addr(unsigned int channel, unsigned int address)
|
||||
{
|
||||
unsigned char dma_reg = dma[channel].addr;
|
||||
dma_set_page(channel, address >> 16);
|
||||
if (channel <= 3) {
|
||||
outportb(dma_reg, (address) & 0xff);
|
||||
outportb(dma_reg, (address >> 8) & 0xff);
|
||||
} else {
|
||||
outportb(dma_reg, (address >> 1) & 0xff);
|
||||
outportb(dma_reg, (address >> 9) & 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Set transfer size for a specific DMA channel.
|
||||
Assumes dma flip-flop is clear.
|
||||
*/
|
||||
static inline void dma_set_count(unsigned int channel, unsigned int count)
|
||||
{
|
||||
unsigned char dma_reg = dma[channel].size;
|
||||
count--; /* number of DMA transfers is bigger by one */
|
||||
if (channel > 3)
|
||||
count >>= 1;
|
||||
outportb(dma_reg, (count) & 0xff);
|
||||
outportb(dma_reg, (count >> 8) & 0xff);
|
||||
}
|
||||
|
||||
/*
|
||||
Query the number of bytes left to transfer.
|
||||
Assumes DMA flip-flop is clear.
|
||||
*/
|
||||
static inline int dma_get_count(unsigned int channel)
|
||||
{
|
||||
unsigned char dma_reg = dma[channel].size;
|
||||
|
||||
/* using short to get 16-bit wrap around */
|
||||
unsigned short count;
|
||||
count = inportb(dma_reg);
|
||||
count |= inportb(dma_reg) << 8;
|
||||
count++;
|
||||
return (channel <= 3) ? count : (count << 1);
|
||||
}
|
||||
|
||||
typedef struct dma_buffer_s {
|
||||
unsigned char *linear; /* Linear address */
|
||||
unsigned long physical; /* Physical address */
|
||||
unsigned long size; /* Buffer size */
|
||||
unsigned short selector; /* The selector assigned to this memory */
|
||||
unsigned char channel; /* The DMA channel */
|
||||
} dma_buffer;
|
||||
|
||||
/* Allocate a block of memory suitable for using as a DMA buffer */
|
||||
extern dma_buffer *dma_allocate(unsigned int channel, unsigned int size);
|
||||
/* Deallocate a DMA buffer */
|
||||
extern void dma_free(dma_buffer * buffer);
|
||||
/* Start DMA transfer to or from given buffer */
|
||||
extern void dma_start(dma_buffer * buffer, unsigned long count,
|
||||
unsigned char mode);
|
||||
|
||||
#endif /* __DOSDMA_H__ */
|
322
external/wildmidi-0.4.5/djgpp/dosirq.c
vendored
Normal file
322
external/wildmidi-0.4.5/djgpp/dosirq.c
vendored
Normal file
|
@ -0,0 +1,322 @@
|
|||
/* Implementation of IRQ routines on DOS -- from libMikMod.
|
||||
Copyright (C) 1999 by Andrew Zabolotny, <bit@eltech.ru>
|
||||
|
||||
This file is part of WildMIDI.
|
||||
|
||||
WildMIDI is free software: you can redistribute and/or modify the player
|
||||
under the terms of the GNU General Public License and you can redistribute
|
||||
and/or modify the library under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation, either version 3 of
|
||||
the licenses, or(at your option) any later version.
|
||||
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License and the
|
||||
GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "dosirq.h"
|
||||
|
||||
#include <dpmi.h>
|
||||
#include <go32.h>
|
||||
#include <dos.h>
|
||||
#include <sys/nearptr.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
|
||||
unsigned int __irq_stack_size = 0x4000;
|
||||
unsigned int __irq_stack_count = 1;
|
||||
|
||||
static void __int_stub_template (void)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
asm(" pushal\n"
|
||||
" pushl %ds\n"
|
||||
" pushl %es\n"
|
||||
" pushl %fs\n"
|
||||
" pushl %gs\n"
|
||||
" movw $0x1234,%ax\n" /* Get DPMI data selector */
|
||||
" movw %ax,%ds\n" /* Set DS and ES to data selector */
|
||||
" movw %ax,%es\n"
|
||||
" movl $0x12345678,%ebx\n" /* Interrupt stack top */
|
||||
" movl (%ebx),%ecx\n"
|
||||
" movl %ecx,%edx\n"
|
||||
" subl $0x12345678,%ecx\n" /* Subtract irq_stack_count */
|
||||
" movl %ecx,(%ebx)\n"
|
||||
" movw %ss,%si\n" /* Save old SS:ESP */
|
||||
" movl %esp,%edi\n"
|
||||
" movl %edx,%esp\n" /* Set SS:ESP to interrupt stack */
|
||||
" movw %ax,%ss\n"
|
||||
" pushl %esi\n"
|
||||
" pushl %edi\n"
|
||||
" pushl %ebx\n"
|
||||
" pushl %edx\n"
|
||||
" call 1f\n" /* Call user interrupt handler */
|
||||
"1: popl %edx\n"
|
||||
" popl %ebx\n"
|
||||
" movl %edx,(%ebx)\n"
|
||||
" popl %edi\n"
|
||||
" popl %esi\n"
|
||||
" movl %edi,%esp\n" /* Restore old SS:ESP */
|
||||
" movw %si,%ss\n"
|
||||
" popl %gs\n"
|
||||
" popl %fs\n"
|
||||
" popl %es\n"
|
||||
" popl %ds\n"
|
||||
" popal\n"
|
||||
" iret\n");
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
static int _allocate_iret_wrapper(_go32_dpmi_seginfo * info)
|
||||
{
|
||||
unsigned char *irqtpl = (unsigned char *)__int_stub_template;
|
||||
unsigned char *irqend, *irqwrapper, *tmp;
|
||||
__dpmi_meminfo handler_info;
|
||||
unsigned int wrappersize;
|
||||
|
||||
/* First, skip until pushal */
|
||||
while (*irqtpl != 0x60)
|
||||
irqtpl++;
|
||||
/* Now find the iret */
|
||||
irqend = irqtpl;
|
||||
while (*irqend++ != 0xcf);
|
||||
|
||||
wrappersize = 4 + __irq_stack_size * __irq_stack_count + 4 +
|
||||
((long)irqend - (long)irqtpl);
|
||||
irqwrapper = (unsigned char *) malloc(wrappersize);
|
||||
/* Lock the wrapper */
|
||||
handler_info.address = __djgpp_base_address + (unsigned long)irqwrapper;
|
||||
handler_info.size = wrappersize;
|
||||
if (__dpmi_lock_linear_region(&handler_info)) {
|
||||
free(irqwrapper);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* First comes the interrupt wrapper size */
|
||||
*(unsigned long *)irqwrapper = wrappersize;
|
||||
|
||||
/* Next comes the interrupt stack */
|
||||
tmp = irqwrapper + 4 + __irq_stack_size * __irq_stack_count;
|
||||
|
||||
/* The following dword is interrupt stack pointer */
|
||||
*((void **)tmp) = tmp;
|
||||
tmp += 4;
|
||||
|
||||
/* Now comes the interrupt wrapper itself */
|
||||
memcpy(tmp, irqtpl, irqend - irqtpl);
|
||||
*(unsigned short *)(tmp + 9) = _my_ds();
|
||||
*(unsigned long *)(tmp + 16) = (unsigned long)tmp - 4;
|
||||
*(unsigned long *)(tmp + 26) = __irq_stack_size;
|
||||
*(unsigned long *)(tmp + 46) =
|
||||
info->pm_offset - (unsigned long)(tmp + 50);
|
||||
|
||||
info->pm_offset = (unsigned long)tmp;
|
||||
info->pm_selector = _my_cs();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void _free_iret_wrapper(_go32_dpmi_seginfo * info)
|
||||
{
|
||||
__dpmi_meminfo handler_info;
|
||||
|
||||
info->pm_offset -= 4 + __irq_stack_size * __irq_stack_count + 4;
|
||||
|
||||
handler_info.address = __djgpp_base_address + info->pm_offset;
|
||||
handler_info.size = *(unsigned long *)info->pm_offset;
|
||||
__dpmi_unlock_linear_region(&handler_info);
|
||||
|
||||
free((void *)info->pm_offset);
|
||||
}
|
||||
|
||||
struct irq_handle *irq_hook(int irqno, void (*handler)(), unsigned long size)
|
||||
{
|
||||
int interrupt;
|
||||
struct irq_handle *irq;
|
||||
__dpmi_version_ret version;
|
||||
__dpmi_meminfo handler_info, struct_info;
|
||||
_go32_dpmi_seginfo info;
|
||||
unsigned long old_sel, old_ofs;
|
||||
|
||||
__dpmi_get_version(&version);
|
||||
if (irqno < 8)
|
||||
interrupt = version.master_pic + irqno;
|
||||
else
|
||||
interrupt = version.slave_pic + (irqno - 8);
|
||||
|
||||
if (_go32_dpmi_get_protected_mode_interrupt_vector(interrupt, &info))
|
||||
return NULL;
|
||||
|
||||
old_sel = info.pm_selector;
|
||||
old_ofs = info.pm_offset;
|
||||
|
||||
info.pm_offset = (unsigned long)handler;
|
||||
if (_allocate_iret_wrapper(&info))
|
||||
return NULL;
|
||||
|
||||
/* Lock the interrupt handler in memory */
|
||||
handler_info.address = __djgpp_base_address + (unsigned long)handler;
|
||||
handler_info.size = size;
|
||||
if (__dpmi_lock_linear_region(&handler_info)) {
|
||||
_free_iret_wrapper(&info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
irq = (struct irq_handle *) malloc(sizeof(struct irq_handle));
|
||||
irq->c_handler = handler;
|
||||
irq->handler_size = size;
|
||||
irq->handler = info.pm_offset;
|
||||
irq->prev_selector = old_sel;
|
||||
irq->prev_offset = old_ofs;
|
||||
irq->int_num = interrupt;
|
||||
irq->irq_num = irqno;
|
||||
irq->pic_base = irqno < 8 ? PIC1_BASE : PIC2_BASE;
|
||||
|
||||
struct_info.address = __djgpp_base_address + (unsigned long)irq;
|
||||
struct_info.size = sizeof(struct irq_handle);
|
||||
if (__dpmi_lock_linear_region(&struct_info)) {
|
||||
free(irq);
|
||||
__dpmi_unlock_linear_region(&handler_info);
|
||||
_free_iret_wrapper(&info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
_go32_dpmi_set_protected_mode_interrupt_vector(interrupt, &info);
|
||||
|
||||
irq->pic_mask = irq_state(irq);
|
||||
return irq;
|
||||
}
|
||||
|
||||
void irq_unhook(struct irq_handle *irq)
|
||||
{
|
||||
_go32_dpmi_seginfo info;
|
||||
__dpmi_meminfo mem_info;
|
||||
|
||||
if (!irq)
|
||||
return;
|
||||
|
||||
/* Restore the interrupt vector */
|
||||
irq_disable(irq);
|
||||
info.pm_offset = irq->prev_offset;
|
||||
info.pm_selector = irq->prev_selector;
|
||||
_go32_dpmi_set_protected_mode_interrupt_vector(irq->int_num, &info);
|
||||
|
||||
/* Unlock the interrupt handler */
|
||||
mem_info.address = __djgpp_base_address + (unsigned long)irq->c_handler;
|
||||
mem_info.size = irq->handler_size;
|
||||
__dpmi_unlock_linear_region(&mem_info);
|
||||
|
||||
/* Unlock the irq_handle structure */
|
||||
mem_info.address = __djgpp_base_address + (unsigned long)irq;
|
||||
mem_info.size = sizeof(struct irq_handle);
|
||||
__dpmi_unlock_linear_region(&mem_info);
|
||||
|
||||
info.pm_offset = irq->handler;
|
||||
_free_iret_wrapper(&info);
|
||||
|
||||
/* If IRQ was enabled before we hooked, restore enabled state */
|
||||
if (irq->pic_mask)
|
||||
irq_enable(irq);
|
||||
else
|
||||
irq_disable(irq);
|
||||
|
||||
free(irq);
|
||||
}
|
||||
|
||||
/*---------------------------------------------- IRQ detection mechanism -----*/
|
||||
static struct irq_handle *__irqs[16];
|
||||
static int (*__irq_confirm) (int irqno);
|
||||
static volatile unsigned int __irq_mask;
|
||||
static volatile unsigned int __irq_count[16];
|
||||
|
||||
#define DECLARE_IRQ_HANDLER(irqno) \
|
||||
static void __irq##irqno##_handler () \
|
||||
{ \
|
||||
if (irq_check (__irqs [irqno]) && __irq_confirm (irqno)) \
|
||||
{ \
|
||||
__irq_count [irqno]++; \
|
||||
__irq_mask |= (1 << irqno); \
|
||||
} \
|
||||
irq_ack (__irqs [irqno]); \
|
||||
}
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
DECLARE_IRQ_HANDLER(0)
|
||||
DECLARE_IRQ_HANDLER(1)
|
||||
DECLARE_IRQ_HANDLER(2)
|
||||
DECLARE_IRQ_HANDLER(3)
|
||||
DECLARE_IRQ_HANDLER(4)
|
||||
DECLARE_IRQ_HANDLER(5)
|
||||
DECLARE_IRQ_HANDLER(6)
|
||||
DECLARE_IRQ_HANDLER(7)
|
||||
DECLARE_IRQ_HANDLER(8)
|
||||
DECLARE_IRQ_HANDLER(9)
|
||||
DECLARE_IRQ_HANDLER(10)
|
||||
DECLARE_IRQ_HANDLER(11)
|
||||
DECLARE_IRQ_HANDLER(12)
|
||||
DECLARE_IRQ_HANDLER(13)
|
||||
DECLARE_IRQ_HANDLER(14)
|
||||
DECLARE_IRQ_HANDLER(15)
|
||||
/* *INDENT-ON* */
|
||||
|
||||
static void (*__irq_handlers[16]) () = {
|
||||
__irq0_handler, __irq1_handler, __irq2_handler, __irq3_handler,
|
||||
__irq4_handler, __irq5_handler, __irq6_handler, __irq7_handler,
|
||||
__irq8_handler, __irq9_handler, __irq10_handler, __irq11_handler,
|
||||
__irq12_handler, __irq13_handler, __irq14_handler, __irq15_handler};
|
||||
|
||||
void irq_detect_start(unsigned int irqs, int (*irq_confirm) (int irqno))
|
||||
{
|
||||
int i;
|
||||
|
||||
__irq_mask = 0;
|
||||
__irq_confirm = irq_confirm;
|
||||
memset(__irqs, 0, sizeof(__irqs));
|
||||
memset((void *) __irq_count, 0, sizeof(__irq_count));
|
||||
|
||||
/* Hook all specified IRQs */
|
||||
for (i = 1; i <= 15; i++)
|
||||
if (irqs & (1 << i)) {
|
||||
__irqs[i] = irq_hook(i, __irq_handlers[i], 200);
|
||||
/* Enable the interrupt */
|
||||
irq_enable(__irqs[i]);
|
||||
}
|
||||
/* Enable IRQ2 if we need at least one IRQ above 7 */
|
||||
if (irqs & 0xff00)
|
||||
_irq_enable(2);
|
||||
}
|
||||
|
||||
void irq_detect_end()
|
||||
{
|
||||
int i;
|
||||
for (i = 15; i >= 1; i--)
|
||||
if (__irqs[i])
|
||||
irq_unhook(__irqs[i]);
|
||||
}
|
||||
|
||||
int irq_detect_get(int irqno, unsigned int *irqmask)
|
||||
{
|
||||
int oldirq = disable();
|
||||
int count = __irq_count[irqno];
|
||||
*irqmask = __irq_mask;
|
||||
__irq_mask = 0;
|
||||
if (oldirq)
|
||||
enable();
|
||||
return count;
|
||||
}
|
||||
|
||||
void irq_detect_clear()
|
||||
{
|
||||
int oldirq = disable();
|
||||
memset((void *) __irq_count, 0, sizeof(__irq_count));
|
||||
__irq_mask = 0;
|
||||
if (oldirq)
|
||||
enable();
|
||||
}
|
122
external/wildmidi-0.4.5/djgpp/dosirq.h
vendored
Normal file
122
external/wildmidi-0.4.5/djgpp/dosirq.h
vendored
Normal file
|
@ -0,0 +1,122 @@
|
|||
/* Interface for IRQ routines on DOS -- from libMikMod.
|
||||
Copyright (C) 1999 by Andrew Zabolotny, <bit@eltech.ru>
|
||||
|
||||
This file is part of WildMIDI.
|
||||
|
||||
WildMIDI is free software: you can redistribute and/or modify the player
|
||||
under the terms of the GNU General Public License and you can redistribute
|
||||
and/or modify the library under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation, either version 3 of
|
||||
the licenses, or(at your option) any later version.
|
||||
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License and the
|
||||
GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __DOSIRQ_H__
|
||||
#define __DOSIRQ_H__
|
||||
|
||||
#include <pc.h>
|
||||
|
||||
#define PIC1_BASE 0x20 /* PIC1 base */
|
||||
#define PIC2_BASE 0xA0 /* PIC2 base */
|
||||
|
||||
struct irq_handle {
|
||||
void (*c_handler) (); /* The real interrupt handler */
|
||||
unsigned long handler_size; /* The size of interrupt handler */
|
||||
unsigned long handler; /* Interrupt wrapper address */
|
||||
unsigned long prev_selector; /* Selector of previous handler */
|
||||
unsigned long prev_offset; /* Offset of previous handler */
|
||||
unsigned char irq_num; /* IRQ number */
|
||||
unsigned char int_num; /* Interrupt number */
|
||||
unsigned char pic_base; /* PIC base (0x20 or 0xA0) */
|
||||
unsigned char pic_mask; /* Old PIC mask state */
|
||||
};
|
||||
|
||||
/* Return the enabled state for specific IRQ */
|
||||
static inline unsigned char irq_state(struct irq_handle * irq)
|
||||
{
|
||||
return ((~inportb(irq->pic_base + 1)) & (0x01 << (irq->irq_num & 7)));
|
||||
}
|
||||
|
||||
/* Acknowledge the end of interrupt */
|
||||
static inline void _irq_ack(int irqno)
|
||||
{
|
||||
outportb(irqno > 7 ? PIC2_BASE : PIC1_BASE, 0x60 | (irqno & 7));
|
||||
/* For second controller we also should acknowledge first controller */
|
||||
if (irqno > 7)
|
||||
outportb(PIC1_BASE, 0x20); /* 0x20, 0x62? */
|
||||
}
|
||||
|
||||
/* Acknowledge the end of interrupt */
|
||||
static inline void irq_ack(struct irq_handle * irq)
|
||||
{
|
||||
outportb(irq->pic_base, 0x60 | (irq->irq_num & 7));
|
||||
/* For second controller we also should acknowledge first controller */
|
||||
if (irq->pic_base != PIC1_BASE)
|
||||
outportb(PIC1_BASE, 0x20); /* 0x20, 0x62? */
|
||||
}
|
||||
|
||||
/* Mask (disable) the particular IRQ given his ordinal */
|
||||
static inline void _irq_disable(int irqno)
|
||||
{
|
||||
unsigned int port_no = (irqno < 8 ? PIC1_BASE : PIC2_BASE) + 1;
|
||||
outportb(port_no, inportb(port_no) | (1 << (irqno & 7)));
|
||||
}
|
||||
|
||||
/* Unmask (enable) the particular IRQ given its ordinal */
|
||||
static inline void _irq_enable(int irqno)
|
||||
{
|
||||
unsigned int port_no = (irqno < 8 ? PIC1_BASE : PIC2_BASE) + 1;
|
||||
outportb(port_no, inportb(port_no) & ~(1 << (irqno & 7)));
|
||||
}
|
||||
|
||||
/* Mask (disable) the particular IRQ given its irq_handle structure */
|
||||
static inline void irq_disable(struct irq_handle * irq)
|
||||
{
|
||||
outportb(irq->pic_base + 1,
|
||||
inportb(irq->pic_base + 1) | (1 << (irq->irq_num & 7)));
|
||||
}
|
||||
|
||||
/* Unmask (enable) the particular IRQ given its irq_handle structure */
|
||||
static inline void irq_enable(struct irq_handle * irq)
|
||||
{
|
||||
outportb(irq->pic_base + 1,
|
||||
inportb(irq->pic_base + 1) & ~(1 << (irq->irq_num & 7)));
|
||||
}
|
||||
|
||||
/* Check if a specific IRQ is pending: return 0 is no */
|
||||
static inline int irq_check(struct irq_handle * irq)
|
||||
{
|
||||
outportb(irq->pic_base, 0x0B); /* Read IRR vector */
|
||||
return (inportb(irq->pic_base) & (1 << (irq->irq_num & 7)));
|
||||
}
|
||||
|
||||
/* Hook a specific IRQ; NOTE: IRQ is disabled upon return, irq_enable() it */
|
||||
extern struct irq_handle *irq_hook(int irqno, void (*handler)(),
|
||||
unsigned long size);
|
||||
/* Unhook a previously hooked IRQ */
|
||||
extern void irq_unhook(struct irq_handle * irq);
|
||||
/* Start IRQ detection process (IRQ list is given with irq mask) */
|
||||
/* irq_confirm should return "1" if the IRQ really comes from the device */
|
||||
extern void irq_detect_start(unsigned int irqs,
|
||||
int (*irq_confirm) (int irqno));
|
||||
/* Finish IRQ detection process */
|
||||
extern void irq_detect_end();
|
||||
/* Get the count of specific irqno that happened */
|
||||
extern int irq_detect_get(int irqno, unsigned int *irqmask);
|
||||
/* Clear IRQ counters */
|
||||
extern void irq_detect_clear();
|
||||
|
||||
/* The size of interrupt stack */
|
||||
extern unsigned int __irq_stack_size;
|
||||
/* The number of nested interrupts that can be handled */
|
||||
extern unsigned int __irq_stack_count;
|
||||
|
||||
#endif /* __DOSIRQ_H__ */
|
561
external/wildmidi-0.4.5/djgpp/dossb.c
vendored
Normal file
561
external/wildmidi-0.4.5/djgpp/dossb.c
vendored
Normal file
|
@ -0,0 +1,561 @@
|
|||
/* Sound Blaster I/O routines, common for SB8, SBPro and SB16 --
|
||||
from libMikMod. Written by Andrew Zabolotny <bit@eltech.ru>
|
||||
Further bug fixes by O. Sezer <sezero@users.sourceforge.net>
|
||||
|
||||
This file is part of WildMIDI.
|
||||
|
||||
WildMIDI is free software: you can redistribute and/or modify the player
|
||||
under the terms of the GNU General Public License and you can redistribute
|
||||
and/or modify the library under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation, either version 3 of
|
||||
the licenses, or(at your option) any later version.
|
||||
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License and the
|
||||
GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <dpmi.h>
|
||||
#include <go32.h>
|
||||
#include <dos.h>
|
||||
#include <sys/nearptr.h>
|
||||
#include <sys/farptr.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dossb.h"
|
||||
|
||||
/********************************************* Private variables/routines *****/
|
||||
|
||||
__sb_state sb;
|
||||
|
||||
/* Wait for SoundBlaster for some time */
|
||||
#if (__GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ == 0)
|
||||
# define _func_noinline volatile /* match original code */
|
||||
# define _func_noclone
|
||||
#else
|
||||
/* avoid warnings from newer gcc:
|
||||
* "function definition has qualified void return type" and
|
||||
* function return types not compatible due to 'volatile' */
|
||||
# define _func_noinline __attribute__((__noinline__))
|
||||
# if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
|
||||
# define _func_noclone
|
||||
# else
|
||||
# define _func_noclone __attribute__((__noclone__))
|
||||
# endif
|
||||
#endif
|
||||
_func_noinline
|
||||
_func_noclone
|
||||
void __sb_wait()
|
||||
{
|
||||
inportb(SB_DSP_RESET);
|
||||
inportb(SB_DSP_RESET);
|
||||
inportb(SB_DSP_RESET);
|
||||
inportb(SB_DSP_RESET);
|
||||
inportb(SB_DSP_RESET);
|
||||
inportb(SB_DSP_RESET);
|
||||
}
|
||||
|
||||
static void sb_irq()
|
||||
{
|
||||
/* Make sure its not a spurious IRQ */
|
||||
if (!irq_check(sb.irq_handle))
|
||||
return;
|
||||
|
||||
sb.irqcount++;
|
||||
|
||||
/* Acknowledge DMA transfer is complete */
|
||||
if (sb.mode & SBMODE_16BITS)
|
||||
__sb_dsp_ack_dma16();
|
||||
else
|
||||
__sb_dsp_ack_dma8();
|
||||
|
||||
/* SoundBlaster 1.x cannot do autoinit ... */
|
||||
if (sb.dspver < SBVER_20)
|
||||
__sb_dspreg_outwlh(SBDSP_DMA_PCM8, (sb.dma_buff->size >> 1) - 1);
|
||||
|
||||
/* Send EOI */
|
||||
irq_ack(sb.irq_handle);
|
||||
|
||||
enable();
|
||||
if (sb.timer_callback)
|
||||
sb.timer_callback();
|
||||
}
|
||||
|
||||
static void sb_irq_end()
|
||||
{
|
||||
}
|
||||
|
||||
static boolean __sb_reset()
|
||||
{
|
||||
/* Disable the output */
|
||||
sb_output(FALSE);
|
||||
|
||||
/* Clear pending ints if any */
|
||||
__sb_dsp_ack_dma8();
|
||||
__sb_dsp_ack_dma16();
|
||||
|
||||
/* Reset the DSP */
|
||||
outportb(SB_DSP_RESET, SBM_DSP_RESET);
|
||||
__sb_wait();
|
||||
__sb_wait();
|
||||
outportb(SB_DSP_RESET, 0);
|
||||
|
||||
/* Now wait for AA coming from datain port */
|
||||
if (__sb_dsp_in() != 0xaa)
|
||||
return FALSE;
|
||||
|
||||
/* Finally, get the DSP version */
|
||||
if ((sb.dspver = __sb_dsp_version()) == 0xffff)
|
||||
return FALSE;
|
||||
/* Check again */
|
||||
if (sb.dspver != __sb_dsp_version())
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***************************************************** SB detection stuff *****/
|
||||
|
||||
static int __sb_irq_irqdetect(int irqno)
|
||||
{
|
||||
(void)irqno;
|
||||
__sb_dsp_ack_dma8();
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void __sb_irq_dmadetect()
|
||||
{
|
||||
/* Make sure its not a spurious IRQ */
|
||||
if (!irq_check(sb.irq_handle))
|
||||
return;
|
||||
|
||||
sb.irqcount++;
|
||||
|
||||
/* Acknowledge DMA transfer is complete */
|
||||
if (sb.mode & SBMODE_16BITS)
|
||||
__sb_dsp_ack_dma16();
|
||||
else
|
||||
__sb_dsp_ack_dma8();
|
||||
|
||||
/* Send EOI */
|
||||
irq_ack(sb.irq_handle);
|
||||
}
|
||||
|
||||
static boolean __sb_detect()
|
||||
{
|
||||
/* First find the port number */
|
||||
if (!sb.port) {
|
||||
int i;
|
||||
for (i = 5; i >= 0; i--) {
|
||||
sb.port = 0x210 + i * 0x10;
|
||||
if (__sb_reset())
|
||||
break;
|
||||
}
|
||||
if (i < 0) {
|
||||
sb.port = 0;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Now detect the IRQ and DMA numbers */
|
||||
if (!sb.irq) {
|
||||
unsigned int irqmask, sbirqmask, sbirqcount;
|
||||
unsigned long timer;
|
||||
|
||||
/* IRQ can be one of 2,3,5,7,10 */
|
||||
irq_detect_start(0x04ac, __sb_irq_irqdetect);
|
||||
|
||||
/* Prepare timeout counter */
|
||||
_farsetsel(_dos_ds);
|
||||
timer = _farnspeekl(0x46c);
|
||||
|
||||
sbirqmask = 0;
|
||||
sbirqcount = 10; /* Emit 10 SB irqs */
|
||||
|
||||
/* Tell SoundBlaster to emit IRQ for 8-bit transfers */
|
||||
__sb_dsp_out(SBDSP_GEN_IRQ8);
|
||||
__sb_wait();
|
||||
for (;;) {
|
||||
irq_detect_get(0, &irqmask);
|
||||
if (irqmask) {
|
||||
sbirqmask |= irqmask;
|
||||
if (!--sbirqcount)
|
||||
break;
|
||||
__sb_dsp_out(SBDSP_GEN_IRQ8);
|
||||
}
|
||||
if (_farnspeekl(0x46c) - timer >= 9) /* Wait ~1/2 secs */
|
||||
break;
|
||||
}
|
||||
if (sbirqmask)
|
||||
for (sb.irq = 15; sb.irq > 0; sb.irq--)
|
||||
if (irq_detect_get(sb.irq, &irqmask) == 10)
|
||||
break;
|
||||
|
||||
irq_detect_end();
|
||||
if (!sb.irq)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Detect the 8-bit and 16-bit DMAs */
|
||||
if (!sb.dma8 || ((sb.dspver >= SBVER_16) && !sb.dma16)) {
|
||||
static int __dma8[] = { 0, 1, 3 };
|
||||
static int __dma16[] = { 5, 6, 7 };
|
||||
int *dma;
|
||||
|
||||
sb_output(FALSE);
|
||||
/* Temporary hook SB IRQ */
|
||||
sb.irq_handle = irq_hook(sb.irq, __sb_irq_dmadetect, 200);
|
||||
irq_enable(sb.irq_handle);
|
||||
if (sb.irq > 7)
|
||||
_irq_enable(2);
|
||||
|
||||
/* Start a short DMA transfer and check if IRQ happened */
|
||||
for (;;) {
|
||||
int i, oldcount;
|
||||
unsigned int timer;
|
||||
|
||||
if (!sb.dma8)
|
||||
dma = &sb.dma8;
|
||||
else if ((sb.dspver >= SBVER_16) && !sb.dma16)
|
||||
dma = &sb.dma16;
|
||||
else
|
||||
break;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
boolean success = 1;
|
||||
|
||||
*dma = (dma == &sb.dma8) ? __dma8[i] : __dma16[i];
|
||||
oldcount = sb.irqcount;
|
||||
|
||||
dma_disable(*dma);
|
||||
dma_set_mode(*dma, DMA_MODE_WRITE);
|
||||
dma_clear_ff(*dma);
|
||||
dma_set_count(*dma, 2);
|
||||
dma_enable(*dma);
|
||||
|
||||
__sb_dspreg_out(SBDSP_SET_TIMING, 206); /* 20KHz */
|
||||
if (dma == &sb.dma8) {
|
||||
sb.mode = 0;
|
||||
__sb_dspreg_outwlh(SBDSP_DMA_PCM8, 1);
|
||||
} else {
|
||||
sb.mode = SBMODE_16BITS;
|
||||
__sb_dspreg_out(SBDSP_DMA_GENERIC16, 0);
|
||||
__sb_dsp_out(0);
|
||||
__sb_dsp_out(1);
|
||||
}
|
||||
|
||||
_farsetsel(_dos_ds);
|
||||
timer = _farnspeekl(0x46c);
|
||||
|
||||
while (oldcount == sb.irqcount)
|
||||
if (_farnspeekl(0x46c) - timer >= 2) {
|
||||
success = 0;
|
||||
break;
|
||||
}
|
||||
dma_disable(*dma);
|
||||
if (success)
|
||||
break;
|
||||
*dma = 0;
|
||||
}
|
||||
if (!*dma)
|
||||
break;
|
||||
}
|
||||
|
||||
irq_unhook(sb.irq_handle);
|
||||
sb.irq_handle = NULL;
|
||||
if (!sb.dma8 || ((sb.dspver >= SBVER_16) && !sb.dma16))
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*************************************************** High-level interface *****/
|
||||
|
||||
/* Detect whenever SoundBlaster is present and fill "sb" structure */
|
||||
boolean sb_detect()
|
||||
{
|
||||
char *env;
|
||||
|
||||
/* Try to find the port and DMA from environment */
|
||||
env = getenv("BLASTER");
|
||||
|
||||
while (env && *env) {
|
||||
/* Skip whitespace */
|
||||
while ((*env == ' ') || (*env == '\t'))
|
||||
env++;
|
||||
if (!*env)
|
||||
break;
|
||||
|
||||
switch (*env++) {
|
||||
case 'A':
|
||||
case 'a':
|
||||
if (!sb.port)
|
||||
sb.port = strtol(env, &env, 16);
|
||||
break;
|
||||
case 'E':
|
||||
case 'e':
|
||||
if (!sb.aweport)
|
||||
sb.aweport = strtol(env, &env, 16);
|
||||
break;
|
||||
case 'I':
|
||||
case 'i':
|
||||
if (!sb.irq)
|
||||
sb.irq = strtol(env, &env, 10);
|
||||
break;
|
||||
case 'D':
|
||||
case 'd':
|
||||
if (!sb.dma8)
|
||||
sb.dma8 = strtol(env, &env, 10);
|
||||
break;
|
||||
case 'H':
|
||||
case 'h':
|
||||
if (!sb.dma16)
|
||||
sb.dma16 = strtol(env, &env, 10);
|
||||
break;
|
||||
default:
|
||||
/* Skip other values (H == MIDI, T == model, any other?) */
|
||||
while (*env && (*env != ' ') && (*env != '\t'))
|
||||
env++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Try to detect missing sound card parameters */
|
||||
__sb_detect();
|
||||
|
||||
if (!sb.port || !sb.irq || !sb.dma8)
|
||||
return FALSE;
|
||||
|
||||
if (!__sb_reset())
|
||||
return FALSE;
|
||||
|
||||
if ((sb.dspver >= SBVER_16) && !sb.dma16)
|
||||
return FALSE;
|
||||
|
||||
if (sb.dspver >= SBVER_PRO)
|
||||
sb.caps |= SBMODE_STEREO;
|
||||
if (sb.dspver >= SBVER_16 && sb.dma16)
|
||||
sb.caps |= SBMODE_16BITS;
|
||||
if (sb.dspver < SBVER_20)
|
||||
sb.maxfreq_mono = 22222;
|
||||
else
|
||||
sb.maxfreq_mono = 45454;
|
||||
if (sb.dspver <= SBVER_16)
|
||||
sb.maxfreq_stereo = 22727;
|
||||
else
|
||||
sb.maxfreq_stereo = 45454;
|
||||
|
||||
sb.ok = 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Reset SoundBlaster */
|
||||
void sb_reset()
|
||||
{
|
||||
sb_stop_dma();
|
||||
__sb_reset();
|
||||
}
|
||||
|
||||
/* Start working with SoundBlaster */
|
||||
boolean sb_open()
|
||||
{
|
||||
__dpmi_meminfo struct_info;
|
||||
|
||||
if (!sb.ok)
|
||||
if (!sb_detect())
|
||||
return FALSE;
|
||||
|
||||
if (sb.open)
|
||||
return FALSE;
|
||||
|
||||
/* Now lock the sb structure in memory */
|
||||
struct_info.address = __djgpp_base_address + (unsigned long)&sb;
|
||||
struct_info.size = sizeof(sb);
|
||||
if (__dpmi_lock_linear_region(&struct_info))
|
||||
return FALSE;
|
||||
|
||||
/* Hook the SB IRQ */
|
||||
sb.irq_handle = irq_hook(sb.irq, sb_irq, (long)sb_irq_end - (long)sb_irq);
|
||||
if (!sb.irq_handle) {
|
||||
__dpmi_unlock_linear_region(&struct_info);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Enable the interrupt */
|
||||
irq_enable(sb.irq_handle);
|
||||
if (sb.irq > 7)
|
||||
_irq_enable(2);
|
||||
|
||||
sb.open++;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Finish working with SoundBlaster */
|
||||
boolean sb_close()
|
||||
{
|
||||
__dpmi_meminfo struct_info;
|
||||
if (!sb.open)
|
||||
return FALSE;
|
||||
|
||||
sb.open--;
|
||||
|
||||
/* Stop/free DMA buffer */
|
||||
sb_stop_dma();
|
||||
|
||||
/* Unhook IRQ */
|
||||
irq_unhook(sb.irq_handle);
|
||||
sb.irq_handle = NULL;
|
||||
|
||||
/* Unlock the sb structure */
|
||||
struct_info.address = __djgpp_base_address + (unsigned long)&sb;
|
||||
struct_info.size = sizeof(sb);
|
||||
__dpmi_unlock_linear_region(&struct_info);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Enable/disable stereo DSP mode */
|
||||
/* Enable/disable speaker output */
|
||||
void sb_output(boolean enable)
|
||||
{
|
||||
__sb_dsp_out(enable ? SBDSP_SPEAKER_ENA : SBDSP_SPEAKER_DIS);
|
||||
}
|
||||
|
||||
/* Start playing from DMA buffer */
|
||||
boolean sb_start_dma(unsigned char mode, unsigned int freq)
|
||||
{
|
||||
int dmachannel = (mode & SBMODE_16BITS) ? sb.dma16 : sb.dma8;
|
||||
int dmabuffsize;
|
||||
unsigned int tc = 0; /* timing constant (<=sbpro only) */
|
||||
|
||||
/* Stop DMA transfer if it is enabled */
|
||||
sb_stop_dma();
|
||||
|
||||
/* Sanity check */
|
||||
if ((mode & SBMODE_MASK & sb.caps) != (mode & SBMODE_MASK))
|
||||
return FALSE;
|
||||
|
||||
/* Check this SB can perform at requested frequency */
|
||||
if (((mode & SBMODE_STEREO) && (freq > sb.maxfreq_stereo))
|
||||
|| (!(mode & SBMODE_STEREO) && (freq > sb.maxfreq_mono)))
|
||||
return FALSE;
|
||||
|
||||
/* Check the timing constant here to avoid failing later */
|
||||
if (sb.dspver < SBVER_16) {
|
||||
/* SBpro cannot do signed transfer */
|
||||
if (mode & SBMODE_SIGNED)
|
||||
return FALSE;
|
||||
|
||||
/* Old SBs have a different way on setting DMA timing constant */
|
||||
tc = freq;
|
||||
if (mode & SBMODE_STEREO)
|
||||
tc *= 2;
|
||||
tc = 1000000 / tc;
|
||||
if (tc > 255)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
sb.mode = mode;
|
||||
|
||||
/* Get a DMA buffer enough for a 1/4sec interval... 4K <= dmasize <= 32K */
|
||||
dmabuffsize = freq;
|
||||
if (mode & SBMODE_STEREO)
|
||||
dmabuffsize *= 2;
|
||||
if (mode & SBMODE_16BITS)
|
||||
dmabuffsize *= 2;
|
||||
dmabuffsize >>= 2;
|
||||
if (dmabuffsize < 4096)
|
||||
dmabuffsize = 4096;
|
||||
if (dmabuffsize > 32768)
|
||||
dmabuffsize = 32768;
|
||||
dmabuffsize = (dmabuffsize + 255) & 0xffffff00;
|
||||
|
||||
sb.dma_buff = dma_allocate(dmachannel, dmabuffsize);
|
||||
if (!sb.dma_buff)
|
||||
return FALSE;
|
||||
|
||||
/* Fill DMA buffer with silence */
|
||||
dmabuffsize = sb.dma_buff->size;
|
||||
if (mode & SBMODE_SIGNED)
|
||||
memset(sb.dma_buff->linear, 0, dmabuffsize);
|
||||
else
|
||||
memset(sb.dma_buff->linear, 0x80, dmabuffsize);
|
||||
|
||||
/* Prime DMA for transfer */
|
||||
dma_start(sb.dma_buff, dmabuffsize, DMA_MODE_WRITE | DMA_MODE_AUTOINIT);
|
||||
|
||||
/* Tell SoundBlaster to start transfer */
|
||||
if (sb.dspver >= SBVER_16) { /* SB16 */
|
||||
__sb_dspreg_outwhl(SBDSP_SET_RATE, freq);
|
||||
|
||||
/* Start DMA->DAC transfer */
|
||||
__sb_dspreg_out(SBM_GENDAC_AUTOINIT | SBM_GENDAC_FIFO |
|
||||
((mode & SBMODE_16BITS) ? SBDSP_DMA_GENERIC16 :
|
||||
SBDSP_DMA_GENERIC8),
|
||||
((mode & SBMODE_SIGNED) ? SBM_GENDAC_SIGNED : 0) |
|
||||
((mode & SBMODE_STEREO) ? SBM_GENDAC_STEREO : 0));
|
||||
|
||||
/* Write the length of transfer */
|
||||
dmabuffsize = (dmabuffsize >> 2) - 1;
|
||||
__sb_dsp_out(dmabuffsize);
|
||||
__sb_dsp_out(dmabuffsize >> 8);
|
||||
} else {
|
||||
__sb_dspreg_out(SBDSP_SET_TIMING, 256 - tc);
|
||||
dmabuffsize = (dmabuffsize >> 1) - 1;
|
||||
if (sb.dspver >= SBVER_20) { /* SB 2.0/Pro */
|
||||
/* Set stereo mode */
|
||||
__sb_stereo((mode & SBMODE_STEREO) ? TRUE : FALSE);
|
||||
__sb_dspreg_outwlh(SBDSP_SET_DMA_BLOCK, dmabuffsize);
|
||||
if (sb.dspver >= SBVER_PRO)
|
||||
__sb_dsp_out(SBDSP_HS_DMA_DAC8_AUTO);
|
||||
else
|
||||
__sb_dsp_out(SBDSP_DMA_PCM8_AUTO);
|
||||
} else { /* Original SB */
|
||||
/* Start DMA->DAC transfer */
|
||||
__sb_dspreg_outwlh(SBDSP_DMA_PCM8, dmabuffsize);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Stop playing from DMA buffer */
|
||||
void sb_stop_dma()
|
||||
{
|
||||
if (!sb.dma_buff)
|
||||
return;
|
||||
|
||||
if (sb.mode & SBMODE_16BITS)
|
||||
__sb_dsp_out(SBDSP_DMA_HALT16);
|
||||
else
|
||||
__sb_dsp_out(SBDSP_DMA_HALT8);
|
||||
|
||||
dma_disable(sb.dma_buff->channel);
|
||||
dma_free(sb.dma_buff);
|
||||
sb.dma_buff = NULL;
|
||||
}
|
||||
|
||||
/* Query current position/total size of the DMA buffer */
|
||||
void sb_query_dma(unsigned int *dma_size, unsigned int *dma_pos)
|
||||
{
|
||||
unsigned int dma_left;
|
||||
*dma_size = sb.dma_buff->size;
|
||||
/* It can happen we try to read DMA count when HI/LO bytes will be
|
||||
inconsistent */
|
||||
for (;;) {
|
||||
unsigned int dma_left_test;
|
||||
dma_clear_ff(sb.dma_buff->channel);
|
||||
dma_left_test = dma_get_count(sb.dma_buff->channel);
|
||||
dma_left = dma_get_count(sb.dma_buff->channel);
|
||||
if ((dma_left >= dma_left_test) && (dma_left - dma_left_test < 10))
|
||||
break;
|
||||
}
|
||||
*dma_pos = *dma_size - dma_left;
|
||||
}
|
334
external/wildmidi-0.4.5/djgpp/dossb.h
vendored
Normal file
334
external/wildmidi-0.4.5/djgpp/dossb.h
vendored
Normal file
|
@ -0,0 +1,334 @@
|
|||
/* SoundBlaster and compatible soundcards definitions --
|
||||
from libMikMod. Written by Andrew Zabolotny <bit@eltech.ru>
|
||||
Further bug fixes by O.Sezer <sezero@users.sourceforge.net>
|
||||
|
||||
This file is part of WildMIDI.
|
||||
|
||||
WildMIDI is free software: you can redistribute and/or modify the player
|
||||
under the terms of the GNU General Public License and you can redistribute
|
||||
and/or modify the library under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation, either version 3 of
|
||||
the licenses, or(at your option) any later version.
|
||||
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License and the
|
||||
GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __DOSSB_H__
|
||||
#define __DOSSB_H__
|
||||
|
||||
#include "dosdma.h"
|
||||
#include "dosirq.h"
|
||||
|
||||
#define SB_FM_LEFT_STATUS (sb.port + 0x00) /* (r) Left FM status */
|
||||
#define SB_FM_LEFT_REGSEL (sb.port + 0x00) /* (w) Left FM register select */
|
||||
#define SB_FM_LEFT_DATA (sb.port + 0x01) /* (w) Left FM data */
|
||||
#define SB_FM_RIGHT_STATUS (sb.port + 0x02) /* (r) Right FM status */
|
||||
#define SB_FM_RIGHT_REGSEL (sb.port + 0x02) /* (w) Right FM register select */
|
||||
#define SB_FM_RIGHT_DATA (sb.port + 0x03) /* (w) Right FM data */
|
||||
#define SB_MIXER_REGSEL (sb.port + 0x04) /* (w) Mixer register select */
|
||||
#define SB_MIXER_DATA (sb.port + 0x05) /* (rw)Mixer data */
|
||||
#define SB_DSP_RESET (sb.port + 0x06) /* (w) DSP reset */
|
||||
#define SB_FM_STATUS (sb.port + 0x08) /* (r) FM status */
|
||||
#define SB_FM_REGSEL (sb.port + 0x08) /* (w) FM register select */
|
||||
#define SB_FM_DATA (sb.port + 0x09) /* (w) FM data */
|
||||
#define SB_DSP_DATA_IN (sb.port + 0x0a) /* (r) DSP data input */
|
||||
#define SB_DSP_DATA_OUT (sb.port + 0x0c) /* (w) DSP data output */
|
||||
#define SB_DSP_DATA_OUT_STATUS (sb.port + 0x0c) /* (r) DSP data output status */
|
||||
#define SB_DSP_TIMER_IRQ (sb.port + 0x0d) /* (r) clear timer IRQ? */
|
||||
#define SB_DSP_DATA_IN_STATUS (sb.port + 0x0e) /* (r) DSP data input status */
|
||||
#define SB_DSP_DMA8_IRQ (sb.port + 0x0e) /* (r) Acknowledge 8-bit DMA transfer */
|
||||
#define SB_DSP_DMA16_IRQ (sb.port + 0x0f) /* (r) Acknowledge 16-bit DMA transfer */
|
||||
|
||||
/* DSP commands */
|
||||
#define SBDSP_ASP_STATUS 0x03 /* ASP Status (SB16ASP) */
|
||||
#define SBDSP_STATUS_OLD 0x04 /* DSP Status (Obsolete) (SB2.0-Pro2) */
|
||||
#define SBDSP_DIRECT_DAC 0x10 /* Direct DAC, 8-bit (SB) */
|
||||
#define SBDSP_DMA_PCM8 0x14 /* DMA DAC, 8-bit (SB) */
|
||||
#define SBDSP_DMA_ADPCM2 0x16 /* DMA DAC, 2-bit ADPCM (SB) */
|
||||
#define SBDSP_DMA_ADPCM2R 0x17 /* DMA DAC, 2-bit ADPCM Reference (SB) */
|
||||
#define SBDSP_DMA_PCM8_AUTO 0x1C /* Auto-Initialize DMA DAC, 8-bit (SB2.0) */
|
||||
#define SBDSP_DMA_ADPCM2R_AUTO 0x1F /* Auto-Initialize DMA DAC, 2-bit ADPCM Reference (SB2.0) */
|
||||
#define SBDSP_DIRECT_ADC 0x20 /* Direct ADC, 8-bit (SB) */
|
||||
#define SBDSP_DMA_ADC8 0x24 /* DMA ADC, 8-bit (SB) */
|
||||
#define SBDSP_DIRECT_ADC8_BURST 0x28 /* Direct ADC, 8-bit (Burst) (SB-Pro2) */
|
||||
#define SBDSP_DMA_ADC8_AUTO 0x2C /* Auto-Initialize DMA ADC, 8-bit (SB2.0) */
|
||||
#define SBDSP_MIDI_READ_POLL 0x30 /* MIDI Read Poll (SB) */
|
||||
#define SBDSP_MIDI_READ_IRQ 0x31 /* MIDI Read Interrupt (SB) */
|
||||
#define SBDSP_MIDI_READ_TIME 0x32 /* MIDI Read Timestamp Poll (SB???) */
|
||||
#define SBDSP_MIDI_READ_TIME_IRQ 0x33 /* MIDI Read Timestamp Interrupt (SB???) */
|
||||
#define SBDSP_MIDI_RW_POLL 0x34 /* MIDI Read Poll + Write Poll (UART) (SB2.0) */
|
||||
#define SBDSP_MIDI_RW_IRQ 0x35 /* MIDI Read Interrupt + Write Poll (UART) (SB2.0???) */
|
||||
#define SBDSP_MIDI_RW_TIME_IRQ 0x37 /* MIDI Read Timestamp Interrupt + Write Poll (UART) (SB2.0???) */
|
||||
#define SBDSP_MIDI_WRITE_POLL 0x38 /* MIDI Write Poll (SB) */
|
||||
#define SBDSP_SET_TIMING 0x40 /* Set Time Constant (SB) */
|
||||
#define SBDSP_SET_RATE 0x41 /* Set Sample Rate, Hz (SB16) */
|
||||
#define SBDSP_DMA_CONT8_AUTO 0x45 /* Continue Auto-Initialize DMA, 8-bit (SB16) */
|
||||
#define SBDSP_DMA_CONT16_AUTO 0x47 /* Continue Auto-Initialize DMA, 16-bit (SB16) */
|
||||
#define SBDSP_SET_DMA_BLOCK 0x48 /* Set DMA Block Size (SB2.0) */
|
||||
#define SBDSP_DMA_ADPCM4 0x74 /* DMA DAC, 4-bit ADPCM (SB) */
|
||||
#define SBDSP_DMA_ADPCM4_REF 0x75 /* DMA DAC, 4-bit ADPCM Reference (SB) */
|
||||
#define SBDSP_DMA_ADPCM26 0x76 /* DMA DAC, 2.6-bit ADPCM (SB) */
|
||||
#define SBDSP_DMA_ADPCM26_REF 0x77 /* DMA DAC, 2.6-bit ADPCM Reference (SB) */
|
||||
#define SBDSP_DMA_ADPCM4R_AUTO 0x7D /* Auto-Initialize DMA DAC, 4-bit ADPCM Reference (SB2.0) */
|
||||
#define SBDSP_DMA_ADPCM26R_AUTO 0x7F /* Auto-Initialize DMA DAC, 2.6-bit ADPCM Reference (SB2.0) */
|
||||
#define SBDSP_DISABLE_DAC 0x80 /* Silence DAC (SB) */
|
||||
#define SBDSP_HS_DMA_DAC8_AUTO 0x90 /* Auto-Initialize DMA DAC, 8-bit (High Speed) (SB2.0-Pro2) */
|
||||
#define SBDSP_HS_DMA_ADC8_AUTO 0x98 /* Auto-Initialize DMA ADC, 8-bit (High Speed) (SB2.0-Pro2) */
|
||||
#define SBDSP_STEREO_ADC_DIS 0xA0 /* Disable Stereo Input Mode (SBPro Only) */
|
||||
#define SBDSP_STEREO_ADC_ENA 0xA8 /* Enable Stereo Input Mode (SBPro Only) */
|
||||
#define SBDSP_DMA_GENERIC16 0xB0 /* Generic DAC/ADC DMA (16-bit) (SB16) */
|
||||
#define SBDSP_DMA_GENERIC8 0xC0 /* Generic DAC/ADC DMA (8-bit) (SB16) */
|
||||
#define SBDSP_DMA_HALT8 0xD0 /* Halt DMA Operation, 8-bit (SB) */
|
||||
#define SBDSP_SPEAKER_ENA 0xD1 /* Enable Speaker (SB) */
|
||||
#define SBDSP_SPEAKER_DIS 0xD3 /* Disable Speaker (SB) */
|
||||
#define SBDSP_DMA_CONT8 0xD4 /* Continue DMA Operation, 8-bit (SB) */
|
||||
#define SBDSP_DMA_HALT16 0xD5 /* Halt DMA Operation, 16-bit (SB16) */
|
||||
#define SBDSP_DMA_CONT16 0xD6 /* Continue DMA Operation, 16-bit (SB16) */
|
||||
#define SBDSP_SPEAKER_STATUS 0xD8 /* Speaker Status (SB) */
|
||||
#define SBDSP_DMA_EXIT16_AUTO 0xD9 /* Exit Auto-Initialize DMA Operation, 16-bit (SB16) */
|
||||
#define SBDSP_DMA_EXIT8_AUTO 0xDA /* Exit Auto-Initialize DMA Operation, 8-bit (SB2.0) */
|
||||
#define SBDSP_IDENTIFY 0xE0 /* DSP Identification (SB2.0) */
|
||||
#define SBDSP_VERSION 0xE1 /* DSP Version (SB) */
|
||||
#define SBDSP_COPYRIGHT 0xE3 /* DSP Copyright (SBPro2???) */
|
||||
#define SBDSP_WRITE_TEST 0xE4 /* Write Test Register (SB2.0) */
|
||||
#define SBDSP_READ_TEST 0xE8 /* Read Test Register (SB2.0) */
|
||||
#define SBDSP_SINE_GEN 0xF0 /* Sine Generator (SB) */
|
||||
#define SBDSP_AUX_STATUS_PRO 0xF1 /* DSP Auxiliary Status (Obsolete) (SB-Pro2) */
|
||||
#define SBDSP_GEN_IRQ8 0xF2 /* IRQ Request, 8-bit (SB) */
|
||||
#define SBDSP_GEN_IRQ16 0xF3 /* IRQ Request, 16-bit (SB16) */
|
||||
#define SBDSP_STATUS 0xFB /* DSP Status (SB16) */
|
||||
#define SBDSP_AUX_STATUS_16 0xFC /* DSP Auxiliary Status (SB16) */
|
||||
#define SBDSP_CMD_STATUS 0xFD /* DSP Command Status (SB16) */
|
||||
|
||||
/* Mixer commands */
|
||||
#define SBMIX_RESET 0x00 /* Reset Write SBPro */
|
||||
#define SBMIX_STATUS 0x01 /* Status Read SBPro */
|
||||
#define SBMIX_MASTER_LEVEL1 0x02 /* Master Volume Read/Write SBPro Only */
|
||||
#define SBMIX_DAC_LEVEL 0x04 /* DAC Level Read/Write SBPro */
|
||||
#define SBMIX_FM_OUTPUT 0x06 /* FM Output Control Read/Write SBPro Only */
|
||||
#define SBMIX_MIC_LEVEL 0x0A /* Microphone Level Read/Write SBPro */
|
||||
#define SBMIX_INPUT_SELECT 0x0C /* Input/Filter Select Read/Write SBPro Only */
|
||||
#define SBMIX_OUTPUT_SELECT 0x0E /* Output/Stereo Select Read/Write SBPro Only */
|
||||
#define SBMIX_FM_LEVEL 0x22 /* Master Volume Read/Write SBPro */
|
||||
#define SBMIX_MASTER_LEVEL 0x26 /* FM Level Read/Write SBPro */
|
||||
#define SBMIX_CD_LEVEL 0x28 /* CD Audio Level Read/Write SBPro */
|
||||
#define SBMIX_LINEIN_LEVEL 0x2E /* Line In Level Read/Write SBPro */
|
||||
#define SBMIX_MASTER_LEVEL_L 0x30 /* Master Volume Left Read/Write SB16 */
|
||||
#define SBMIX_MASTER_LEVEL_R 0x31 /* Master Volume Right Read/Write SB16 */
|
||||
#define SBMIX_DAC_LEVEL_L 0x32 /* DAC Level Left Read/Write SB16 */
|
||||
#define SBMIX_DAC_LEVEL_R 0x33 /* DAC Level Right Read/Write SB16 */
|
||||
#define SBMIX_FM_LEVEL_L 0x34 /* FM Level Left Read/Write SB16 */
|
||||
#define SBMIX_FM_LEVEL_R 0x35 /* FM Level Right Read/Write SB16 */
|
||||
#define SBMIX_CD_LEVEL_L 0x36 /* CD Audio Level Left Read/Write SB16 */
|
||||
#define SBMIX_CD_LEVEL_R 0x37 /* CD Audio Level Right Read/Write SB16 */
|
||||
#define SBMIX_LINEIN_LEVEL_L 0x38 /* Line In Level Left Read/Write SB16 */
|
||||
#define SBMIX_LINEIN_LEVEL_R 0x39 /* Line In Level Right Read/Write SB16 */
|
||||
#define SBMIX_MIC_LEVEL_16 0x3A /* Microphone Level Read/Write SB16 */
|
||||
#define SBMIX_PCSPK_LEVEL 0x3B /* PC Speaker Level Read/Write SB16 */
|
||||
#define SBMIX_OUTPUT_CONTROL 0x3C /* Output Control Read/Write SB16 */
|
||||
#define SBMIX_INPUT_CONTROL_L 0x3D /* Input Control Left Read/Write SB16 */
|
||||
#define SBMIX_INPUT_CONTROL_R 0x3E /* Input Control Right Read/Write SB16 */
|
||||
#define SBMIX_INPUT_GAIN_L 0x3F /* Input Gain Control Left Read/Write SB16 */
|
||||
#define SBMIX_INPUT_GAIN_R 0x40 /* Input Gain Control Right Read/Write SB16 */
|
||||
#define SBMIX_OUTPUT_GAIN_L 0x41 /* Output Gain Control Left Read/Write SB16 */
|
||||
#define SBMIX_OUTPUT_GAIN_R 0x42 /* Output Gain Control Right Read/Write SB16 */
|
||||
#define SBMIX_AGC_CONTROL 0x43 /* Automatic Gain Control (AGC) Read/Write SB16 */
|
||||
#define SBMIX_TREBLE_L 0x44 /* Treble Left Read/Write SB16 */
|
||||
#define SBMIX_TREBLE_R 0x45 /* Treble Right Read/Write SB16 */
|
||||
#define SBMIX_BASS_L 0x46 /* Bass Left Read/Write SB16 */
|
||||
#define SBMIX_BASS_R 0x47 /* Bass Right Read/Write SB16 */
|
||||
#define SBMIX_IRQ_SELECT 0x80 /* IRQ Select Read/Write SB16 */
|
||||
#define SBMIX_DMA_SELECT 0x81 /* DMA Select Read/Write SB16 */
|
||||
#define SBMIX_IRQ_STATUS 0x82 /* IRQ Status Read SB16 */
|
||||
|
||||
/* SB_DSP_DATA_OUT_STATUS and SB_DSP_DATA_IN_STATUS bits */
|
||||
#define SBM_DSP_READY 0x80
|
||||
|
||||
/* SB_DSP_RESET / SBMIX_RESET */
|
||||
#define SBM_DSP_RESET 0x01
|
||||
|
||||
/* SBMIX_OUTPUT_SELECT */
|
||||
#define SBM_MIX_STEREO 0x02
|
||||
#define SBM_MIX_FILTER 0x20
|
||||
|
||||
/* SBDSP_DMA_GENERIC16/SBDSP_DMA_GENERIC8 */
|
||||
#define SBM_GENDAC_FIFO 0x02
|
||||
#define SBM_GENDAC_AUTOINIT 0x04
|
||||
#define SBM_GENDAC_ADC 0x08
|
||||
/* Second (mode) byte */
|
||||
#define SBM_GENDAC_SIGNED 0x10
|
||||
#define SBM_GENDAC_STEREO 0x20
|
||||
|
||||
/* DSP version masks */
|
||||
#define SBVER_10 0x0100 /* Original SoundBlaster */
|
||||
#define SBVER_15 0x0105 /* SoundBlaster 1.5 */
|
||||
#define SBVER_20 0x0200 /* SoundBlaster 2.0 */
|
||||
#define SBVER_PRO 0x0300 /* SoundBlaster Pro */
|
||||
#define SBVER_PRO2 0x0301 /* SoundBlaster Pro 2 */
|
||||
#define SBVER_16 0x0400 /* SoundBlaster 16 */
|
||||
#define SBVER_AWE32 0x040c /* SoundBlaster AWE32 */
|
||||
|
||||
typedef unsigned char boolean;
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
/* Play mode bits */
|
||||
#define SBMODE_16BITS 0x0001
|
||||
#define SBMODE_STEREO 0x0002
|
||||
#define SBMODE_SIGNED 0x0004
|
||||
|
||||
/* Mask for capabilities that never change */
|
||||
#define SBMODE_MASK (SBMODE_16BITS | SBMODE_STEREO)
|
||||
|
||||
/* You can fill some members of this struct (i.e. port,irq,dma) before
|
||||
* calling sb_detect() or sb_open()... this will ignore environment settings.
|
||||
*/
|
||||
typedef struct __sb_state_s {
|
||||
boolean ok; /* Are structure contents valid? */
|
||||
int port, aweport; /* sb/awe32 base port */
|
||||
int irq; /* SoundBlaster IRQ */
|
||||
int dma8, dma16; /* 8-bit and 16-bit DMAs */
|
||||
unsigned maxfreq_mono; /* Maximum discretization frequency / mono mode */
|
||||
unsigned maxfreq_stereo; /* Maximum discretization frequency / stereo mode */
|
||||
unsigned short dspver; /* DSP version number */
|
||||
struct irq_handle *irq_handle; /* The interrupt handler */
|
||||
dma_buffer *dma_buff; /* Pre-allocated DMA buffer */
|
||||
unsigned char caps; /* SoundBlaster capabilities (SBMODE_XXX) */
|
||||
unsigned char mode; /* Current SB mode (SBMODE_XXX) */
|
||||
boolean open; /* Whenever the card has been opened */
|
||||
volatile int irqcount; /* Incremented on each IRQ... for diagnostics */
|
||||
void (*timer_callback) (); /* Called TWICE per buffer play */
|
||||
} __sb_state;
|
||||
|
||||
extern __sb_state sb;
|
||||
|
||||
extern void __sb_wait();
|
||||
|
||||
static inline boolean __sb_dsp_ready_in()
|
||||
{
|
||||
int count;
|
||||
for (count = 10000; count >= 0; count--)
|
||||
if (inportb(SB_DSP_DATA_IN_STATUS) & SBM_DSP_READY)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static inline boolean __sb_dsp_ready_out()
|
||||
{
|
||||
int count;
|
||||
for (count = 10000; count >= 0; count--)
|
||||
if ((inportb(SB_DSP_DATA_OUT_STATUS) & SBM_DSP_READY) == 0)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static inline void __sb_dsp_out(unsigned char reg)
|
||||
{
|
||||
__sb_dsp_ready_out();
|
||||
outportb(SB_DSP_DATA_OUT, reg);
|
||||
}
|
||||
|
||||
static inline unsigned char __sb_dsp_in()
|
||||
{
|
||||
__sb_dsp_ready_in();
|
||||
return inportb(SB_DSP_DATA_IN);
|
||||
}
|
||||
|
||||
static inline void __sb_dspreg_out(unsigned char reg, unsigned char val)
|
||||
{
|
||||
__sb_dsp_out(reg);
|
||||
__sb_dsp_out(val);
|
||||
}
|
||||
|
||||
static inline void __sb_dspreg_outwlh(unsigned char reg, unsigned short val)
|
||||
{
|
||||
__sb_dsp_out(reg);
|
||||
__sb_dsp_out(val);
|
||||
__sb_dsp_out(val >> 8);
|
||||
}
|
||||
|
||||
static inline void __sb_dspreg_outwhl(unsigned char reg, unsigned short val)
|
||||
{
|
||||
__sb_dsp_out(reg);
|
||||
__sb_dsp_out(val >> 8);
|
||||
__sb_dsp_out(val);
|
||||
}
|
||||
|
||||
static inline unsigned char __sb_dspreg_in(unsigned char reg)
|
||||
{
|
||||
__sb_dsp_out(reg);
|
||||
return __sb_dsp_in();
|
||||
}
|
||||
|
||||
static inline void __sb_dsp_ack_dma8()
|
||||
{
|
||||
inportb(SB_DSP_DMA8_IRQ);
|
||||
}
|
||||
|
||||
static inline void __sb_dsp_ack_dma16()
|
||||
{
|
||||
inportb(SB_DSP_DMA16_IRQ);
|
||||
}
|
||||
|
||||
static inline unsigned short __sb_dsp_version()
|
||||
{
|
||||
unsigned short ver;
|
||||
__sb_dsp_out(SBDSP_VERSION);
|
||||
__sb_dsp_ready_in();
|
||||
ver = ((unsigned short)__sb_dsp_in()) << 8;
|
||||
ver |= __sb_dsp_in();
|
||||
return ver;
|
||||
}
|
||||
|
||||
static inline void __sb_mixer_out(unsigned char reg, unsigned char val)
|
||||
{
|
||||
outportb(SB_MIXER_REGSEL, reg);
|
||||
outportb(SB_MIXER_DATA, val);
|
||||
}
|
||||
|
||||
static inline unsigned char __sb_mixer_in(unsigned char reg)
|
||||
{
|
||||
outportb(SB_MIXER_REGSEL, reg);
|
||||
return inportb(SB_MIXER_DATA);
|
||||
}
|
||||
|
||||
/* Enable stereo transfers: sbpro mode only */
|
||||
static inline void __sb_stereo(boolean stereo)
|
||||
{
|
||||
unsigned char val = __sb_mixer_in(SBMIX_OUTPUT_SELECT);
|
||||
if (stereo)
|
||||
val |= SBM_MIX_STEREO;
|
||||
else
|
||||
val &= ~SBM_MIX_STEREO;
|
||||
__sb_mixer_out(SBMIX_OUTPUT_SELECT, val);
|
||||
}
|
||||
|
||||
/* Detect whenever SoundBlaster is present and fill "sb" structure */
|
||||
extern boolean sb_detect();
|
||||
/* Reset SoundBlaster */
|
||||
extern void sb_reset();
|
||||
/* Start working with SoundBlaster */
|
||||
extern boolean sb_open();
|
||||
/* Finish working with SoundBlaster */
|
||||
extern boolean sb_close();
|
||||
/* Enable/disable speaker output */
|
||||
extern void sb_output(boolean enable);
|
||||
/* Start playing from DMA buffer in either 8/16 bit mono/stereo */
|
||||
extern boolean sb_start_dma(unsigned char mode, unsigned int freq);
|
||||
/* Stop playing from DMA buffer */
|
||||
extern void sb_stop_dma();
|
||||
/* Query current position/total size of the DMA buffer */
|
||||
extern void sb_query_dma(unsigned int *dma_size, unsigned int *dma_pos);
|
||||
|
||||
#endif /* __DOSSB_H__ */
|
||||
|
170
external/wildmidi-0.4.5/docs/formats/HmiFileFormat.txt
vendored
Normal file
170
external/wildmidi-0.4.5/docs/formats/HmiFileFormat.txt
vendored
Normal file
|
@ -0,0 +1,170 @@
|
|||
HMP File Format
|
||||
(Incomplete - Under Construction)
|
||||
|
||||
Document version 1
|
||||
Authored by Chris Ison chrisisonwildcode@gmail.com
|
||||
|
||||
Last Edited 24 May 2014
|
||||
|
||||
Copyright (C) 2014 WildMidi Developers
|
||||
This document is licensed under the
|
||||
Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||
To view a copy of this license, visit
|
||||
http://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
|
||||
Introduction
|
||||
|
||||
This document describes the HMI format as used by the WildMIDI project.
|
||||
It is not a complete description of the HMI file format and only those
|
||||
parts that have been decyphered and are relevant to the WildMidi project
|
||||
are described here. Unfortunately we cannot answer questions about the
|
||||
format that are not described within this document. If you feel there
|
||||
is an error in this document please feel free to report it as a bug at
|
||||
https://github.com/Mindwerks/wildmidi/issues/
|
||||
|
||||
|
||||
Description
|
||||
|
||||
// Header
|
||||
{
|
||||
char header[18] = "HMI-MIDISONG061595";
|
||||
char no_idea_1[196];
|
||||
char beats_per_minute;
|
||||
char no_idea_2[15];
|
||||
char track_count;
|
||||
char no_idea_3[141];
|
||||
{
|
||||
// Repeat for number of tracks in track_count
|
||||
char track_offset[4]; // Stored as little endian;
|
||||
}
|
||||
char no_idea_4[??]; // this is the remaining amout up to the first
|
||||
// track chunk marked by the first track offset.
|
||||
}
|
||||
|
||||
// Track Chunk
|
||||
{
|
||||
char track_header[] = "HMI-MIDITRACK";
|
||||
char no_idea_4[74];
|
||||
char track_header_size[4];
|
||||
char no_idea_5[(track_header_size - 91];
|
||||
|
||||
{
|
||||
// Repeat until end of track detected
|
||||
// ** NOTE ** Since track chunk has no length details,
|
||||
// you need to scan for end of track marker.
|
||||
char midi_delta[] = ???; // See MIDI Delta
|
||||
char midi_event[] = ???; // See MIDI Events
|
||||
// ** NOTE ** Note On event is slightly different to the
|
||||
// normal MIDI note on event. See MIDI Events below.
|
||||
// Last event in track chunk is end of track meta event,
|
||||
// defined as 0xff 0x2f 0x00.
|
||||
}
|
||||
{
|
||||
|
||||
// Extra Data
|
||||
{
|
||||
// Some HMI files have data after the tracks.
|
||||
// Details are unknown about these bytes of data.
|
||||
char no_idea_6[] = ???;
|
||||
}
|
||||
|
||||
|
||||
MIDI Delta
|
||||
|
||||
This is a variable length value that determins how time (in MIDI ticks)
|
||||
is to pass before the following MIDI event is to be processed.
|
||||
Just like MIDI's variable length values, HMI files have bit 7 set
|
||||
on the each value in the variable length value except the last one.
|
||||
A value of 255 would be stored as 0x81 0x7f, or a value of 1 would
|
||||
be stored as 0x01 in the HMI variable length format.
|
||||
|
||||
Examples:
|
||||
Delta of 255: < midi event > 0x81 0x7f < midi event>
|
||||
Delta of 127: < midi event > 0x7f < midi event >
|
||||
Delta of 65537: < midi event > 0x82 0x80 0x71 < midi event >
|
||||
|
||||
|
||||
MIDI Events
|
||||
|
||||
The first byte of a midi events is split into 2 x 4bits. Bits 7-4 is the
|
||||
command while bits 3-0 is the MIDI channel the command is to occur on.
|
||||
For example 0x94 means do command 9 on channel 4. The only exception to
|
||||
this is where bits 7-4 = F in hexidecimal as these are a special group
|
||||
of commands.
|
||||
|
||||
The following commands are detailed in this document with the channel
|
||||
information (bits 3 - 0) set to 0, example 0x80. However the channel
|
||||
information could have a value anywhere from 0 to F in hexidecimal.
|
||||
|
||||
// Note On Event
|
||||
{
|
||||
char cmd = 0x90;
|
||||
char note = 32; // Could be a value of 0 - 127
|
||||
char velocity = 100; // Could be a value of 0 - 127.
|
||||
// If this value is 0 then it
|
||||
// is treated as a note off
|
||||
char length[] = < variable length value >; // See MIDI Delta for example
|
||||
}
|
||||
|
||||
// Aftertouch Event
|
||||
{
|
||||
// See "Aftertouch Event" in MidFileFormat.txt
|
||||
}
|
||||
|
||||
// Controller Events
|
||||
{
|
||||
// See "Controller Events" in MidFileFormat.txt
|
||||
}
|
||||
|
||||
// Patch Event
|
||||
{
|
||||
// See "Patch Event" in MidFileFormat.txt
|
||||
}
|
||||
|
||||
// Preasure Event
|
||||
{
|
||||
// See "Pressure Event" in MidFileFormat.txt
|
||||
}
|
||||
|
||||
// Pitch Event
|
||||
{
|
||||
// See "Patch Event" in MidFileFormat.txt
|
||||
}
|
||||
|
||||
// Sysexs Events
|
||||
{
|
||||
// See "Sysex Events" in MidFileFormat.txt
|
||||
}
|
||||
|
||||
// HMI Events
|
||||
{
|
||||
// This is undocumented in specifications others have put together
|
||||
// so nothing other than the following is known about it.
|
||||
char cmd = 0xfe;
|
||||
|
||||
{
|
||||
char type = 0x10;
|
||||
char data_1[2];
|
||||
char size; // Could be anything from 0x00 to 0xff
|
||||
char data_2[size];
|
||||
char data_3[5];
|
||||
}
|
||||
// *** OR ***
|
||||
{
|
||||
char type = 0x15;
|
||||
char data[6];
|
||||
|
||||
}
|
||||
// *** OR ***
|
||||
{
|
||||
char type;
|
||||
char data[2];
|
||||
}
|
||||
}
|
||||
|
||||
// Meta Events
|
||||
{
|
||||
// See "Meta Events" MidFileFormat.txt
|
||||
}
|
||||
|
205
external/wildmidi-0.4.5/docs/formats/HmpFileFormat.txt
vendored
Normal file
205
external/wildmidi-0.4.5/docs/formats/HmpFileFormat.txt
vendored
Normal file
|
@ -0,0 +1,205 @@
|
|||
HMP File Format
|
||||
(Incomplete - Under Construction)
|
||||
|
||||
Document version 1
|
||||
Written by Chris Ison
|
||||
|
||||
Last Edited 24 May 2014
|
||||
|
||||
Copyright (C) 2014 WildMidi Developers
|
||||
This document is licensed under the
|
||||
Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||
To view a copy of this license, visit
|
||||
http://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
|
||||
Introduction
|
||||
|
||||
This document describes the HMP format as used by the WildMIDI project.
|
||||
It is not a complete description of the HMP file format and only those
|
||||
parts that are relevant to the WildMidi project are described here.
|
||||
Unfortunately we cannot answer questions about the format that are not
|
||||
described within this document. If you feel there is an error in this
|
||||
document please feel free to report it as a bug at
|
||||
https://github.com/Mindwerks/wildmidi/issues/
|
||||
|
||||
The HMP format comes in 2 versions. Apart from the file header there is
|
||||
no difference between the 2 versions as far WildMIDI is concerned.
|
||||
|
||||
|
||||
Description
|
||||
|
||||
// First version of hmp files
|
||||
{
|
||||
char header[] = "HMIMIDIP";
|
||||
char no_idea_1[24]; // All zeros
|
||||
}
|
||||
|
||||
// *** OR ***
|
||||
|
||||
// Second version of hmp files
|
||||
{
|
||||
char header[] = "HMIMIDIP013195";
|
||||
char no_idea_1[18]; // All zeros
|
||||
}
|
||||
|
||||
// The remaining header section of hmp files
|
||||
{ char file_length[4]; // File size minus header[] stored as little-endian
|
||||
char no_idea_2[16]; // All zeros
|
||||
char number_of_chunks[4]; // Number of chunks stored as little-endian
|
||||
char no_idea_3[4]; // Unknown
|
||||
char beats_per_minute[4]; // beats per minute stored as little-endian
|
||||
// *** NOTE: Using a division of 60 ***
|
||||
char song_length_s[4]; // length of song in seconds as little-endian
|
||||
}
|
||||
|
||||
// First version of hmp files
|
||||
{
|
||||
char no_idea4[712]; // Unknown
|
||||
// chunks start here
|
||||
}
|
||||
|
||||
// *** OR ***
|
||||
|
||||
// Second version of hmp files
|
||||
{
|
||||
char no_idea4[840]; // Unknown
|
||||
// chunks start here
|
||||
}
|
||||
|
||||
// Chunk information
|
||||
{
|
||||
char chunk_number[4]; // Stored as little-endian
|
||||
char chunk_length[4]; // Size of entire chunk stored as little-endian
|
||||
char track_number[4]; // Track numbe stored as little endian
|
||||
|
||||
{
|
||||
// Repeat until end of chunk
|
||||
char midi_delta[] = ???; // See MIDI Delta
|
||||
char midi_event[] = ???; // See MIDI Events
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MIDI Delta
|
||||
|
||||
This is a variable length value that determins how time (in MIDI ticks)
|
||||
is to pass before the following MIDI event is to be processed. Opposite
|
||||
to MIDI variable length values. In HMP files the variable length value
|
||||
is stored in LSB with bit 7 set off for all except the last 7 bit value.
|
||||
A value of 255 would be stored as 0x7f 0x81, or a value of 1 would be
|
||||
stored as 0x81 in the HMP variable length format.
|
||||
|
||||
Examples:
|
||||
Delta of 255: < midi event > 0x7f 0x81 < midi event>
|
||||
Delta of 127: < midi event > 0xff < midi event >
|
||||
Delta of 65537: < midi event > 0x7f 0x00 0x82 < midi event >
|
||||
|
||||
|
||||
MIDI Events
|
||||
|
||||
The first byte of a midi events is split into 2 x 4bits. Bits 7-4 is the
|
||||
command while bits 3-0 is the MIDI channel the command is to occur on.
|
||||
For example 0x94 means do command 9 on channel 4. The only exception to
|
||||
this is where bits 7-4 = F in hexidecimal as these are a special group
|
||||
of commands.
|
||||
|
||||
The following commands are detailed in this document with the channel
|
||||
information (bits 3 - 0) set to 0, example 0x80. However the channel
|
||||
information could have a value anywhere from 0x0 to 0xf.
|
||||
|
||||
For more detail about the folling MIDI command information please see
|
||||
MidiFileFormat.txt within the WildMIDI project source code.
|
||||
|
||||
// Note Off
|
||||
{
|
||||
char cmd = 0x80;
|
||||
char note = 27; // Could be a value of 0 - 127
|
||||
char velocity = 0; // Could be a value of 0 - 127. Ignored by WildMIDI
|
||||
}
|
||||
|
||||
// Note On
|
||||
{
|
||||
char cmd = 0x90;
|
||||
char note = 32; // Could be a value of 0 - 127
|
||||
char velocity = 100; // Could be a value of 0 - 127.
|
||||
// If this value is 0 then it is treated as a note of
|
||||
}
|
||||
|
||||
// Aftertouch
|
||||
{
|
||||
// Adjust the velocity of a note as if adjusting the preasure you
|
||||
// are placing on the key of a preasure sensitive keyboard after
|
||||
// you started playing it.
|
||||
|
||||
char cmd = 0xa0;
|
||||
char note = 32; // Could be a value of 0 - 127
|
||||
char velocity = 100; // Could be a value of 0 - 127.
|
||||
}
|
||||
|
||||
// Controller
|
||||
{
|
||||
char cmd = 0xb0;
|
||||
char controller = 32; // Could be a value of 0 - 127
|
||||
char setting = 100; // Could be a value of 0 - 127
|
||||
|
||||
/*
|
||||
In track 1 of HMP files controller 110 is set to 255 to
|
||||
mark the start of the looped events of tracks 2 & 3.
|
||||
Controller 111 in track 1 set to 128 to mark the end of
|
||||
the looped events of track 2 & 3.
|
||||
*/
|
||||
}
|
||||
|
||||
// Patch
|
||||
{
|
||||
/*
|
||||
Change the patch (or sound) used to play notes on the channel
|
||||
*/
|
||||
char cmd = 0xc0;
|
||||
char change_patch = 32; // Could be a value of 0 - 127
|
||||
}
|
||||
|
||||
// Preasure
|
||||
{
|
||||
/*
|
||||
Adjust the velocity of all active notes on the channel
|
||||
as if adjusting the preasure you are placing on the keys
|
||||
of a preasure sensitive keyboard after you started playing
|
||||
them.
|
||||
*/
|
||||
char cmd = 0xd0;
|
||||
char velocity = 32; // Could be a value of 0 - 127
|
||||
}
|
||||
|
||||
// Pitch
|
||||
{
|
||||
/*
|
||||
Adjust the pitch of a channel just like a pitch bend wheel does.
|
||||
*/
|
||||
char cmd = 0xe0;
|
||||
char data_1 = 32; // Could be a value of 0 - 127
|
||||
char data_2 = 100; // Could be a value of 0 - 127.
|
||||
}
|
||||
|
||||
// Sysex
|
||||
{
|
||||
** It is uncertain if sysex events will apepar in a HMP file **
|
||||
** but they have been included because it is possible **
|
||||
|
||||
char cmd = 0xf0;
|
||||
// *** OR ***
|
||||
char cmd = 0xf7;
|
||||
|
||||
char sysex_size[] = < variable length in MIDI file format >;
|
||||
char sysex_data[sysex_size] = ...; // Ending with 0xf7
|
||||
}
|
||||
|
||||
// Meta Events
|
||||
{
|
||||
char cmd = 0xff;
|
||||
char instruction = 0x02; // Could be 0 - 127
|
||||
char data_size[] = < variable length in MIDI file format >;
|
||||
char data[data_size];
|
||||
}
|
||||
|
331
external/wildmidi-0.4.5/docs/formats/MUSFileFormat.txt
vendored
Normal file
331
external/wildmidi-0.4.5/docs/formats/MUSFileFormat.txt
vendored
Normal file
|
@ -0,0 +1,331 @@
|
|||
MUS File Format
|
||||
═══════════════
|
||||
|
||||
Written by: Vladimir Arnost, QA-Software
|
||||
Updated: March 9, 1996
|
||||
Version: 1.31
|
||||
Internet: xarnos00@dcse.fee.vutbr.cz
|
||||
FIDO: 2:423/36.2
|
||||
|
||||
|
||||
1. General Description
|
||||
──────────────────────
|
||||
|
||||
A .MUS file is a simple clone of .MID file. It uses the same instruments,
|
||||
similar commands and the same principle: a list of sound events.
|
||||
It consists of two parts: header and body.
|
||||
|
||||
NOTE: All numerical values mentioned in this document are zero-based.
|
||||
If not specified otherwise, all numbers are given in decimal.
|
||||
Hexadecimal numbers are suffixed by 'h' (e.g. 5Ch). Bits are
|
||||
numbered in this fashion: LSB (right-most) = 0, MSB (left-most) = 7.
|
||||
|
||||
|
||||
2. MUS File Header
|
||||
──────────────────
|
||||
|
||||
The MUS header has the following structure:
|
||||
|
||||
struct MUSheader {
|
||||
char ID[4]; // identifier "MUS" 0x1A
|
||||
WORD scoreLen;
|
||||
WORD scoreStart;
|
||||
WORD channels; // count of primary channels
|
||||
WORD sec_channels; // count of secondary channels
|
||||
WORD instrCnt;
|
||||
WORD dummy;
|
||||
// variable-length part starts here
|
||||
WORD instruments[];
|
||||
};
|
||||
|
||||
NOTE: WORD is a 16-bit unsigned integer (little-endian)
|
||||
|
||||
The header has two parts: the fixed-length and the variable-length part.
|
||||
The former contains file identifier, score start and length, number of
|
||||
channels and number of used instruments. The latter part is actually
|
||||
a list of used instruments. The instruments are stored as numbers which
|
||||
are arranged in this fashion:
|
||||
|
||||
Instrument Number Meaning
|
||||
0 - 127 standard MIDI instruments
|
||||
135 - 181 standard MIDI percussions (notes 35 - 81)
|
||||
|
||||
`scoreStart' is the absolute file position of the score and `scoreLen' is
|
||||
its length in bytes. Usage of a 16-bit number as length limits .MUS file
|
||||
size to 64KB.
|
||||
|
||||
`channels' tells you how many channels are utilized in the song. The
|
||||
channel number 15 (percussions) is not included in the sum.
|
||||
|
||||
|
||||
3. MUS File Body
|
||||
────────────────
|
||||
|
||||
Unlike MID files, MUS body contains only one track. File body is
|
||||
a sequence of sound events and time records. A sound event consists of
|
||||
one or more bytes encoded as follows:
|
||||
|
||||
1st byte -- event descriptor:
|
||||
╓──7─┬──6─┬──5─┬──4─┬──3─┬──2─┬──1─┬──0─╖
|
||||
║Last│ Event type │ Channel number ║
|
||||
╙────┴────┴────┴────┴────┴────┴────┴────╜
|
||||
|
||||
`Event type' is one of these:
|
||||
0 - release note
|
||||
1 - play note
|
||||
2 - pitch wheel (bender)
|
||||
3 - system event (valueless controller)
|
||||
4 - change controller
|
||||
5 - ???
|
||||
6 - score end
|
||||
7 - ???
|
||||
|
||||
`Channel number' determines which channel this event refers to.
|
||||
Channels provide only logical score division. Every channel
|
||||
carries its own settings (instrument #, panning, volume) and the
|
||||
channel number specifies only which settings to use. In general,
|
||||
the channel number itself is almost irrelevant and may be chosen
|
||||
arbitrarily within the interval 0 to 14. The only exception is
|
||||
the channel number 15, which is dedicated ONLY to percussions.
|
||||
|
||||
`Last' - if set, the event is followed by time information. This
|
||||
means that this is the last event in a group of events which
|
||||
occur at the same time. The time information is a number of
|
||||
ticks to wait before processing next event. One tick is usually
|
||||
1/140 sec (in Doom I, II and Heretic; Raptor uses 1/70 sec).
|
||||
|
||||
Time information can be read in this way:
|
||||
1. time = 0
|
||||
2. READ a byte
|
||||
3. time = time * 128 + byte AND 127
|
||||
4. IF (byte AND 128) GO TO 2
|
||||
5. RETURN time
|
||||
The time info is a series of 7-bit chunks. The bit #7 is set
|
||||
until the last byte whose bit 7 is zero. This scheme allows
|
||||
small numbers occupy less space than large ones.
|
||||
|
||||
Event Type
|
||||
────────────────────
|
||||
0 Release note
|
||||
╓─7─┬─6─┬─5─┬─4─┬─3─┬─2─┬─1─┬─0─╖
|
||||
║ 0 │ Note number 0 - 127 ║
|
||||
╙───┴───┴───┴───┴───┴───┴───┴───╜
|
||||
|
||||
1 Play note
|
||||
╓─7─┬─6─┬─5─┬─4─┬─3─┬─2─┬─1─┬─0─╖ ╓─7─┬─6─┬─5─┬─4─┬─3─┬─2─┬─1─┬─0─╖
|
||||
║Vol│ Note number 0 - 127 ║ ║ 0 │ Note volume 0 - 127 ║
|
||||
╙───┴───┴───┴───┴───┴───┴───┴───╜ ╙───┴───┴───┴───┴───┴───┴───┴───╜
|
||||
|
||||
`Note volume' is present only if `Vol' bit is set. Otherwise the
|
||||
previous value is used and the second byte is not present.
|
||||
NOTE: Each channel keeps track of its own last volume value.
|
||||
More than one note can be played at once in one channel.
|
||||
Channel 15 is dedicated to drums and percussions. `Note number'
|
||||
acts as an instrument selector there. See Appendix C
|
||||
|
||||
2 Pitch wheel
|
||||
╓─7─┬─6─┬─5─┬─4─┬─3─┬─2─┬─1─┬─0─╖
|
||||
║ Pitch wheel value ║
|
||||
╙───┴───┴───┴───┴───┴───┴───┴───╜
|
||||
|
||||
Sets pitch wheel (bender) value of a channel. Some handy values are
|
||||
shown in the table (all values in the range 0-255 can be used):
|
||||
|
||||
┌───────┬───────────────────────┐
|
||||
│ Value │ Pitch change │
|
||||
├───────┼───────────────────────┤
|
||||
│ 0 │ two half-tones down │
|
||||
│ 64 │ one half-tone down │
|
||||
│ 128 │ normal (default) │
|
||||
│ 192 │ one half-tone up │
|
||||
│ 255 │ two half-tones up │
|
||||
└───────┴───────────────────────┘
|
||||
|
||||
3 System event (Valueless controller)
|
||||
╓─7─┬─6─┬─5─┬─4─┬─3─┬─2─┬─1─┬─0─╖
|
||||
║ 0 │ Number ║
|
||||
╙───┴───┴───┴───┴───┴───┴───┴───╜
|
||||
|
||||
Number MIDI ctrl Description
|
||||
10 120 (78h) All sounds off
|
||||
11 123 (7Bh) All notes off
|
||||
12 126 (7Eh) Mono
|
||||
13 127 (7Fh) Poly
|
||||
14 121 (79h) Reset all controllers
|
||||
|
||||
NOTE: The second column (MIDI ctrl) lists the corresponding MIDI
|
||||
controller number. It is not needed unless you want to
|
||||
convert MUS file data to MIDI.
|
||||
|
||||
4 Change controller
|
||||
╓─7─┬─6─┬─5─┬─4─┬─3─┬─2─┬─1─┬─0─╖ ╓─7─┬─6─┬─5─┬─4─┬─3─┬─2─┬─1─┬─0─╖
|
||||
║ 0 │ Controller number ║ ║ 0 │ Controller value ║
|
||||
╙───┴───┴───┴───┴───┴───┴───┴───╜ ╙───┴───┴───┴───┴───┴───┴───┴───╜
|
||||
|
||||
Number MIDI ctrl Description
|
||||
0 N/A Instrument (patch, program) number
|
||||
1 0 or 32 Bank select: 0 by default
|
||||
2 1 (01h) Modulation pot (frequency vibrato depth)
|
||||
3 7 (07h) Volume: 0-silent, ~100-normal, 127-loud
|
||||
4 10 (0Ah) Pan (balance) pot: 0-left, 64-center (default),
|
||||
127-right
|
||||
5 11 (0Bh) Expression pot
|
||||
6 91 (5Bh) Reverb depth
|
||||
7 93 (5Dh) Chorus depth
|
||||
8 64 (40h) Sustain pedal (hold)
|
||||
9 67 (43h) Soft pedal
|
||||
|
||||
NOTE: MUS controller 0 has no equivalent MIDI controller, but
|
||||
is encoded as MIDI event 0Cxh--patch change (`x' is the
|
||||
channel number)
|
||||
|
||||
5 Unknown
|
||||
Not known what data (if any) this command takes.
|
||||
|
||||
6 Score end
|
||||
No data.
|
||||
|
||||
Marks the end of score. Must be present at the end, otherwise the
|
||||
player may go off the rails. In DOOM this command restarts playing.
|
||||
|
||||
7 Unknown
|
||||
Not known what data (if any) this command takes.
|
||||
|
||||
|
||||
APPENDIX A - Note numbers
|
||||
─────────────────────────
|
||||
|
||||
╔════════╦═════╤════╤════╤════╤════╤════╤════╤════╤════╤════╤════╤════╗
|
||||
║ Octave ║ C │ C# │ D │ D# │ E │ F │ F# │ G │ G# │ A │ A# │ B ║
|
||||
╠════════╬═════╪════╪════╪════╪════╪════╪════╪════╪════╪════╪════╪════╣
|
||||
║ 0 ║ 0 │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 10 │ 11 ║
|
||||
║ 1 ║ 12 │ 13 │ 14 │ 15 │ 16 │ 17 │ 18 │ 19 │ 20 │ 21 │ 22 │ 23 ║
|
||||
║ 2 ║ 24 │ 25 │ 26 │ 27 │ 28 │ 29 │ 30 │ 31 │ 32 │ 33 │ 34 │ 35 ║
|
||||
║ 3 ║ 36 │ 37 │ 38 │ 39 │ 40 │ 41 │ 42 │ 43 │ 44 │ 45 │ 46 │ 47 ║
|
||||
║ 4 ║ 48 │ 49 │ 50 │ 51 │ 52 │ 53 │ 54 │ 55 │ 56 │ 57 │ 58 │ 59 ║
|
||||
║ 5 ║ 60 │ 61 │ 62 │ 63 │ 64 │ 65 │ 66 │ 67 │ 68 │ 69 │ 70 │ 71 ║
|
||||
║ 6 ║ 72 │ 73 │ 74 │ 75 │ 76 │ 77 │ 78 │ 79 │ 80 │ 81 │ 82 │ 83 ║
|
||||
║ 7 ║ 84 │ 85 │ 86 │ 87 │ 88 │ 89 │ 90 │ 91 │ 92 │ 93 │ 94 │ 95 ║
|
||||
║ 8 ║ 96 │ 97 │ 98 │ 99 │100 │101 │102 │103 │104 │105 │106 │107 ║
|
||||
║ 9 ║ 108 │109 │110 │111 │112 │113 │114 │115 │116 │117 │118 │119 ║
|
||||
║ 10 ║ 120 │121 │122 │123 │124 │125 │126 │127 │ │ │ │ ║
|
||||
╚════════╩═════╧════╧════╧════╧════╧════╧════╧════╧════╧════╧════╧════╝
|
||||
|
||||
|
||||
APPENDIX B - Instrument Patch Map
|
||||
─────────────────────────────────
|
||||
|
||||
Block 0-7 PIANO Block 8-15 CHROM PERCUSSION
|
||||
0 Acoustic Grand Piano 8 Celesta
|
||||
1 Bright Acoustic Piano 9 Glockenspiel
|
||||
2 Electric Grand Piano 10 Music Box
|
||||
3 Honky-tonk Piano 11 Vibraphone
|
||||
4 Rhodes Paino 12 Marimba
|
||||
5 Chorused Piano 13 Xylophone
|
||||
6 Harpsichord 14 Tubular-bell
|
||||
7 Clavinet 15 Dulcimer
|
||||
|
||||
Block 16-23 ORGAN Block 24-31 GUITAR
|
||||
16 Hammond Organ 24 Acoustic Guitar (nylon)
|
||||
17 Percussive Organ 25 Acoustic Guitar (steel)
|
||||
18 Rock Organ 26 Electric Guitar (jazz)
|
||||
19 Church Organ 27 Electric Guitar (clean)
|
||||
20 Reed Organ 28 Electric Guitar (muted)
|
||||
21 Accordion 29 Overdriven Guitar
|
||||
22 Harmonica 30 Distortion Guitar
|
||||
23 Tango Accordion 31 Guitar Harmonics
|
||||
|
||||
Block 32-39 BASS Block 40-47 STRINGS
|
||||
32 Acoustic Bass 40 Violin
|
||||
33 Electric Bass (finger) 41 Viola
|
||||
34 Electric Bass (pick) 42 Cello
|
||||
35 Fretless Bass 43 Contrabass
|
||||
36 Slap Bass 1 44 Tremolo Strings
|
||||
37 Slap Bass 2 45 Pizzicato Strings
|
||||
38 Synth Bass 1 46 Orchestral Harp
|
||||
39 Synth Bass 2 47 Timpani
|
||||
|
||||
Block 48-55 ENSEMBLE Block 56-63 BRASS
|
||||
48 String Ensemble 1 56 Trumpet
|
||||
49 String Ensemble 2 57 Trombone
|
||||
50 Synth Strings 1 58 Tuba
|
||||
51 Synth Strings 2 59 Muted Trumpet
|
||||
52 Choir Aahs 60 French Horn
|
||||
53 Voice Oohs 61 Brass Section
|
||||
54 Synth Voice 62 Synth Brass 1
|
||||
55 Orchestra Hit 63 Synth Bass 2
|
||||
|
||||
Block 64-71 REED Block 72-79 PIPE
|
||||
64 Soprano Sax 72 Piccolo
|
||||
65 Alto Sax 73 Flute
|
||||
66 Tenor Sax 74 Recorder
|
||||
67 Baritone Sax 75 Pan Flute
|
||||
68 Oboe 76 Bottle Blow
|
||||
69 English Horn 77 Shakuhachi
|
||||
70 Bassoon 78 Whistle
|
||||
71 Clarinet 79 Ocarina
|
||||
|
||||
Block 80-87 SYNTH LEAD Block 88-95 SYNTH PAD
|
||||
80 Lead 1 (square) 88 Pad 1 (new age)
|
||||
81 Lead 2 (sawtooth) 89 Pad 2 (warm)
|
||||
82 Lead 3 (calliope) 90 Pad 3 (polysynth)
|
||||
83 Lead 4 (chiffer) 91 Pad 4 (choir)
|
||||
84 Lead 5 (charang) 92 Pad 5 (bowed glass)
|
||||
85 Lead 6 (voice) 93 Pad 6 (metal)
|
||||
86 Lead 7 (5th sawtooth) 94 Pad 7 (halo)
|
||||
87 Lead 8 (bass & lead) 95 Pad 8 (sweep)
|
||||
|
||||
Block 96-103 SYNTH EFFECTS Block 104-111 ETHNIC
|
||||
96 FX 1 (rain) 104 Sitar
|
||||
97 FX 2 (soundtrack) 105 Banjo
|
||||
98 FX 3 (crystal) 106 Shamisen
|
||||
99 FX 4 (atmosphere) 107 Koto
|
||||
100 FX 5 (brightness) 108 Kalimba
|
||||
101 FX 6 (goblin) 109 Bag Pipe
|
||||
102 FX 7 (echo drops) 110 Fiddle
|
||||
103 FX 8 (star-theme) 111 Shanai
|
||||
|
||||
Block 112-119 PERCUSSIVE Block 120-127 SOUND EFFECTS
|
||||
112 Tinkle Bell 120 Guitar Fret Noise
|
||||
113 Agogo 121 Breath Noise
|
||||
114 Steel Drums 122 Seashore
|
||||
115 Woodblock 123 Bird Tweet
|
||||
116 Taiko Drum 124 Telephone Ring
|
||||
117 Melodic Tom 125 Helicopter
|
||||
118 Synth Drum 126 Applause
|
||||
119 Reverse Cymbal 127 Gun Shot
|
||||
|
||||
|
||||
APPENDIX C - Percussion Key Map
|
||||
───────────────────────────────
|
||||
|
||||
In channel #15, the note number does not affect the pitch but
|
||||
the instrument type. The default pitch for percussions is 60 (C-5).
|
||||
|
||||
Note Instrument Note Instrument
|
||||
|
||||
35 Acoustic Bass Drum 59 Ride Cymbal 2
|
||||
36 Bass Drum 60 High Bongo
|
||||
37 Slide Stick 61 Low Bango
|
||||
38 Acoustic Snare 62 Mute High Conga
|
||||
39 Hand Clap 63 Open High Conga
|
||||
40 Electric Snare 64 Low Conga
|
||||
41 Low Floor Tom 65 High Timbale
|
||||
42 Closed High-Hat 66 Low Timbale
|
||||
43 High Floor Tom 67 High Agogo
|
||||
44 Pedal High Hat 68 Low Agogo
|
||||
45 Low Tom 69 Cabasa
|
||||
46 Open High Hat 70 Maracas
|
||||
47 Low-Mid Tom 71 Short Whistle
|
||||
48 High-Mid Tom 72 Long Whistle
|
||||
49 Crash Cymbal 1 73 Short Guiro
|
||||
50 High Tom 74 Long Guiro
|
||||
51 Ride Cymbal 1 75 Claves
|
||||
52 Chinses Cymbal 76 High Wood Block
|
||||
53 Ride Bell 77 Low Wood Block
|
||||
54 Tambourine 78 Mute Cuica
|
||||
55 Splash Cymbal 79 Open Cuica
|
||||
56 Cowbell 80 Mute Triangle
|
||||
57 Crash Cymbal 2 81 Open Triangle
|
||||
58 Vibraslap
|
||||
|
542
external/wildmidi-0.4.5/docs/formats/XMIFileFormat-AIL.txt
vendored
Normal file
542
external/wildmidi-0.4.5/docs/formats/XMIFileFormat-AIL.txt
vendored
Normal file
|
@ -0,0 +1,542 @@
|
|||
|
||||
|
||||
|
||||
|
||||
IBM Audio Interface Library
|
||||
|
||||
Extended MIDI (XMIDI) Specification
|
||||
|
||||
Release 1.02 of 17 August 1992
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Contents
|
||||
|
||||
Overview ........................................................... 3
|
||||
Extended MIDI Controller Reference ................................. 4
|
||||
Extended MIDI IFF (.XMI) Structure ................................. 11
|
||||
Extended MIDI Global Timbre Library File Format .................... 13
|
||||
Glossary of Audio Interface Library Terms .......................... 14
|
||||
Overview
|
||||
|
||||
The term 'Extended MIDI,' or 'XMIDI,' refers to the set of features added to the base Musical
|
||||
Instrument Digital Interface (MIDI) data specification by the drivers and utility programs
|
||||
included with the Audio Interface Library's Version 2.00 release. The XMIDI standard brings
|
||||
many powerful features to the Audio Interface Library which would otherwise be absent in a
|
||||
system conforming to the original MIDI standard.
|
||||
|
||||
Composers who are interested in getting started with XMIDI should pay particular attention to
|
||||
the descriptions of the utility programs MIDIFORM, GLIB, MIDIECHO, and CAKEPORT
|
||||
in the Tools Reference section of this manual, before moving on to the specific discussions of
|
||||
the Extended MIDI controllers below. It is strongly recommended that musicians with even the
|
||||
slightest programming knowledge (or interest) examine the Application Program Interface
|
||||
Reference section as well, in order to gain the best possible understanding of the Audio
|
||||
Interface Library's capabilities.
|
||||
|
||||
Programmers seeking to master effective Audio Interface Library application design are also
|
||||
advised to familiarize themselves with the Tools Reference section, followed by a thorough
|
||||
perusal of the Application Program Interface Reference and Technical Notes. Special attention
|
||||
should be given to the Programming Examples section as well. The chapters in this section on
|
||||
the two primary XMIDI file formats are provided for reference only.
|
||||
|
||||
Users planning to upgrade Audio Interface Library Version 1 MIDI applications to the XMIDI
|
||||
standard should begin with an understanding of the MIDIFORM and GLIB programs and how
|
||||
they create and manage the new system's data file formats. Virtually all of the Version 1 API
|
||||
functions have been retained, but many have undergone revision or syntactic changes as part of
|
||||
the Version 2.0 release. A careful review of the Application Program Interface Reference and
|
||||
Programming Examples sections will ease the transition to the new API.
|
||||
Extended MIDI Controller Reference
|
||||
|
||||
XMIDI provides a number of additional MIDI-style Control Change messages which greatly
|
||||
extend the range of composition and arrangement options available to the musician and
|
||||
application programmer. Below is a list of Extended MIDI Control Change messages available
|
||||
in the current Audio Interface Library release, together with explanations of their uses in
|
||||
XMIDI sequences.
|
||||
|
||||
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
³ Controller ³ Description ³
|
||||
ÆÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͵
|
||||
³ 110 (6eh) ³ Channel Lock ³
|
||||
³ 111 (6fh) ³ Channel Lock Protect ³
|
||||
³ 112 (70h) ³ Voice Protect ³
|
||||
³ 113 (71h) ³ Timbre Protect ³
|
||||
³ 114 (72h) ³ Patch Bank Select ³
|
||||
³ 115 (73h) ³ Indirect Controller Prefix ³
|
||||
³ 116 (74h) ³ For Loop Controller ³
|
||||
³ 117 (75h) ³ Next/Break Loop Controller ³
|
||||
³ 118 (76h) ³ Clear Beat/Bar Count ³
|
||||
³ 119 (77h) ³ Callback Trigger ³
|
||||
³ 120 (78h) ³ Sequence Branch Index ³
|
||||
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
|
||||
Channel Lock (110)
|
||||
|
||||
< 64: Release previously locked channel and restore default channel
|
||||
number mapping
|
||||
|
||||
>= 64: Seize ("lock") an unlocked, unprotected physical MIDI channel
|
||||
(2-9) for assignment to this logical channel # (11-16)
|
||||
|
||||
The Channel Lock controller is one of the more powerful Extended MIDI controllers. Channel
|
||||
locking allows the XMIDI drivers to play multiple XMIDI sequences simultaneously, which in
|
||||
turn permits the creation of impressive sound effects and musical "mixes."
|
||||
|
||||
When used with a value greater than or equal to 64, the Channel Lock controller attempts to
|
||||
seize, or "lock," the highest MIDI channel number recognized by the driver's supported
|
||||
synthesizer which has the fewest actively playing notes. Channels which are already locked, or
|
||||
which have been "protected" against locking by use of the XMIDI Channel Lock Protect
|
||||
controller (111), are immune to seizure. If no available MIDI channels are eligible for locking
|
||||
under these criteria, the controller will have no effect. (This will occur only if all unprotected
|
||||
channels are already locked.)
|
||||
|
||||
After a MIDI channel has been successfully locked, the driver maps the locked channel onto
|
||||
the MIDI channel in which the Channel Lock controller itself appeared. This means that all
|
||||
subsequent MIDI events sent on the same channel as the Channel Lock controller (the "logical"
|
||||
channel) will instead be transmitted on the newly locked (or "physical") channel.
|
||||
This concept is perhaps best illustrated with a typical application of channel locking. Below is
|
||||
a list of events comprising a short XMIDI sequence to create a "machine gun" sound effect.
|
||||
(Timing and note velocity information has been omitted for simplicity.)
|
||||
|
||||
Ch 02 Controller 114 = 1 ;XMIDI Patch Bank Select = 1
|
||||
Ch 02 Patch = 5 ;MIDI Program Change to patch 5 ("gunshot")
|
||||
Ch 02 Pitch Wheel 0 ;Pitch bend centered (no bend)
|
||||
Ch 02 Controller 1 = 0 ;Modulation = 0
|
||||
Ch 02 Controller 7 = 127 ;Volume = 127
|
||||
Ch 02 Controller 10 = 64 ;Panpot = 64 (center of stereo field)
|
||||
Ch 02 Controller 116 = 5 ;FOR loop = 1 to 5...
|
||||
Ch 02 Note C 5 on ;...sound a brief "gunshot" note...
|
||||
Ch 02 Note C 5 off
|
||||
Ch 02 Controller 116 = 127 ;...NEXT loop
|
||||
|
||||
This "machine gun" sequence would be ideal for use as part of an arcade game's sound-effects
|
||||
arsenal, except for one serious drawback: what happens if MIDI channel 2 is already being
|
||||
used by a background music sequence, or perhaps another sound effect? The controller values
|
||||
and patch change in the sequence above would certainly have an unfavorable effect on a
|
||||
romantic violin solo playing on channel 2. The problem could be solved by setting aside a
|
||||
block of active MIDI channels for use with overlaid sound-effects sequences, but this might be
|
||||
an unacceptable compromise for applications requiring playback of any but the simplest XMIDI
|
||||
sequences.
|
||||
|
||||
Channel locking and remapping is a much more satisfactory solution. When composing
|
||||
sequences for the XMIDI standard, the composer could assign all tracks in sound effects and
|
||||
other overlaid sequences to MIDI channels in the range 11 through 16. MIDI channels in this
|
||||
range are not normally recognized by synthesizers supported by the AIL. But if an XMIDI
|
||||
Channel Lock controller is then inserted before the first Channel Voice event in the channel,
|
||||
the AIL driver can temporarily reassign a physical MIDI channel to the out-of-range logical
|
||||
channel number, preventing the channel's use by any other sequence being played for as long
|
||||
as it is needed by the sequence which "locked" the channel. A not-so-obvious benefit of this
|
||||
scheme is that all sound-effects sequences can safely share the same logical channel numbers
|
||||
between 11 and 16, since only the physical channel numbers recognized by the synthesizer are
|
||||
vulnerable to usage conflicts.
|
||||
|
||||
With channel locking installed, the machine gun sound-effect sequence might look like this:
|
||||
|
||||
Ch 11 Controller 110 = 127 ;XMIDI Channel Lock (seize channel)
|
||||
Ch 11 Controller 114 = 1 ;XMIDI Patch Bank Select = 1
|
||||
Ch 11 Patch = 5 ;MIDI Program Change to patch 5 ("gunshot")
|
||||
Ch 11 Pitch Wheel 0 ;Pitch bend centered (no bend)
|
||||
Ch 11 Controller 1 = 0 ;Modulation = 0
|
||||
Ch 11 Controller 7 = 127 ;Volume = 127
|
||||
Ch 11 Controller 10 = 64 ;Panpot = 64 (center of stereo field)
|
||||
Ch 11 Controller 116 = 5 ;FOR loop = 1 to 5...
|
||||
Ch 11 Note C 5 on ;...sound a brief "gunshot" note...
|
||||
Ch 11 Note C 5 off
|
||||
Ch 11 Controller 116 = 127 ;...NEXT loop
|
||||
Ch 11 Controller 110 = 0 ;XMIDI Channel Lock (release channel)The sequence's new final event, a Channel Lock controller with the value 0, is actually
|
||||
unnecessary since all channels locked by a sequence are released automatically as soon as the
|
||||
sequence ends or playback is stopped. However, in sequences with multiple tracks, it is a
|
||||
good idea to explicitly release each locked channel as soon as it is no longer needed by the
|
||||
sequence, instead of waiting for all tracks to expire. This allows the XMIDI driver to restore
|
||||
the channel to the sequence from which it was "stolen," minimizing the disruption to the
|
||||
background music.
|
||||
|
||||
When a locked channel is released, either through a Channel Lock controller with a value
|
||||
below 64 or through a C call to the analogous AIL_release_channel() function, the timbre
|
||||
bank, patch number, pitch wheel, and MIDI controllers in the channel are updated to their
|
||||
correct values before being returned to the service of the original sequence. This relieves the
|
||||
application of the responsibility of keeping track of these values while a channel is locked.
|
||||
Conversely, when a channel is locked by a Channel Lock controller or its complementary
|
||||
AIL_lock_channel() function, the MIDI Sustain (Hold1) controller (64) in the channel is
|
||||
forced to its "off" condition and all notes playing in the channel are silenced. No other
|
||||
controller values or MIDI messages are initialized! It is essential for a sequence (or an
|
||||
application) which has just received a locked channel to initialize all MIDI parameters,
|
||||
including MIDI controllers likely to contain undesirable values, the XMIDI Patch Bank Select
|
||||
controller and MIDI Program Change number, and the MIDI pitch wheel, to appropriate
|
||||
values. (Avoid the temptation to accomplish this with MIDI Channel Mode messages such as
|
||||
All Notes Off or Reset All Controllers. Channel Mode messages may be interpreted differently
|
||||
by various synthesizers, and the XMIDI driver code which maintains sequence state tables and
|
||||
other data structures makes no attempt to interpret them at all.)
|
||||
Channel Lock Protect (111)
|
||||
|
||||
< 64: Channel is eligible for temporary reassignment by
|
||||
AIL_lock_channel() or Channel Lock controllers
|
||||
|
||||
>= 64: Channel may not be locked (seized for reassignment)
|
||||
|
||||
Occasionally it may be desirable to prevent any sequence or application process from
|
||||
interrupting traffic on a given MIDI channel. Depending on its value, the XMIDI Channel
|
||||
Lock Protect controller will either render the physical MIDI channel in which it appears
|
||||
immune to seizure, or allow it to be considered for seizure when a Channel Lock controller
|
||||
message or AIL_lock_channel() call is issued.
|
||||
|
||||
Voice Protect (112)
|
||||
|
||||
< 64: Voices playing in channel assume normal priority (release voice
|
||||
protection)
|
||||
|
||||
>= 64: Voices playing in channel assume highest possible priority (assert
|
||||
voice protection)
|
||||
|
||||
Available on some synthesizers, voice protection is an XMIDI feature which allows a sequence
|
||||
to discourage the polyphonic voice assignment algorithm from "stealing" synthesizer voices
|
||||
from notes played in a given MIDI channel when no free voices are available. If the Voice
|
||||
Protect controller's value is less than 64, voices assigned to notes playing in the channel will be
|
||||
considered for reassignment to play incoming note events. This is the default condition for
|
||||
each channel. Otherwise, the "voice priority" of notes in the channel will constantly assume its
|
||||
maximum value, preventing the channel's notes from being robbed of their voices. Voice
|
||||
protection should be used conservatively and released as soon as possible, since the synthesizer
|
||||
emulation code works best when allowed to make its own decisions regarding voice allocation.
|
||||
|
||||
Timbre Protect (113)
|
||||
|
||||
< 64: Timbre currently assigned to this channel's patch may be
|
||||
"discarded" (if least-recently-used) to make room in local timbre
|
||||
cache or synthesizer memory
|
||||
|
||||
>= 64: Timbre may not be discarded from cache or synthesizer memory
|
||||
|
||||
For information on timbre protection, refer to the descriptions of the AIL_protect_timbre() /
|
||||
AIL_unprotect_timbre() functions in the Application Program Interface Reference section of
|
||||
this manual.
|
||||
Patch Bank Select (114)
|
||||
|
||||
This controller may be used to "extend" the scope of MIDI Program Change (or Cakewalk
|
||||
"Patch") messages. Normally, any of 128 synthesizer patches may be selected with a Program
|
||||
Change message; however, the Patch Bank Select controller instructs the AIL XMIDI driver to
|
||||
associate custom timbres in any of 127 banks with synthesizer patches which are subsequently
|
||||
selected in a channel.
|
||||
|
||||
By convention, patch bank 0 is reserved for the Roland MT-32's built-in patch/timbre
|
||||
combinations, and for the Ad Lib-style instruments intended to emulate those patches. Custom
|
||||
Roland timbres (and their Ad Lib counterparts) should be placed in patch banks 1 through 126.
|
||||
Timbre bank 127 is reserved for custom "drum kit" timbres to be used when playing note
|
||||
events on MIDI channel 10.
|
||||
|
||||
When a MIDI Program Change (or "patch") event is encountered, the XMIDI synthesizer
|
||||
driver looks in its collection of timbres from the Global Timbre Library for a custom timbre
|
||||
whose "patch number" is the specified Program Change number and whose "bank" is equal to
|
||||
the current Patch Bank Select controller value. If the timbre is found, the synthesizer is
|
||||
automatically instructed to associate the timbre with the patch which was just selected by the
|
||||
Program Change event. Under normal circumstances, the search for the requested timbre
|
||||
should not fail, since the application should have been informed in advance of the need for the
|
||||
timbre via the AIL_timbre_request() function. (See the Application Program Interface
|
||||
Reference section of this manual for more information on XMIDI timbre management.)
|
||||
|
||||
The default Patch Bank Select controller value is 0. Therefore, AIL applications which do not
|
||||
require custom Roland MT-32 timbres may disregard this controller altogether. Otherwise,
|
||||
care must be taken to explicitly specify the Timbre Bank Select controller value to be used in
|
||||
each channel of every sequence and sound effect used by the application, since the default
|
||||
value of 0 is asserted only upon driver initialization -- not when a channel is locked or when a
|
||||
sequence stops.
|
||||
|
||||
Indirect Controller Prefix (115)
|
||||
|
||||
This controller specifies that the next Control Change message encountered in this channel
|
||||
should obtain its value from the Indirect Controller Array's nth byte entry, where n is the
|
||||
indirect controller prefix's own value. For more information on the Indirect Controller Array,
|
||||
see the AIL_register_sequence() function description in the Application Program Interface
|
||||
Reference section of this manual.
|
||||
For Loop Controller (116)
|
||||
|
||||
1-127: Define beginning of MIDI data block to be played a total of v
|
||||
times, where v is the For loop controller's value
|
||||
|
||||
0: Define beginning of MIDI data block to be played indefinitely
|
||||
|
||||
This controller allows the creation of a loop within an XMIDI sequence. Its use is almost self-
|
||||
explanatory, especially for those familiar with BASIC or C's "for...next" construct. A loop
|
||||
value of 1 causes the block of MIDI/XMIDI events between the For controller and its
|
||||
corresponding Next/Break controller to be executed precisely once -- as if the controllers did
|
||||
not exist. Values from 2 to 127 cause the event block to be executed from 2 to 127 times. A
|
||||
value of 0, on the other hand, causes the event block to loop indefinitely, interruptable only at
|
||||
the application's request.
|
||||
|
||||
There are four rules to bear in mind when using For...Next/Break loops:
|
||||
|
||||
* At least one XMIDI 'quantization interval' must separate the For and
|
||||
Next/Break loop controllers. In practice, this means that more than
|
||||
1/120 second (8.4 milliseconds) of real time must elapse between these
|
||||
two events during playback. Otherwise, the application will "hang"
|
||||
forever with interrupts disabled, since neither the For nor the
|
||||
Next/Break controller automatically terminates the current interval.
|
||||
|
||||
* The branching effect caused by a Next/Break controller does not result
|
||||
in the note queue being flushed, unlike the operation of the
|
||||
AIL_branch_index() function. Only the sequence pointer is adjusted by
|
||||
the Next/Break controller. Refer to the AIL_branch_index() function
|
||||
description in the Application Program Interface Reference for
|
||||
additional notes about sequence branching in general.
|
||||
|
||||
* Multi-track MIDI Format 1 files are converted to MIDI Format 0 during
|
||||
the MIDIFORM program's XMIDI compilation process. This implies that
|
||||
loops placed on a single track will actually cause events in all other
|
||||
tracks to be repeated as well. In situations where it is desired to
|
||||
loop tracks independently of each other, a possible solution is to
|
||||
split the tracks into multiple XMIDI sequences and have the application
|
||||
play each sequence simultaneously.
|
||||
|
||||
* For...Next/Break controller loops may be nested up to 4 levels deep.
|
||||
Next/Break Loop Controller (117)
|
||||
|
||||
< 64: (Break) Loop iteration stops, regardless of the current For loop
|
||||
count
|
||||
|
||||
>= 64: (Next) Decrement innermost For loop count and, if nonzero, branch
|
||||
immediately to the innermost For controller event
|
||||
|
||||
One application of the Indirect Controller Prefix controller (q.v.) would be to turn a Next
|
||||
controller into a Break controller by providing a dynamic controller value as specified above.
|
||||
This feature may be used to introduce elements of application program control into sound-effect
|
||||
sequences. Otherwise, the Next controller should have a value greater than or equal to 64, in
|
||||
order to function in the manner detailed in the preceding For Loop Controller description.
|
||||
|
||||
Clear Beat/Bar Count (118)
|
||||
|
||||
(Value unused, 0-127)
|
||||
|
||||
This controller resets the current beat and measure counters to 0:0. See the AIL_beat_count()
|
||||
/ AIL_measure_count() function description in the Application Program Interface Reference
|
||||
section for information on the beat and measure counters.
|
||||
|
||||
Callback Trigger (119)
|
||||
|
||||
(Value = trigger_value parameter passed to callback function, 0-127)
|
||||
|
||||
See the AIL_install_callback() function description in the Application Program Interface
|
||||
Reference section for information on callback functions.
|
||||
|
||||
Sequence Branch Index (120)
|
||||
|
||||
(Value = marker_number parameter passed to AIL_branch_index() function,
|
||||
0-127)
|
||||
|
||||
See the AIL_branch_index() function description in the Application Program Interface
|
||||
Reference section for information on sequence branching.
|
||||
|
||||
* * *
|
||||
|
||||
In addition to the controllers listed here, some synthesizer drivers (such as the Roland MT-32
|
||||
family) provide several other XMIDI Control Change message types. These controllers allow
|
||||
the musician to access the synthesizer's set of memory-addressable features, without the need to
|
||||
deal directly with MIDI System Exclusive messages. For more information about synthesizer-
|
||||
specific XMIDI controllers, as well as a list of general XMIDI controllers supported by each
|
||||
driver, refer to the Technical Notes section of this manual.Extended MIDI IFF (.XMI) Structure
|
||||
|
||||
XMIDI sequence files are "preprocessed" MIDI sequence files. Created by the MIDIFORM
|
||||
program described in the Tools Reference section of this manual, XMIDI files are stored in
|
||||
accordance with Electronic Arts' Interchange File Format (EA IFF 85) standard. Below is a
|
||||
summary of the XMIDI format's technical details, which is presented as an aid to application
|
||||
developers with specialized needs not supported directly by the Audio Interface Library.
|
||||
|
||||
The XMIDI file format preserves all of the information needed to faithfully reproduce the
|
||||
MIDI sequence's original sound, while discarding elements of the MIDI storage format that are
|
||||
redundant, inefficient, or otherwise unnecessary for real-time playback. An XMIDI file
|
||||
containing a single translated MIDI sequence often requires from 10% to 30% less storage
|
||||
space, and can be performed with substantially less background processing time.
|
||||
|
||||
Each XMIDI file created by the MIDIFORM program contains a single IFF "CAT " chunk of
|
||||
type XMID. The CAT chunk contains at least one XMIDI sequence, whose local chunks are
|
||||
stored within a "FORM" chunk of type XMID. As created by MIDIFORM, the XMIDI file
|
||||
may contain a chunk of type FORM XDIR which contains information about the file's
|
||||
collection of XMIDI sequences. The XDIR chunk is for the application's benefit, and is not
|
||||
currently required by the XMIDI drivers.
|
||||
In the expression below, <len> signifies a 32-bit "big endian" (or Motorola 680XX-style,
|
||||
MSB first) chunk length, which includes neither itself nor its preceding 4-character CAT ,
|
||||
FORM, or local chunk name. Square brackets enclose optional chunks; ellipses are placed
|
||||
after the closing braces of chunks or data items which may be repeated.
|
||||
|
||||
[ FORM<len>XDIR
|
||||
{
|
||||
INFO<len>
|
||||
UWORD # of FORMs XMID in file, 1-65535
|
||||
} ]
|
||||
|
||||
CAT <len>XMID
|
||||
{
|
||||
FORM<len>XMID
|
||||
{
|
||||
[ TIMB<len>
|
||||
UWORD # of timbre list entries, 0-16384
|
||||
{ UBYTE patch number 0-127
|
||||
UBYTE timbre bank 0-127 } ... ]
|
||||
|
||||
[ RBRN<len>
|
||||
UWORD # of branch point offsets, 0-127
|
||||
{ UWORD Sequence Branch Index controller value 0-127
|
||||
ULONG controller offset from start of EVNT chunk } ... ]
|
||||
|
||||
EVNT<len>
|
||||
{ UBYTE interval count (if < 128)
|
||||
UBYTE <MIDI event> (if > 127) } ...
|
||||
} ...
|
||||
}
|
||||
|
||||
TIMB and RBRN are optional chunks. RBRN is included only if XMIDI Sequence Branch
|
||||
Index (120) controllers appear in the original MIDI sequence. The mandatory EVNT chunk
|
||||
contains the quantized sequence events. EVNT must appear as the last local chunk in FORM
|
||||
XMID, while the other local chunks may appear in any order. <MIDI event> consists of any
|
||||
MIDI Channel Voice, System Exclusive, or Meta-event except Note Off. The MIDI 'running
|
||||
status' convention is not used. Note On events are followed by their duration in intervals,
|
||||
expressed as a MIDI variable-length quantity (i.e., a string of 7-bit bytes stored most
|
||||
significant byte first, with the high bit set in all bytes except the last).
|
||||
Extended MIDI Global Timbre Library File Format
|
||||
|
||||
For information about Global Timbre Library data in general, review the discussion of the
|
||||
GLIB program in the Tools Reference section of this manual, as well as the descriptions of
|
||||
timbre-related functions in the Application Program Interface Reference. A 'boilerplate'
|
||||
example of C code to fetch a desired timbre from any Global Timbre Library file can be found
|
||||
in the sample program listing XPLAY.C.
|
||||
|
||||
In the expression below, ellipses are placed after the closing braces of data items which may be
|
||||
repeated.
|
||||
|
||||
File header, one entry for each timbre in file
|
||||
|
||||
{
|
||||
BYTE timbre patch number
|
||||
BYTE timbre bank number
|
||||
ULONG offset of timbre length word from start of file
|
||||
} ...
|
||||
|
||||
Structure of each timbre as stored in file
|
||||
|
||||
{
|
||||
UWORD timbre length word (size of timbre in bytes + 2)
|
||||
{
|
||||
UBYTE timbre data byte
|
||||
} ...
|
||||
} ...
|
||||
Glossary of Audio Interface Library Terms
|
||||
|
||||
ADV: Abbreviation for Audio Driver, the standard MS-DOS filename suffix for AIL device
|
||||
drivers. The .ADV files are actually small assembly-language programs which contain the
|
||||
"intelligence" needed to support a given PC audio device.
|
||||
|
||||
API: Application Program Interface. The AIL API module is linked directly with the
|
||||
application. It contains the Process Services (described in the API Reference section), as well
|
||||
as the actual C or Pascal-callable routines which link the application to its installed audio
|
||||
drivers.
|
||||
|
||||
Bank: A collection of timbres, or software instrument definitions. Think of a bank as a
|
||||
"virtual orchestra" which contains a number of different instruments available for use by a
|
||||
given driver. See also Bankfile.
|
||||
|
||||
Bankfile: An MS-DOS file containing a bank. Bankfiles are typically generated by a
|
||||
synthesizer's "instrument editor" program. The Audio Interface Library includes a program
|
||||
called GLIB which converts these device-specific bankfiles into an efficient, standardized
|
||||
runtime file format known as the Global Timbre Library, or GTL. See the description of the
|
||||
GLIB program in the Tools Reference section for details.
|
||||
|
||||
Channel: Most MIDI events can be associated with one of sixteen possible channels. Although
|
||||
MIDI is a serial data standard at heart, it is often required to convey information which exists
|
||||
as a series of events in a number of parallel, synchronous dimensions. For instance, a single
|
||||
MIDI data stream may be expected to "play" an ensemble consisting of a piano, two guitars, a
|
||||
drum set, and a brass section. By associating events intended for a given instrument with the
|
||||
instrument's unique channel number, the composer of the MIDI sequence can prevent
|
||||
acoustically unfortunate conflicts between the pianos, drums, guitars, and horns.
|
||||
|
||||
Controller: MIDI defines a number of control change events which affect the performance
|
||||
characteristics of instruments playing in a particular channel. Each MIDI synthesizer responds
|
||||
to a portion of the defined MIDI controller set. For example, the Roland MT-32 recognizes
|
||||
the standard MIDI controllers for Volume (controller 7), Panpot (controller 10), Sustain
|
||||
(controller 64), and Modulation (controller 1), among others.
|
||||
|
||||
Global Timbre Library: See Bankfile.
|
||||
|
||||
GTL: See Bankfile.
|
||||
|
||||
MIDI Channel: See Channel.
|
||||
|
||||
MIDI Channel Voice Message: A short representation (2-3 bytes) of a single MIDI event.
|
||||
Channel Voice messages include the Note Off, Note On, Polyphonic Key Pressure, Control
|
||||
Change, Program Change, Channel Pressure, and Pitch Wheel Change message types.
|
||||
|
||||
MIDI Controller: See Controller.
|
||||
MIDI System Exclusive Message: A device-specific data packet sent to a MIDI synthesizer.
|
||||
Often, system exclusive messages are used to control aspects of synthesis not otherwise covered
|
||||
by the MIDI standard, such as custom instrument data, reverb control, and channel response
|
||||
configuration. Most MIDI synthesizers are accompanied by literature describing what system
|
||||
exclusive messages they recognize, if any.
|
||||
|
||||
Multi-Timbral: Refers to a synthesizer's ability to play notes with more than one type of
|
||||
musical instrument at a time.
|
||||
|
||||
Operator: See Partial.
|
||||
|
||||
Partial: Also called an operator, a partial is a component of an FM or additive voice (q.v.).
|
||||
On the Roland MT-32/LAPC-1 synthesizer, each voice may use from 1 to 4 of 32 available
|
||||
partials. On the Ad Lib, Sound Blaster, and other YM3812-based cards, each voice requires 2
|
||||
of 18 available partials. The Yamaha YMF262 (OPL3) device, used in some newer FM sound
|
||||
cards, provides 36 partials which may be assigned in groups of 2 or 4 per voice.
|
||||
|
||||
Patch: A patch associates a timbre with a given MIDI channel. In general, the details of patch
|
||||
manipulation are handled automatically by the AIL drivers. For information on a given
|
||||
synthesizer's patch format, consult the programming manual for the device in question.
|
||||
|
||||
Patch Bank: See Bank
|
||||
|
||||
PCM: Abbreviation for Pulse Code Modulation, the technique used for most sampled sound
|
||||
playback on the PC. A common variation which implements rudimentary data compression is
|
||||
known as ADPCM, or ADaptive Pulse Code Modulation.
|
||||
|
||||
Polyphonic: Refers to a synthesizer's ability to play more than one voice at a time.
|
||||
|
||||
Sequence: Simply put, a musical work expressed as a series (sequence) of MIDI events.
|
||||
|
||||
Sysex: See MIDI System Exclusive Message.
|
||||
|
||||
System Exclusive Message: See MIDI System Exclusive Message.
|
||||
|
||||
Timbre: In the Audio Interface Library's parlance, a timbre (pronounced tim'-ber, or
|
||||
tam'-ber) is a software definition of a musical instrument. See also Bank and Bankfile.
|
||||
|
||||
Timbre Cache: Some AIL XMIDI drivers require the application to set aside a small area of
|
||||
memory to store instrument definitions. This area is known as the timbre cache. See the API
|
||||
Reference's discussion of the AIL_default_timbre_cache_size() function for more information.
|
||||
|
||||
Track: A logical division of a MIDI sequence. Often, the composer associates a single MIDI
|
||||
channel with each track, placing all performance data for each instrument on its own track.
|
||||
Voice: As used in the Audio Interface Library, the term voice refers to the minimum
|
||||
synthesizer resources needed to play a single note with a given instrument. The Ad Lib and
|
||||
similar devices provide a total of 9 simultaneous voices, while the Roland MT-32/LAPC-1
|
||||
synthesizer can generate from 8 to 32 voices at once, depending on the number of partials
|
||||
(q.v.) used by each voice.
|
||||
|
||||
XMIDI: Abbreviation for eXtended MIDI. See the preceding parts of this section for details.
|
||||
|
87
external/wildmidi-0.4.5/docs/formats/XmiFileFormat.txt
vendored
Normal file
87
external/wildmidi-0.4.5/docs/formats/XmiFileFormat.txt
vendored
Normal file
|
@ -0,0 +1,87 @@
|
|||
XMI File Format
|
||||
(Incomplete - Under Construction)
|
||||
|
||||
Document version 1
|
||||
Authored by Chris Ison chrisisonwildcode@gmail.com
|
||||
|
||||
Last Edited 24 May 2014
|
||||
|
||||
Copyright (C) 2014 WildMidi Developers
|
||||
This document is licensed under the
|
||||
Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||
To view a copy of this license, visit
|
||||
http://creativecommons.org/licenses/by-sa/4.0/
|
||||
|
||||
|
||||
Introduction
|
||||
|
||||
This document describes the XMI format as used by the WildMIDI project.
|
||||
It is not a complete description of the XMI file format and only those
|
||||
parts that have been decyphered and are relevant to the WildMidi project
|
||||
are described here. Unfortunately we cannot answer questions about the
|
||||
format that are not described within this document. If you feel there
|
||||
is an error in this document please feel free to report it as a bug at
|
||||
https://github.com/Mindwerks/wildmidi/issues/
|
||||
|
||||
|
||||
Description
|
||||
|
||||
// FORM DATA
|
||||
{
|
||||
uint8_t text[4] = "FORM";
|
||||
uint32_t size_of_data_before_chunks;
|
||||
uint8_t text[8] = "XDIRINFO";
|
||||
uint8_t unknown[4] = { 0x00, 0x00, 0x00, 0x02 };
|
||||
uint8_t form_count;
|
||||
uint8_t unknown_data[size_of_data_before_chunks - 13]
|
||||
|
||||
uint8_t text[4] = "CAT ";
|
||||
uint32_t size_of_CAT;
|
||||
|
||||
uint8_t text[4] = "XMID";
|
||||
|
||||
{
|
||||
// XMID Chunks
|
||||
uint8_t text[4] = "FORM";
|
||||
uint32_t size_of_form;
|
||||
uint8_t text[4] = "XMID";
|
||||
|
||||
{
|
||||
{
|
||||
uint8_t text[4] = "TIMB";
|
||||
uint32_t TIMB_size;
|
||||
uint8_t TIMB_data[TIMB_size] = { 8bit patch, 8bit bank, ... }
|
||||
}
|
||||
// OR
|
||||
{
|
||||
uint8_t text[4] = "RBRN"
|
||||
uint32_t RBRN_size;
|
||||
uint8_t unknown[RBRN_size];
|
||||
}
|
||||
// OR
|
||||
{
|
||||
uint8_t text[4] = "EVNT"
|
||||
uint32_t EVNT_size;
|
||||
uint8_t MIDI_data[EVNT_size] {
|
||||
// All events and delta values stored as with standard MIDI,
|
||||
// EXCEPT for there is no "Note Off" and "Note On" extra data
|
||||
// after the velocity that states the length of the note
|
||||
// in delta ticks stored in MIDI variable length format.
|
||||
|
||||
// ALSO NOTE that only the first TEMPO event is used,
|
||||
// all others are ignored.
|
||||
|
||||
// Example Note on may be stored like
|
||||
// uint8_t event_data[] = { 0x90, 0x24, 0x64, 0xA3 }
|
||||
// uint8_t delta_ticks[] = { 0xA3 }
|
||||
// uint8_t event_data[] = { 0x90, 0x48, 0x64, 0x23, 0xA3 }
|
||||
|
||||
// See the MIDI file format for more information
|
||||
|
||||
...
|
||||
}
|
||||
}
|
||||
...
|
||||
}
|
||||
}
|
||||
}
|
674
external/wildmidi-0.4.5/docs/license/GPLv3.txt
vendored
Normal file
674
external/wildmidi-0.4.5/docs/license/GPLv3.txt
vendored
Normal file
|
@ -0,0 +1,674 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
165
external/wildmidi-0.4.5/docs/license/LGPLv3.txt
vendored
Normal file
165
external/wildmidi-0.4.5/docs/license/LGPLv3.txt
vendored
Normal file
|
@ -0,0 +1,165 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
135
external/wildmidi-0.4.5/docs/man/man1/wildmidi.1
vendored
Normal file
135
external/wildmidi-0.4.5/docs/man/man1/wildmidi.1
vendored
Normal file
|
@ -0,0 +1,135 @@
|
|||
.TH wildmidi 1 "10 March 2016" "" "WildMidi Player"
|
||||
.SH NAME
|
||||
wildmidi \- example player for libWildMidi
|
||||
.PP
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH FILES
|
||||
.B /etc/wildmidi/wildmidi.cfg
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B wildmidi [\-bhlvwnst] [\-c \fIconfig\-file\fB] [\-d \fIaudiodev\fB] [\-m \fIvolume\-level\fB] [\-o \fIwav\-file\fB] [\-f \fIfrequency\-Hz(MUS)\fB] [\-r \fIsample-rate\fB] [\-g \fIconvert-xmi-type\fB] \fImidifile ...
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
This is a demonstration program to show the capabilities of libWildMidi.
|
||||
.PP
|
||||
\fImidifile\fP can be a MIDI type file in the HMI, HMP, MIDI, MUS or XMI formats and is processed by libWildMidi and the resulting audio is output by the player.
|
||||
.PP
|
||||
You can have more than one \fImidifile\fP on the command line and \fBwildmidi\fP will pass them to libWildMidi for processing, one after the other. You can also use wildcards, for example: \fBwildmidi *.mid\fP
|
||||
.PP
|
||||
.SH OPTIONS
|
||||
.IP "\fB\-b\fP | \fB\-\-reverb\fP"
|
||||
Turns on an 8 point reverb engine that adds depth to the final mix.
|
||||
.P
|
||||
.IP "\fB\-c\fP \fIconfig\-file\fP | \fB\-\-config\fP \fIconfig\-file\fP"
|
||||
Uses the configuration file stated by \fIconfig\-file\fP instead of /etc/wildmidi/wildmidi.cfg
|
||||
.PP
|
||||
.IP "\fB\-d\fP \fIaudiodev\fP | \fB\-\-device=\fIaudiodev\fP"
|
||||
Send the audio to \fIaudiodev\fP instead of the default. ALSA defaults to the system "default" while OSS defaults to "/dev/dsp". Other environments do not support this option.
|
||||
.PP
|
||||
.IP "\fB\-h\fP | \fB\-\-help\fP"
|
||||
Displays command line options.
|
||||
.PP
|
||||
.IP "\fB\-f\fP | \fB\-\-frequency\fP"
|
||||
Use frequency F Hz for playback (MUS).
|
||||
.PP
|
||||
.IP "\fB\-g\fP | \fB\-\-convert\fP"
|
||||
Convert XMI: 0 - No Conversion (default)
|
||||
1 - MT32 to GM
|
||||
2 - MT32 to GS
|
||||
.PP
|
||||
.IP "\fB\-l\fP | \fB\-\-log_vol\fP"
|
||||
Some MIDI files have been recorded on hardware that uses a volume curve, making them sound really badly mixed on other MIDI devices. Use this option to use volume curves.
|
||||
.PP
|
||||
.IP "\fB\-m\fP \fIvolume\-level\fP | \fB\-\-mastervol=\fIvolume\-level\fP"
|
||||
Set the overall volume level to \fIvolume\-level\fP. The minimum is 0 and the maximum is 127, with the default being 100.
|
||||
.PP
|
||||
.IP "\fB\-o\fP \fIwav\-file\fP | \fB\-\-wavout=\fIwav\-file\fP"
|
||||
Records the audio in wav format to \fIwav-file\fP.
|
||||
.PP
|
||||
.IP "\fB\-r\fP \fIsndrate\fP | \fB\-\-rate=\fIsndrate\fP"
|
||||
Set the audio output rate to \fIsndrate\fP. The default rate is 32072.
|
||||
.PP
|
||||
.IP "\fB\-n\fP | \fB\-\-roundtempo\fP"
|
||||
Round tempo to nearest whole number.
|
||||
.PP
|
||||
.IP "\fB\-s\fP | \fB\-\-skipsilentstart\fP"
|
||||
Skips any silence at the start of playback.
|
||||
.PP
|
||||
.IP "\fB\-v\fP | \fB\-\-version\fP"
|
||||
Display version and copyright information.
|
||||
.PP
|
||||
.IP "\fB\-x\fP | \fB\-\-tomidi\fP"
|
||||
Convert a MUS or an XMI file to midi and save to file.
|
||||
.PP
|
||||
.SH TEST OPTIONS
|
||||
These options are not designed for general use. Instead these options are designed to make it easier to listen to specific sound samples.
|
||||
.PP
|
||||
Note: These options are not displayed by \fB\-h\fP | \fB\-\-help\fP
|
||||
.PP
|
||||
.IP "\fB-k\fP \fIN\fP | \fB\-\-test_bank=\fIN\fP"
|
||||
Set the test bank to \fIN\fP. Range is 0 to 127.
|
||||
.PP
|
||||
.IP "\fB\-p\fP \fIN\fP | \fB\-\-test_patch=\fIN\fP"
|
||||
Set the test patch to \fIN\fP. Range is 0 to 127.
|
||||
.PP
|
||||
.IP "\fB\-t\fP | \fB\-\-test_midi\fP"
|
||||
Plays the built in test midi which plays all 127 notes.
|
||||
.PP
|
||||
.SH USER INTERFACE
|
||||
The player accepts limited user input that allows some interaction while playing midi files.
|
||||
.PP
|
||||
.IP \fB\+\fP
|
||||
Turns the master volume up.
|
||||
.PP
|
||||
.IP \fB\-\fP
|
||||
Turns the master volume down.
|
||||
.PP
|
||||
.IP \fBe\fP
|
||||
Turns enhanced resampling on and off.
|
||||
.PP
|
||||
.IP \fBl\fP
|
||||
Turns volume curves on and off.
|
||||
.PP
|
||||
.IP \fBr\fP
|
||||
Turns the final mix reverb on and off.
|
||||
.PP
|
||||
.IP \fBn\fP
|
||||
Play the next midi on the command line.
|
||||
.PP
|
||||
.IP \fBm\fP
|
||||
Save the currently playing file to a midi file. NOTE: This saves to the current directory.
|
||||
.PP
|
||||
.IP \fBp\fP
|
||||
Pause the playback. Note: since the audio is buffered it will stop when the audio buffer is empty.
|
||||
.PP
|
||||
.IP \fB.\fP
|
||||
Seek forward 1 second. Note: Clears active midi events and will only play midi events from after the new position.
|
||||
.PP
|
||||
.IP \fB,\fP
|
||||
Seek backwards 1 second. Note: Clears active midi events and will only play midi events from after the new position.
|
||||
.PP
|
||||
.IP \fBq\fP
|
||||
Quit wildmidi.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons AttributionShare Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
46
external/wildmidi-0.4.5/docs/man/man3/WildMidi_ClearError.3
vendored
Normal file
46
external/wildmidi-0.4.5/docs/man/man3/WildMidi_ClearError.3
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
.TH WildMidi_ClearError 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_ClearError \- Clear errors
|
||||
.PP
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B void WildMidi_ClearError(\fIvoid\fP)
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Clears errors in wildmidi library.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
49
external/wildmidi-0.4.5/docs/man/man3/WildMidi_Close.3
vendored
Normal file
49
external/wildmidi-0.4.5/docs/man/man3/WildMidi_Close.3
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
.TH WildMidi_Close 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_Close \- Close an open midi handle
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B int WildMidi_Close (midi *\fIhandle\fB)
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Finish processing MIDI data or file.
|
||||
.PP
|
||||
.IP \fIhandle\fP
|
||||
The identifier obtained from opening a midi file with \fBWildMidi_Open\fR(3)\fP or \fBWildMidi_OpenBuffer\fR(3)\fP
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
returns \-1 on error, otherwise returns 0
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
60
external/wildmidi-0.4.5/docs/man/man3/WildMidi_ConvertBufferToMidi.3
vendored
Normal file
60
external/wildmidi-0.4.5/docs/man/man3/WildMidi_ConvertBufferToMidi.3
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
.TH WildMidi_ConvertBufferToMidi 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_ConvertBufferToMidi \- Convert a MIDI-like buffer into a new MIDI buffer.
|
||||
.PP
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B WildMidi_ConvertBufferToMidi (uint8_t *\fIin\fP, uint8_t \fIinsize\fP, uint8_t **\fIout\fP, uint32_t *\fIoutsize\fP)
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Takes a MIDI-like memory buffer as input and tries to detect, convert and write to a memory buffer in MIDI format.
|
||||
.PP
|
||||
.IP \fIin\fP
|
||||
The input buffer that contains MIDI-like content: XMI or MUS.
|
||||
.PP
|
||||
.IP \fIinsize\fP
|
||||
The size of the input buffer.
|
||||
.PP
|
||||
.IP \fIout\fP
|
||||
The output buffer. It will be allocated with \fBmalloc\fP() and must be \fBfree\fP()d by the caller when it is no longer needed.
|
||||
.PP
|
||||
.IP \fIoutsize\fP
|
||||
The size of the output buffer.
|
||||
.RS
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
||||
|
57
external/wildmidi-0.4.5/docs/man/man3/WildMidi_ConvertToMidi.3
vendored
Normal file
57
external/wildmidi-0.4.5/docs/man/man3/WildMidi_ConvertToMidi.3
vendored
Normal file
|
@ -0,0 +1,57 @@
|
|||
.TH WildMidi_ConvertToMidi 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_ConvertToMidi \- Convert a MIDI-like file into a new MIDI file.
|
||||
.PP
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B WildMidi_ConvertToMidi (const char *\fIfile\fP, uint8_t **\fIout\fP, uint32_t *\fIsize\fP)
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Takes a MIDI-like file as input and tries to detect, convert and write to a memory buffer in MIDI format.
|
||||
.PP
|
||||
.IP \fIfile\fP
|
||||
The input file that contains MIDI-like content: XMI or MUS.
|
||||
.PP
|
||||
.IP \fIout\fP
|
||||
The output buffer. It will be allocated with \fBmalloc\fP() and must be \fBfree\fP()d by the caller when it is no longer needed.
|
||||
.PP
|
||||
.IP \fIsize\fP
|
||||
The size of the output buffer.
|
||||
.RS
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
||||
|
54
external/wildmidi-0.4.5/docs/man/man3/WildMidi_FastSeek.3
vendored
Normal file
54
external/wildmidi-0.4.5/docs/man/man3/WildMidi_FastSeek.3
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
.TH WildMidi_FastSeek 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_FastSeek \- Move to a position in a midi file
|
||||
.PP
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B int WildMidi_FastSeek (midi *\fIhandle\fB, unsigned long int *\fIsample_pos\fB);
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Resets all note specific midi states and active notes before scanning to \fIsample_pos\fP samples from the beginning taking note of any changes to midi channel states. The next call to \fIWildMidi_GetOutput\fP\fR(3)\fP will behave as if you started to play the midi from that position.
|
||||
.PP
|
||||
.IP \fIhandle\fP
|
||||
The identifier obtained from opening a midi file with \fBWildMidi_Open\fR(3)\fP or \fBWildMidi_OpenBuffer\fR(3)\fP
|
||||
.PP
|
||||
.IP \fIsample_pos\fP
|
||||
The number of samples from the beginning you want libWildMidi to seek to.
|
||||
.PP
|
||||
NOTE: significant delay can occur when using this function. You can expect even more delay if you select a position that's already been passed forcing the library to start from the beginning.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
46
external/wildmidi-0.4.5/docs/man/man3/WildMidi_GetError.3
vendored
Normal file
46
external/wildmidi-0.4.5/docs/man/man3/WildMidi_GetError.3
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
.TH WildMidi_GetError 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_GetError \- Return the last error message
|
||||
.PP
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B char * WildMidi_GetError(\fIvoid\fP)
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Returns the last error message, if any.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
89
external/wildmidi-0.4.5/docs/man/man3/WildMidi_GetInfo.3
vendored
Normal file
89
external/wildmidi-0.4.5/docs/man/man3/WildMidi_GetInfo.3
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
.TH WildMidi_GetInfo 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_GetInfo \- get information on a midi
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B struct _WM_Info *WildMidi_GetInfo (midi *\fIhandle\fP);
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Obtains information allowing you to determine song position, current options, and any copyright information.
|
||||
.PP
|
||||
.IP \fIhandle\fP
|
||||
The identifier obtained from opening a midi file with \fBWildMidi_Open\fR(3)\fP or \fBWildMidi_OpenBuffer\fR(3)\fP
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
On error returns NULL with an error message displayed to stderr.
|
||||
.PP
|
||||
Otherwise returns a pointer to a struct containing the information.
|
||||
.PP
|
||||
.nf
|
||||
struct _WM_Info {
|
||||
char *\fIcopyright\fP;
|
||||
uint32_t \fIcurrent_sample\fP;
|
||||
uint32_t \fIapprox_total_samples\fP;
|
||||
uint32_t \fItotal_midi_time\fP;
|
||||
uint16_t \fImixer_options\fP;
|
||||
uint32_t \fItotal_midi_time\fP;
|
||||
};
|
||||
.fi
|
||||
.PP
|
||||
.IP \fIcopyright\fP
|
||||
A pointer to a \\0 terminated string containing any copyright MIDI events found while processing the MIDI file \fIhandle\fP refers to. If more than one copyright event was found then each one is separated by \\n
|
||||
.PP
|
||||
If \fIcopyright\fP is NULL then no copyright MIDI events were found.
|
||||
.PP
|
||||
.IP \fIcurrent_sample\fP
|
||||
This is the number of stereo samples libWildMidi has processed for the MIDI file referred to by \fIhandle\fP. You can use this value to determine the current playing time by dividing this value by the \fIrate\fP given when libWildMidi was initialized by \fBWildMidi_Init\fR(3)\fP.
|
||||
.PP
|
||||
.IP \fIapprox_total_samples\fP
|
||||
This is the total number of stereo samples libWildMidi expects to process. This can be used to obtain the total playing time by dividing this value by the \fIrate\fP given when libWildMidi was initialized by \fBWildMidi_Init\fP\fR(3).\fP Also when you divide \fIcurrent_sample\fP by this value and multiplying by 100, you have the percentage currently processed.
|
||||
.PP
|
||||
.IP \fItotal_midi_time\fP
|
||||
This is the total time of MIDI events in 1/1000's of a second. It differs from \fIapprox_total_samples\fP in that it only states the total time within the MIDI file and does not take into account the extra bit of time to finish playing sampling smoothly.
|
||||
.PP
|
||||
.IP \fImixer_options\fP
|
||||
.RS
|
||||
.IP WM_MO_LOG_VOLUME
|
||||
Using curved volume settings instead of linear ones.
|
||||
.PP
|
||||
.IP WM_MO_ENHANCED_RESAMPLING
|
||||
The enhanced resampler is active
|
||||
.PP
|
||||
.IP WM_MO_REVERB
|
||||
Reverb is being added to the final output.
|
||||
.RE
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
53
external/wildmidi-0.4.5/docs/man/man3/WildMidi_GetLyric.3
vendored
Normal file
53
external/wildmidi-0.4.5/docs/man/man3/WildMidi_GetLyric.3
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
.TH WildMidi_GetLyric 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_GetLyric \- get lyrics of a midi
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B char *WildMidi_GetLyric (midi *\fIhandle\fP);
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Returns a pointer to a nul terminated string that contains the data contained in the last read lyric or text meta event.
|
||||
Or returns NULL if no lyric is waiting to be read.
|
||||
.PP
|
||||
.IP \fIhandle\fP
|
||||
The identifier obtained from opening a midi file with \fBWildMidi_Open\fR(3)\fP or \fBWildMidi_OpenBuffer\fR(3)\fP
|
||||
.PP
|
||||
.SH RETURN VALUE
|
||||
On error returns NULL with an error message displayed to stderr.
|
||||
.PP
|
||||
Otherwise returns a pointer to a *char containing the lyric data.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
57
external/wildmidi-0.4.5/docs/man/man3/WildMidi_GetMidiOutput.3
vendored
Normal file
57
external/wildmidi-0.4.5/docs/man/man3/WildMidi_GetMidiOutput.3
vendored
Normal file
|
@ -0,0 +1,57 @@
|
|||
.TH WildMidi_GetMidiOutput 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_GetMidiOutput \- get a midi file of a file being processed.
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B int WildMidi_GetMidiOutput (midi *\fIhandle\fP, int8_t **\fIbuffer\fP, uint32_t *\fIsize\fP)
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Writes the midi\-format data from the file being processed to the memory location pointed to by \fIbuffer\fP. The data will be in type-0 format for type-0 and type-1 files. For type-2 files, the data will be in type-2 format unless the WM_MO_SAVEASTYPE0 option is set.
|
||||
.PP
|
||||
.IP \fIhandle\fP
|
||||
The identifier obtained from opening a file with \fBWildMidi_Open\fR(3)\fP or \fBWildMidi_OpenBuffer\fR(3)\fP
|
||||
.PP
|
||||
.IP \fIbuffer\fP
|
||||
The memory location where libWildMidi is to store the midi data from the \fIhandle\fP. The \fIbuffer\fP will be allocated with \fBmalloc\fP() and must be \fBfree\fP()d by the caller when it is no longer needed.
|
||||
.PP
|
||||
.IP \fIsize\fP
|
||||
The location where libWildMidi is to store the size of the midi data stored in \fIbuffer\fP.
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
Returns \-1 on error otherwise returns 0
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3),
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3),
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
62
external/wildmidi-0.4.5/docs/man/man3/WildMidi_GetOutput.3
vendored
Normal file
62
external/wildmidi-0.4.5/docs/man/man3/WildMidi_GetOutput.3
vendored
Normal file
|
@ -0,0 +1,62 @@
|
|||
.TH WildMidi_GetOutput 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_GetOutput \- retrieve raw audio data
|
||||
.PP
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B int WildMidi_GetOutput (midi *\fIhandle\fP, int8_t *\fIbuffer\fP, uint32_t \fIsize\fP);
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Places \fIsize\fP bytes of audio data from a \fIhandle\fP, previously opened by \fBWildMidi_Open\fP\fR(3)\fP or \fBWildMidi_OpenBuffer\fP\fR(3)\fP, into a buffer pointer to by \fIbuffer\fP.
|
||||
.PP
|
||||
\fIbuffer\fP must be at least \fIsize\fP bytes, with \fIsize\fP being a multiple of 4 as the data is stored in 16bit interleaved stereo format.
|
||||
.PP
|
||||
.IP \fIhandle\fP
|
||||
The identifier obtained from opening a midi file with \fBWildMidi_Open\fR(3)\fP or \fBWildMidi_OpenBuffer\fR(3)\fP
|
||||
.PP
|
||||
.IP \fIbuffer\fP
|
||||
The location supplied by the calling program where libWildMidi is to store the audio data. The audio data will be stored as signed 16bit interleaved stereo in native\-endian byte order.
|
||||
.PP
|
||||
.IP \fIsize\fP
|
||||
The size of the buffer in bytes. Since libWildMidi processes the audio in 16bit interleaved stereo format, this value needs to be a multiple of 4.
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
Returns \-1 on error along with an error message sent to stderr, 0 when there is no more audio data, otherwise the number of bytes of audio data written to \fIbuffer\fP.
|
||||
.PP
|
||||
NOTE: if the return value is less than the size you gave, this does not denote an error, it simply means the lib reached the end of the midi before it could fill the buffer.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
50
external/wildmidi-0.4.5/docs/man/man3/WildMidi_GetString.3
vendored
Normal file
50
external/wildmidi-0.4.5/docs/man/man3/WildMidi_GetString.3
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
.TH WildMidi_GetString 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_GetString \- Get string from library
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B const char *WildMidi_GetString (uint16_t \fIinfo\fP);
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Returns a pointer to a string depending on what \fIinfo\fP is set to.
|
||||
.PP
|
||||
At this stage WM_GS_VERSION is the only setting for \fIinfo\fP which returns a pointer to a string containing libWildMidi version information.
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
Returns a const char pointer to a string containing the string requested.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
55
external/wildmidi-0.4.5/docs/man/man3/WildMidi_GetVersion.3
vendored
Normal file
55
external/wildmidi-0.4.5/docs/man/man3/WildMidi_GetVersion.3
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
.TH WildMidi_GetVersion 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_GetVersion \- Get the library version
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B long WildMidi_GetVersion (void);
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Retrieve the library version. Does not require library initialization.
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
Returns the library version
|
||||
.PP
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWlong ver = WildMidi_GetVersion();
|
||||
printf("libWildMidi\-%ld.%ld.%ld\\n",
|
||||
(ver>>16) & 255, (ver>>8) & 255, (ver) & 255);\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
73
external/wildmidi-0.4.5/docs/man/man3/WildMidi_Init.3
vendored
Normal file
73
external/wildmidi-0.4.5/docs/man/man3/WildMidi_Init.3
vendored
Normal file
|
@ -0,0 +1,73 @@
|
|||
.TH WildMidi_Init 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_Init \- Initialize the library
|
||||
.PP
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B WildMidi_Init (const char *\fIconfig_file\fP, uint16_t \fIrate\fP, uint16_t \fIoptions\fP)
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Initializes libWildMidi in preparation for playback. This function only needs to be called once by the program using libWildMidi.
|
||||
.PP
|
||||
.IP \fIconfig-file\fP
|
||||
The file that contains the instrument configuration for the library.
|
||||
.PP
|
||||
.IP \fIrate\fP
|
||||
The sound rate you want the the audio data output at. Rates accepted by libWildMidi are 11025 \- 65000.
|
||||
.PP
|
||||
.IP \fIoptions\fP
|
||||
The initial options to set for the library. see below.
|
||||
.RS
|
||||
.PP
|
||||
.IP WM_MO_LOG_VOLUME
|
||||
By default the library uses linear volume levels typically used in computer MIDI players. These can differ somewhat to volume levels found on some midi hardware which may use a volume curve based on decibels. This option sets the volume levels to what you'd expect on such devices.
|
||||
.PP
|
||||
.IP WM_MO_ENHANCED_RESAMPLING
|
||||
By default libWildMidi uses linear interpolation for the resampling of the sound samples. Setting this option enables the library to use a resampling method that attempts to fill in the gaps giving richer sound.
|
||||
.PP
|
||||
.IP WM_MO_REVERB
|
||||
libWildMidi has an 8 reflection reverb engine. Use this option to give more depth to the output.
|
||||
.PP
|
||||
.IP WM_MO_WHOLETEMPO
|
||||
Ignores the fractional or decimal part of a tempo setting. If you are having timing issues try \fIWM_MO_ROUNDTEMPO\fP before trying this option. This option added due to some software not supporting fractional tempos allowable in the MIDI specification.
|
||||
.PP
|
||||
.IP WM_MO_ROUNDTEMPO
|
||||
Rounds the fractional or decimal part of a tempo setting. Try this option is you are having timing issues, if this fails then try \fIWM_MO_WHOLETEMPO\fP. This option added due to some software not supporting fractional tempos allowable in the MIDI specification.
|
||||
.RE
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
||||
|
88
external/wildmidi-0.4.5/docs/man/man3/WildMidi_InitVIO.3
vendored
Normal file
88
external/wildmidi-0.4.5/docs/man/man3/WildMidi_InitVIO.3
vendored
Normal file
|
@ -0,0 +1,88 @@
|
|||
.TH WildMidi_InitVIO 3 "18 May 2018" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_InitVIO \- Initialize the library with file I/O callbacks
|
||||
.PP
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B WildMidi_InitVIO (struct _WM_VIO *\fIcallbacks\fP, const char *\fIconfig_file\fP, uint16_t \fIrate\fP, uint16_t \fIoptions\fP)
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Initializes libWildMidi in preparation for playback, and sets the function pointers for file I/O as provided by the caller. This function only needs to be called once by the program using libWildMidi.
|
||||
.PP
|
||||
.IP \fIcallbacks\fP
|
||||
Pointer to a file IO callbacks structure. The _WM_VIO structure is like the following:
|
||||
.nf
|
||||
struct _WM_VIO {
|
||||
/* This function should allocate a buffer which has the size
|
||||
* of the requested file plus one (size+1), fill the buffer
|
||||
* with the file content, and the second parameter with the
|
||||
* size of the file. */
|
||||
void * (* allocate_file)(const char *, uint32_t *);
|
||||
|
||||
/* This function should free the memory of the given buffer */
|
||||
void (* free_file) (void *);
|
||||
};
|
||||
.fi
|
||||
.PP
|
||||
.IP \fIconfig-file\fP
|
||||
The file that contains the instrument configuration for the library.
|
||||
.PP
|
||||
.IP \fIrate\fP
|
||||
The sound rate you want the the audio data output at. Rates accepted by libWildMidi are 11025 \- 65000.
|
||||
.PP
|
||||
.IP \fIoptions\fP
|
||||
The initial options to set for the library. see below.
|
||||
.RS
|
||||
.PP
|
||||
.IP WM_MO_LOG_VOLUME
|
||||
By default the library uses linear volume levels typically used in computer MIDI players. These can differ somewhat to volume levels found on some midi hardware which may use a volume curve based on decibels. This option sets the volume levels to what you'd expect on such devices.
|
||||
.PP
|
||||
.IP WM_MO_ENHANCED_RESAMPLING
|
||||
By default libWildMidi uses linear interpolation for the resampling of the sound samples. Setting this option enables the library to use a resampling method that attempts to fill in the gaps giving richer sound.
|
||||
.PP
|
||||
.IP WM_MO_REVERB
|
||||
libWildMidi has an 8 reflection reverb engine. Use this option to give more depth to the output.
|
||||
.PP
|
||||
.IP WM_MO_WHOLETEMPO
|
||||
Ignores the fractional or decimal part of a tempo setting. If you are having timing issues try \fIWM_MO_ROUNDTEMPO\fP before trying this option. This option added due to some software not supporting fractional tempos allowable in the MIDI specification.
|
||||
.PP
|
||||
.IP WM_MO_ROUNDTEMPO
|
||||
Rounds the fractional or decimal part of a tempo setting. Try this option is you are having timing issues, if this fails then try \fIWM_MO_WHOLETEMPO\fP. This option added due to some software not supporting fractional tempos allowable in the MIDI specification.
|
||||
.RE
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
||||
|
48
external/wildmidi-0.4.5/docs/man/man3/WildMidi_MasterVolume.3
vendored
Normal file
48
external/wildmidi-0.4.5/docs/man/man3/WildMidi_MasterVolume.3
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
.TH WildMidi_MasterVolume 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_MasterVolume \- sets the overall audio level of the library.
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B int WildMidi_MasterVolume (uint8_t \fImaster_volume\fP)
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Sets the overall library volume level to \fImaster_volume\fP. The range of \fImaster_volume\fP is between 0 and 127 with 100 being the default.
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
Returns \-1 on error, otherwise returns 0.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3),
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
48
external/wildmidi-0.4.5/docs/man/man3/WildMidi_Open.3
vendored
Normal file
48
external/wildmidi-0.4.5/docs/man/man3/WildMidi_Open.3
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
.TH WildMidi_Open 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_Open \- Open a midi file for processing
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B midi *WildMidi_Open (const char *\fImidifile\fP)
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Open a MIDI type file pointed to by \fImidifile\fP for processing. This file must be in HMP, HMI, MIDI, or XMIDI format.
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
Returns NULL on error and sends a message to stderr, otherwise returns a handle for the midi file opened. This handle is used by most functions in libWildMidi to identify which midi file we are referring to.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
55
external/wildmidi-0.4.5/docs/man/man3/WildMidi_OpenBuffer.3
vendored
Normal file
55
external/wildmidi-0.4.5/docs/man/man3/WildMidi_OpenBuffer.3
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
.TH WildMidi_OpenBuffer 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_OpenBuffer \- Open a midi file buffer for processing
|
||||
.PP
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B midi *WildMidi_OpenBuffer (uint8_t *\fImidibuffer\fP, uint32_t \fIsize\fP)
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Open a file, that you have buffered in memory, for processing.
|
||||
.PP
|
||||
.IP \fImidibuffer\fP
|
||||
The memory location of the buffered file. This buffer needs to be in either HMP, HMI, MIDI, or XMIDI file format. Once this function is called, any changes to the buffer will have no effect.
|
||||
.PP
|
||||
.IP \fIsize\fP
|
||||
This is the size of the midi file in bytes that is stored in memory.
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
Returns NULL on error, otherwise returns a handle for the midi buffer opened.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
63
external/wildmidi-0.4.5/docs/man/man3/WildMidi_SetCvtOption.3
vendored
Normal file
63
external/wildmidi-0.4.5/docs/man/man3/WildMidi_SetCvtOption.3
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
.TH WildMidi_SetCvtOption 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_SetCvtOption \- Set a conversion option for a specific midi
|
||||
.PP
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B int WildMidi_SetCvtOption (uint16_t *\fItag\fP, uint16_t \fIsetting\fP)
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Set a conversion option for a specific midi.
|
||||
.PP
|
||||
.B \fItag\fP
|
||||
The type of option you wish to change.
|
||||
.PP
|
||||
.RS
|
||||
.IP WM_CO_XMI_TYPE
|
||||
The the conversion type of an XMI to MIDI.
|
||||
.PP
|
||||
.IP WM_CO_FREQUENCY
|
||||
The frequency to be used for a MUS file.
|
||||
.PP
|
||||
.RE
|
||||
.IP \fIsetting\fP
|
||||
Value for the particular tag.
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
Returns \-1 on error, otherwise returns 0.
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetCvtOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
88
external/wildmidi-0.4.5/docs/man/man3/WildMidi_SetOption.3
vendored
Normal file
88
external/wildmidi-0.4.5/docs/man/man3/WildMidi_SetOption.3
vendored
Normal file
|
@ -0,0 +1,88 @@
|
|||
.TH WildMidi_SetOption 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_SetOption \- Set a library option for a specific midi
|
||||
.PP
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B int WildMidi_SetOption (midi *\fIhandle\fP, uint16_t \fIoptions\fP, uint16_t \fIsetting\fP)
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Set a library option for a specific midi.
|
||||
.PP
|
||||
.IP \fIhandle\fP
|
||||
The identifier obtained from opening a midi file with \fBWildMidi_Open\fR(3)\fP or \fBWildMidi_OpenBuffer\fR(3)\fP
|
||||
.PP
|
||||
.B \fIoptions\fP
|
||||
The option or options you wish to change.
|
||||
.PP
|
||||
.RS
|
||||
.IP WM_MO_LOG_VOLUME
|
||||
By default the library uses linear volume levels typically used in computer MIDI players. These can differ somewhat to volume levels found on some midi hardware which may use a volume curve based on decibels. This option sets the volume levels to what you'd expect on such devices.
|
||||
.PP
|
||||
.IP WM_MO_ENHANCED_RESAMPLING
|
||||
By default libWildMidi uses linear interpolation for the resampling of the sound samples. Setting this option enables the library to use a resampling method that attempts to fill in the gaps giving richer sound.
|
||||
.PP
|
||||
.IP WM_MO_REVERB
|
||||
libWildMidi has an 8 reflection reverb engine. Use this option to give more depth to the output.
|
||||
.PP
|
||||
.IP WM_MO_LOOP
|
||||
Makes libWildMidi to automatically rewind when it reaches the end, so the file would play in continuous loop.
|
||||
.PP
|
||||
.IP WM_MO_STRIPSILENCE
|
||||
Strips silence at song start.
|
||||
.PP
|
||||
.IP WM_MO_SAVEASTYPE0
|
||||
This option tells \fBWildMidi_GetMidiOutput\fP(3) to output type-0 format data for type-2 files.
|
||||
.PP
|
||||
.IP WM_MO_TEXTASLYRIC
|
||||
Some files have the lyrics in the text meta event. This option reads lyrics from there instead.
|
||||
.PP
|
||||
.RE
|
||||
.IP setting
|
||||
To turn on an option, repeat that option here. To turn off an option, do not put the option here.
|
||||
.PP
|
||||
.IP "Example: To turn on Reverb"
|
||||
WildMidi_SetOption(handle, WM_MO_REVERB, WM_MO_REVERB);
|
||||
.IP "Example: To turn off Reverb"
|
||||
WildMidi_SetOption(handle, WM_MO_REVERB, 0);
|
||||
.IP "Example: To turn on Reverb and Enhanced Resampling"
|
||||
WildMidi_SetOption(handle, (WM_MO_REVERB | WM_MO_ENHANCED_RESAMPLING), (WM_MO_REVERB | WM_MO_ENHANCED_RESAMPLING));
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
Returns \-1 on error, otherwise returns 0.
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
48
external/wildmidi-0.4.5/docs/man/man3/WildMidi_Shutdown.3
vendored
Normal file
48
external/wildmidi-0.4.5/docs/man/man3/WildMidi_Shutdown.3
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
.TH WildMidi_Shutdown 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_Shutdown \- Shutdown the library
|
||||
.PP
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B void WildMidi_Shutdown(\fIvoid\fP)
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Shuts down the wildmidi library, resetting data and freeing up memory used by the library.
|
||||
.PP
|
||||
Once this is called, the library is no longer initialized and \fBWildMidi_Init\fP\fR(3)\fP will need to be called again.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_FastSeek (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
52
external/wildmidi-0.4.5/docs/man/man3/WildMidi_SongSeek.3
vendored
Normal file
52
external/wildmidi-0.4.5/docs/man/man3/WildMidi_SongSeek.3
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
.TH WildMidi_SongSeek 3 "10 March 2016" "" "WildMidi Programmer's Manual"
|
||||
.SH NAME
|
||||
WildMidi_SongSeek \- Move to next song.
|
||||
.PP
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH SYNOPSIS
|
||||
.B #include <wildmidi_lib.h>
|
||||
.PP
|
||||
.B int WildMidi_SongSeek (midi *\fIhandle\fB, int8_t *\fInextsong\fB);
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Stops and flushes currently playing midi and then begins playing the next, previous or the same song contained in a type-2 midi.
|
||||
.PP
|
||||
.IP \fIhandle\fP
|
||||
The identifier obtained from opening a midi file with \fBWildMidi_Open\fR(3)\fP or \fBWildMidi_OpenBuffer\fR(3)\fP
|
||||
.PP
|
||||
.IP \fInextsong\fP
|
||||
Whether to go to previous song (-1), beginning of current song (0), next song (1). Only 0 is accepted for type-0 or type-1 midis.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.BR WildMidi_GetVersion (3) ,
|
||||
.BR WildMidi_Init (3) ,
|
||||
.BR WildMidi_MasterVolume (3) ,
|
||||
.BR WildMidi_Open (3) ,
|
||||
.BR WildMidi_OpenBuffer (3) ,
|
||||
.BR WildMidi_SetOption (3) ,
|
||||
.BR WildMidi_GetOutput (3) ,
|
||||
.BR WildMidi_GetMidiOutput (3) ,
|
||||
.BR WildMidi_GetInfo (3) ,
|
||||
.BR WildMidi_Close (3) ,
|
||||
.BR WildMidi_Shutdown (3) ,
|
||||
.BR wildmidi.cfg (5)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <chrisisonwildcode@gmail.com>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) WildMidi Developers 2001\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
122
external/wildmidi-0.4.5/docs/man/man5/wildmidi.cfg.5
vendored
Normal file
122
external/wildmidi-0.4.5/docs/man/man5/wildmidi.cfg.5
vendored
Normal file
|
@ -0,0 +1,122 @@
|
|||
.TH wildmidi.cfg 5 "10 March 2016" "" "WildMidi Config File"
|
||||
.SH NAME
|
||||
wildmidi.cfg \- Config file for libWildMidi
|
||||
.PP
|
||||
.SH LIBRARY
|
||||
.B libWildMidi
|
||||
.PP
|
||||
.SH DESCRIPTION
|
||||
Contains the patch configuration for libWildMidi and location of Gravis Ultrasound compatible patch files.
|
||||
.PP
|
||||
.nf
|
||||
dir ~/guspats/
|
||||
|
||||
source /etc/wildmidi.cfg
|
||||
|
||||
bank 0
|
||||
0 acpiano.pat amp=110 env_time4=300
|
||||
1 brpiano.pat amp=100
|
||||
|
||||
drumset 0
|
||||
25 snarerol keep=env amp=225 note=60
|
||||
26 snap note=65
|
||||
.fi
|
||||
.PP
|
||||
.SH SYNTAX
|
||||
.IP "\fBguspat_editor_author_cant_read_so_fix_release_time_for_me\fP"
|
||||
Some patch file editors switch the 4th and 5th envelopes around making the sound play much longer than intended in players that stuck to the Gravis Ultrasound patch standard. Including this option in the config enables a fix that detects this oversight, playing the sound samples as if they were correct.
|
||||
.IP
|
||||
NOTE: This is a global setting. If it is found to affect good patch samples it will be moved to a per patch setting in a future version.
|
||||
.PP
|
||||
.IP "\fBauto_amp\fP"
|
||||
Forces WildMIDI to amplify samples to their maximum level ignoring the amp=% in the patch lines of the config.
|
||||
.PP
|
||||
.IP "\fBauto_amp_with_amp\fP"
|
||||
Forces WildMIDI to amplify samples to their maximum level then apply the amp=% in the patch lines of the config.
|
||||
.PP
|
||||
.IP "\fBdir\fP \fIdir\-name\fP"
|
||||
Change the search path for config and patch files to \fIdir\-name\fP. This is specific to the current config file and carried to any included config file unless they have their own \fBdir\fP setting. Any included file that has its own \fBdir\fP setting does not effect the \fBdir\fP setting of the current config file.
|
||||
.PP
|
||||
.IP "\fBsource\fP \fIinclude\-confg\fP"
|
||||
Include the settings from \fIinclude\-config\fP. Any patch already set will be over\-ridden by the included config file.
|
||||
.PP
|
||||
.IP "\fBbank\fP \fIN\fP"
|
||||
The patches following this setting belong to MIDI instrument bank \fIN\fP.
|
||||
.PP
|
||||
.IP "\fBdrumset\fP \fIN\fP"
|
||||
The patches following this setting belong to MIDI drum bank \fIN\fP.
|
||||
.PP
|
||||
.IP "\fIpatchno\fP \fIpatchfile\fP [\fBamp=\fP\fIvolume\fP] [\fBnote=\fP\fImiodinte\fP] [\fBkeep=loop\fP] [\fBkeep=env\fP] [\fBremove=sustain\fP] [\fBremove=clamped\fP] [\fBenv_level\fP[\fI0\-5\fP]\fB=\fP\fIlevel\fP] [\fBenv_time\fP[\fI0\-5\fP]\fB=\fP\fItime\fP]"
|
||||
.PP
|
||||
Example: 0 acpiano.pat amp=110
|
||||
.PP
|
||||
.RS
|
||||
.IP "\fIpatchno\fP"
|
||||
This is the MIDI patch number the instrument belongs to.
|
||||
.PP
|
||||
.IP "\fIpatchfile\fP"
|
||||
The filename of the Gravis Ultrasound compatible patch file. If the filename is missing the .pat extension, libWildMidi will add .pat when attempting to load the file.
|
||||
.PP
|
||||
.IP "\fBamp=\fP\fIvolume\fP"
|
||||
Force the volume of the samples in this patch to \fIvolume\fP% prior to using it.
|
||||
.PP
|
||||
.IP "\fBnote=\fP\fImidinote\fP"
|
||||
Use note \fImidinote\fP when playing the samples in this patch. NOTE: this is for instruments listed under drumset.
|
||||
.PP
|
||||
.IP "\fBkeep=loop\fP"
|
||||
Play the samples in this patch with the loop, when normally we would not for this instrument.
|
||||
.PP
|
||||
.IP "\fBkeep=env\fP"
|
||||
Use the envelope data in this patch, when normally we wouldn't for this instrument.
|
||||
.PP
|
||||
.IP "\fBremove=sustain\fP"
|
||||
Do note hold the note after the 3rd envelope until note off, which is what happens if the sustain bit is set in the patch file.
|
||||
.PP
|
||||
.IP "\fBremove=clamped\fP"
|
||||
Do not jump to 6th envelope on note off, which is what happens if the clamped bit is set in the patch file.
|
||||
.PP
|
||||
.IP "\fBenv_level\fP[\fI0\-5\fP]\fB=\fP\fIlevel\fP"
|
||||
Set the envelope level to \fIlevel\fP with 1.0 being maximum, and 0.0 being minimum.
|
||||
.IP
|
||||
Example: set 5th envelope level to 10% \- \fBenv_level[0\-5]=\fP0.1
|
||||
.PP
|
||||
.IP "\fBenv_time\fP[\fI0\-5\fP]\fB=\fP\fItime\fP"
|
||||
Set the envelope time to \fItime\fP with a resolution of 1/1000th of a second. This setting is the time it should take for the envelope to reach maximum level.
|
||||
.IP
|
||||
Example: set 1st envelope time to 1sec \- \fBenv_time0=\fP1000
|
||||
.IP
|
||||
Example: set 3rd envelope time to 0.5secs \- \fBenv_time2=\fP500
|
||||
.RE
|
||||
.PP
|
||||
.IP "\fBreverb_room_width\fP \fIfval\fP"
|
||||
Set the room width for the reverb engine in meters. \fIfval\fP is a float value in meters. Minimum setting is 1.0 meter, maximum setting is 100.0 meters, and default is 15.0 meters.
|
||||
.IP
|
||||
Example: set room width to 30 meters \- \fBreverb_room_width 30\fP
|
||||
.PP
|
||||
.IP "\fBreverb_room_length\fP \fIfval\fP"
|
||||
Set the room length for the reverb engine in meters. \fIfval\fP is a float value in meters. Minimum setting is 1.0 meter, maximum setting is 100.0 meters, and default is 20.0 meters.
|
||||
.IP
|
||||
Example: set room length to 40 meters \- \fBreverb_room_length 40\fP
|
||||
.PP
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR wildmidi (1)
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Chris Ison <wildcode@users.sf.net>
|
||||
Bret Curtis <psi29a@gmail.com>
|
||||
.PP
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) Chris Ison 2001\-2010
|
||||
Copyright (C) Bret Curtis 2013\-2016
|
||||
.PP
|
||||
This file is part of WildMIDI.
|
||||
.PP
|
||||
WildMIDI is free software: you can redistribute and/or modify the player under the terms of the GNU General Public License and you can redistribute and/or modify the library under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the licenses, or(at your option) any later version.
|
||||
.PP
|
||||
WildMIDI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and the GNU Lesser General Public License for more details.
|
||||
.PP
|
||||
You should have received a copy of the GNU General Public License and the GNU Lesser General Public License along with WildMIDI. If not, see <http://www.gnu.org/licenses/>.
|
||||
.PP
|
||||
This manpage is licensed under the Creative Commons Attribution\-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
|
||||
.PP
|
56
external/wildmidi-0.4.5/include/common.h
vendored
Normal file
56
external/wildmidi-0.4.5/include/common.h
vendored
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* common.h -- Midi Wavetable Processing library
|
||||
*
|
||||
* Copyright (C) WildMIDI Developers 2001-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __COMMON_H
|
||||
#define __COMMON_H
|
||||
|
||||
#ifndef __VBCC__
|
||||
#define WMIDI_UNUSED(x) (void)(x)
|
||||
#else
|
||||
#define WMIDI_UNUSED(x) /* vbcc emits an annoying warning for (void)(x) */
|
||||
#endif
|
||||
#define MEM_CHUNK 8192
|
||||
|
||||
extern int16_t _WM_MasterVolume;
|
||||
extern uint16_t _WM_SampleRate;
|
||||
extern uint16_t _WM_MixerOptions;
|
||||
|
||||
extern float _WM_reverb_room_width; /* = 16.875f; */
|
||||
extern float _WM_reverb_room_length; /* = 22.5f; */
|
||||
|
||||
extern float _WM_reverb_listen_posx; /* = 8.4375f; */
|
||||
extern float _WM_reverb_listen_posy; /* = 16.875f; */
|
||||
|
||||
extern void _cvt_reset_options (void);
|
||||
extern uint16_t _cvt_get_option (uint16_t tag);
|
||||
|
||||
/* Set our global defines here */
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
#ifndef M_LN2
|
||||
#define M_LN2 0.69314718055994530942
|
||||
#endif
|
||||
|
||||
#endif /* __COMMON_H */
|
70
external/wildmidi-0.4.5/include/config.h.cmake
vendored
Normal file
70
external/wildmidi-0.4.5/include/config.h.cmake
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
/* config.h -- generated from config.h.cmake */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "wildmidi"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL "http://www.mindwerks.net/projects/wildmidi/"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "https://github.com/Mindwerks/wildmidi/issues"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "WildMidi"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "WildMidi @WILDMIDI_VERSION@"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "wildmidi"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "@WILDMIDI_VERSION@"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "@WILDMIDI_VERSION@"
|
||||
|
||||
/* Define this to the location of the wildmidi config file */
|
||||
#define WILDMIDI_CFG "@WILDMIDI_CFG@"
|
||||
|
||||
/* Define if the C compiler supports the `inline' keyword. */
|
||||
#cmakedefine HAVE_C_INLINE
|
||||
/* Define if the C compiler supports the `__inline__' keyword. */
|
||||
#cmakedefine HAVE_C___INLINE__
|
||||
/* Define if the C compiler supports the `__inline' keyword. */
|
||||
#cmakedefine HAVE_C___INLINE
|
||||
#if !defined(HAVE_C_INLINE) && !defined(__cplusplus)
|
||||
# ifdef HAVE_C___INLINE__
|
||||
# define inline __inline__
|
||||
# elif defined(HAVE_C___INLINE)
|
||||
# define inline __inline
|
||||
# else
|
||||
# define inline
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Define if the compiler has the `__builtin_expect' built-in function */
|
||||
#cmakedefine HAVE___BUILTIN_EXPECT
|
||||
#ifndef HAVE___BUILTIN_EXPECT
|
||||
#define __builtin_expect(x,c) x
|
||||
#endif
|
||||
|
||||
/* define this if you are running a bigendian system (motorola, sparc, etc) */
|
||||
#cmakedefine WORDS_BIGENDIAN 1
|
||||
|
||||
/* define this if building for AmigaOS variants */
|
||||
#cmakedefine WILDMIDI_AMIGA 1
|
||||
|
||||
/* Define if you have the <stdint.h> header file. */
|
||||
#cmakedefine HAVE_STDINT_H
|
||||
|
||||
/* Define if you have the <inttypes.h> header file. */
|
||||
#cmakedefine HAVE_INTTYPES_H
|
||||
|
||||
/* Define our audio drivers */
|
||||
#cmakedefine HAVE_SYS_SOUNDCARD_H
|
||||
|
||||
#cmakedefine AUDIODRV_ALSA
|
||||
#cmakedefine AUDIODRV_OSS
|
||||
#cmakedefine AUDIODRV_OPENAL
|
||||
#cmakedefine AUDIODRV_AHI
|
29
external/wildmidi-0.4.5/include/f_hmi.h
vendored
Normal file
29
external/wildmidi-0.4.5/include/f_hmi.h
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* hmi.h -- Midi Wavetable Processing library
|
||||
*
|
||||
* Copyright (C) WildMIDI Developers 2001-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __HMI_H
|
||||
#define __HMI_H
|
||||
|
||||
extern struct _mdi *_WM_ParseNewHmi(const uint8_t *hmi_data, uint32_t hmi_size);
|
||||
|
||||
#endif /* __HMI_H */
|
29
external/wildmidi-0.4.5/include/f_hmp.h
vendored
Normal file
29
external/wildmidi-0.4.5/include/f_hmp.h
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* hmp.h -- Midi Wavetable Processing library
|
||||
*
|
||||
* Copyright (C) WildMIDI Developers 2001-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __HMP_H
|
||||
#define __HMP_H
|
||||
|
||||
extern struct _mdi *_WM_ParseNewHmp(const uint8_t *hmp_data, uint32_t hmp_size);
|
||||
|
||||
#endif /* __HMP_H */
|
30
external/wildmidi-0.4.5/include/f_midi.h
vendored
Normal file
30
external/wildmidi-0.4.5/include/f_midi.h
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* midi.h -- Midi Wavetable Processing library
|
||||
*
|
||||
* Copyright (C) WildMIDI Developers 2001-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __MIDI_H
|
||||
#define __MIDI_H
|
||||
|
||||
extern struct _mdi *_WM_ParseNewMidi(const uint8_t *midi_data, uint32_t midi_size);
|
||||
extern int _WM_Event2Midi(struct _mdi *mdi, uint8_t **out, uint32_t *outsize);
|
||||
|
||||
#endif /* __MIDI_H */
|
29
external/wildmidi-0.4.5/include/f_mus.h
vendored
Normal file
29
external/wildmidi-0.4.5/include/f_mus.h
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* mus_wm.h -- Midi Wavetable Processing library
|
||||
*
|
||||
* Copyright (C) WildMIDI Developers 2001-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __MUS_WM_H
|
||||
#define __MUS_WM_H
|
||||
|
||||
extern struct _mdi *_WM_ParseNewMus(const uint8_t *mus_data, uint32_t mus_size);
|
||||
|
||||
#endif /* __MUS_WM_H */
|
29
external/wildmidi-0.4.5/include/f_xmidi.h
vendored
Normal file
29
external/wildmidi-0.4.5/include/f_xmidi.h
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* xmi.h -- Midi Wavetable Processing library
|
||||
*
|
||||
* Copyright (C) WildMIDI Developers 2001-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __XMI_H
|
||||
#define __XMI_H
|
||||
|
||||
extern struct _mdi *_WM_ParseNewXmi(const uint8_t *xmi_data, uint32_t xmi_size);
|
||||
|
||||
#endif /* __XMI_H */
|
34
external/wildmidi-0.4.5/include/file_io.h
vendored
Normal file
34
external/wildmidi-0.4.5/include/file_io.h
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* file_io.c -- file handling
|
||||
*
|
||||
* Copyright (C) Chris Ison 2001-2011
|
||||
* Copyright (C) Bret Curtis 2013-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __FILE_IO_H
|
||||
#define __FILE_IO_H
|
||||
|
||||
#define WM_MAXFILESIZE 0x1fffffff
|
||||
extern void *_WM_BufferFileImpl(const char *filename, uint32_t *size);
|
||||
extern void _WM_FreeBufferFileImpl(void*);
|
||||
extern void * (*_WM_BufferFile)(const char *, uint32_t *);
|
||||
extern void (*_WM_FreeBufferFile)(void*);
|
||||
|
||||
#endif /* __FILE_IO_H */
|
197
external/wildmidi-0.4.5/include/filenames.h
vendored
Normal file
197
external/wildmidi-0.4.5/include/filenames.h
vendored
Normal file
|
@ -0,0 +1,197 @@
|
|||
/* Macros for taking apart, interpreting and processing file names.
|
||||
*
|
||||
* These are here because some non-Posix (a.k.a. DOSish) systems have
|
||||
* drive letter brain-damage at the beginning of an absolute file name,
|
||||
* use forward- and back-slash in path names interchangeably, and
|
||||
* some of them have case-insensitive file names.
|
||||
*
|
||||
* This was based on filenames.h from BFD, the Binary File Descriptor
|
||||
* library, Copyright (C) 2000-2016 Free Software Foundation, Inc.,
|
||||
* and changed by O. Sezer <sezero@users.sourceforge.net> for our needs.
|
||||
* The original version of this header in binutils/gcc is GPL licensed,
|
||||
* this modified version was authorized to be LGPL in our LGPL projects:
|
||||
* http://gcc.gnu.org/ml/gcc-patches/2016-09/msg02007.html
|
||||
* http://gcc.gnu.org/ml/gcc-patches/2016-09/msg02179.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef FILENAMES_H
|
||||
#define FILENAMES_H
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* ---------------------- Windows, DOS, OS2: ---------------------- */
|
||||
#if defined(__MSDOS__) || defined(MSDOS) || defined(__DOS__) || \
|
||||
defined(__DJGPP__) || defined(__OS2__) || defined(__EMX__) || \
|
||||
defined(_WIN32) || defined(__CYGWIN__)
|
||||
|
||||
#define HAVE_DOS_BASED_FILE_SYSTEM 1
|
||||
#define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
|
||||
|
||||
#define HAS_DRIVE_SPEC(f) ((f)[0] && ((f)[1] == ':'))
|
||||
#define STRIP_DRIVE_SPEC(f) ((f) + 2)
|
||||
#define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == '\\')
|
||||
/* both '/' and '\\' work as dir separator. djgpp likes changing
|
||||
* '\\' into '/', so I define DIR_SEPARATOR_CHAR as '/' for djgpp,
|
||||
* '\\' otherwise. */
|
||||
#ifdef __DJGPP__
|
||||
#define DIR_SEPARATOR_CHAR '/'
|
||||
#define DIR_SEPARATOR_STR "/"
|
||||
#else
|
||||
#define DIR_SEPARATOR_CHAR '\\'
|
||||
#define DIR_SEPARATOR_STR "\\"
|
||||
#endif
|
||||
/* Note that IS_ABSOLUTE_PATH accepts d:foo as well, although it is
|
||||
only semi-absolute. This is because the users of IS_ABSOLUTE_PATH
|
||||
want to know whether to prepend the current working directory to
|
||||
a file name, which should not be done with a name like d:foo. */
|
||||
#define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]) || HAS_DRIVE_SPEC((f)))
|
||||
|
||||
#ifdef __cplusplus
|
||||
static inline char *FIND_FIRST_DIRSEP(char *_the_path) {
|
||||
/* FIXME: What about C:FOO ? */
|
||||
char *p1 = strchr(_the_path, '/');
|
||||
char *p2 = strchr(_the_path, '\\');
|
||||
if (p1 == NULL) return p2;
|
||||
if (p2 == NULL) return p1;
|
||||
return (p1 < p2)? p1 : p2;
|
||||
}
|
||||
static inline char *FIND_LAST_DIRSEP (char *_the_path) {
|
||||
/* FIXME: What about C:FOO ? */
|
||||
char *p1 = strrchr(_the_path, '/');
|
||||
char *p2 = strrchr(_the_path, '\\');
|
||||
if (p1 == NULL) return p2;
|
||||
if (p2 == NULL) return p1;
|
||||
return (p1 > p2)? p1 : p2;
|
||||
}
|
||||
static inline const char *FIND_FIRST_DIRSEP(const char *_the_path) {
|
||||
/* FIXME: What about C:FOO ? */
|
||||
const char *p1 = strchr(_the_path, '/');
|
||||
const char *p2 = strchr(_the_path, '\\');
|
||||
if (p1 == NULL) return p2;
|
||||
if (p2 == NULL) return p1;
|
||||
return (p1 < p2)? p1 : p2;
|
||||
}
|
||||
static inline const char *FIND_LAST_DIRSEP (const char *_the_path) {
|
||||
/* FIXME: What about C:FOO ? */
|
||||
const char *p1 = strrchr(_the_path, '/');
|
||||
const char *p2 = strrchr(_the_path, '\\');
|
||||
if (p1 == NULL) return p2;
|
||||
if (p2 == NULL) return p1;
|
||||
return (p1 > p2)? p1 : p2;
|
||||
}
|
||||
#else
|
||||
static inline char *FIND_FIRST_DIRSEP(const char *_the_path) {
|
||||
/* FIXME: What about C:FOO ? */
|
||||
char *p1 = strchr(_the_path, '/');
|
||||
char *p2 = strchr(_the_path, '\\');
|
||||
if (p1 == NULL) return p2;
|
||||
if (p2 == NULL) return p1;
|
||||
return (p1 < p2)? p1 : p2;
|
||||
}
|
||||
static inline char *FIND_LAST_DIRSEP (const char *_the_path) {
|
||||
/* FIXME: What about C:FOO ? */
|
||||
char *p1 = strrchr(_the_path, '/');
|
||||
char *p2 = strrchr(_the_path, '\\');
|
||||
if (p1 == NULL) return p2;
|
||||
if (p2 == NULL) return p1;
|
||||
return (p1 > p2)? p1 : p2;
|
||||
}
|
||||
#endif /* C++ */
|
||||
|
||||
/* ----------------- AmigaOS, MorphOS, AROS, etc: ----------------- */
|
||||
#elif defined(__MORPHOS__) || defined(__AROS__) || defined(AMIGAOS) || \
|
||||
defined(__amigaos__) || defined(__amigaos4__) || defined(__amigados__) || \
|
||||
defined(AMIGA) || defined(_AMIGA) || defined(__AMIGA__)
|
||||
|
||||
#define HAS_DRIVE_SPEC(f) (0) /* */
|
||||
#define STRIP_DRIVE_SPEC(f) (f) /* */
|
||||
#define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == ':')
|
||||
#define DIR_SEPARATOR_CHAR '/'
|
||||
#define DIR_SEPARATOR_STR "/"
|
||||
#define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]) || (strchr((f), ':')))
|
||||
#define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
static inline char *FIND_FIRST_DIRSEP(char *_the_path) {
|
||||
char *p = strchr(_the_path, ':');
|
||||
if (p != NULL) return p;
|
||||
return strchr(_the_path, '/');
|
||||
}
|
||||
static inline char *FIND_LAST_DIRSEP (char *_the_path) {
|
||||
char *p = strrchr(_the_path, '/');
|
||||
if (p != NULL) return p;
|
||||
return strchr(_the_path, ':');
|
||||
}
|
||||
static inline const char *FIND_FIRST_DIRSEP(const char *_the_path) {
|
||||
const char *p = strchr(_the_path, ':');
|
||||
if (p != NULL) return p;
|
||||
return strchr(_the_path, '/');
|
||||
}
|
||||
static inline const char *FIND_LAST_DIRSEP (const char *_the_path) {
|
||||
const char *p = strrchr(_the_path, '/');
|
||||
if (p != NULL) return p;
|
||||
return strchr(_the_path, ':');
|
||||
}
|
||||
#else
|
||||
static inline char *FIND_FIRST_DIRSEP(const char *_the_path) {
|
||||
char *p = strchr(_the_path, ':');
|
||||
if (p != NULL) return p;
|
||||
return strchr(_the_path, '/');
|
||||
}
|
||||
static inline char *FIND_LAST_DIRSEP (const char *_the_path) {
|
||||
char *p = strrchr(_the_path, '/');
|
||||
if (p != NULL) return p;
|
||||
return strchr(_the_path, ':');
|
||||
}
|
||||
#endif /* C++ */
|
||||
|
||||
/* ---------------------- assumed UNIX-ish : ---------------------- */
|
||||
#else /* */
|
||||
|
||||
#define IS_DIR_SEPARATOR(c) ((c) == '/')
|
||||
#define DIR_SEPARATOR_CHAR '/'
|
||||
#define DIR_SEPARATOR_STR "/"
|
||||
#define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]))
|
||||
#define HAS_DRIVE_SPEC(f) (0)
|
||||
#define STRIP_DRIVE_SPEC(f) (f)
|
||||
|
||||
#ifdef __cplusplus
|
||||
static inline char *FIND_FIRST_DIRSEP(char *_the_path) {
|
||||
return strchr(_the_path, '/');
|
||||
}
|
||||
static inline char *FIND_LAST_DIRSEP (char *_the_path) {
|
||||
return strrchr(_the_path, '/');
|
||||
}
|
||||
static inline const char *FIND_FIRST_DIRSEP(const char *_the_path) {
|
||||
return strchr(_the_path, '/');
|
||||
}
|
||||
static inline const char *FIND_LAST_DIRSEP (const char *_the_path) {
|
||||
return strrchr(_the_path, '/');
|
||||
}
|
||||
#else
|
||||
static inline char *FIND_FIRST_DIRSEP(const char *_the_path) {
|
||||
return strchr(_the_path, '/');
|
||||
}
|
||||
static inline char *FIND_LAST_DIRSEP (const char *_the_path) {
|
||||
return strrchr(_the_path, '/');
|
||||
}
|
||||
#endif /* C++ */
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* FILENAMES_H */
|
||||
|
79
external/wildmidi-0.4.5/include/getopt_long.h
vendored
Normal file
79
external/wildmidi-0.4.5/include/getopt_long.h
vendored
Normal file
|
@ -0,0 +1,79 @@
|
|||
/* $OpenBSD: getopt.h,v 1.3 2013/11/22 21:32:49 millert Exp $ */
|
||||
/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Dieter Baron and Thomas Klausner.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _GETOPT_H_
|
||||
#define _GETOPT_H_
|
||||
|
||||
/*
|
||||
* GNU-like getopt_long()
|
||||
*/
|
||||
#define no_argument 0
|
||||
#define required_argument 1
|
||||
#define optional_argument 2
|
||||
|
||||
struct option {
|
||||
/* name of long option */
|
||||
const char *name;
|
||||
/*
|
||||
* one of no_argument, required_argument, and optional_argument:
|
||||
* whether option takes an argument
|
||||
*/
|
||||
int has_arg;
|
||||
/* if not NULL, set *flag to val when option found */
|
||||
int *flag;
|
||||
/* if flag not NULL, value to set *flag to; else return value */
|
||||
int val;
|
||||
};
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
int getopt_long(int, char * const *, const char *,
|
||||
const struct option *, int *);
|
||||
int getopt_long_only(int, char * const *, const char *,
|
||||
const struct option *, int *);
|
||||
#ifndef _GETOPT_DEFINED_
|
||||
#define _GETOPT_DEFINED_
|
||||
int getopt(int, char * const *, const char *);
|
||||
|
||||
extern char *optarg; /* getopt(3) external variables */
|
||||
extern int opterr;
|
||||
extern int optind;
|
||||
extern int optopt;
|
||||
extern int optreset;
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_GETOPT_H_ */
|
75
external/wildmidi-0.4.5/include/gus_pat.h
vendored
Normal file
75
external/wildmidi-0.4.5/include/gus_pat.h
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* gus_pat.h -- Midi Wavetable Processing library
|
||||
*
|
||||
* Copyright (C) WildMIDI Developers 2001-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GUS_PAT_H
|
||||
#define __GUS_PAT_H
|
||||
|
||||
/* Guspat Envelope Rate Timings */
|
||||
#ifndef _WILDMIDI_LIB_C
|
||||
static float env_time_table[] = {
|
||||
/* Row 1 = (4095.0 / (x * ( 1.0 / (1.6 * 14.0) ))) / 1000000.0 */
|
||||
0.0f, 0.091728000f, 0.045864000f, 0.030576000f, 0.022932000f, 0.018345600f, 0.015288000f, 0.013104000f,
|
||||
0.011466000f, 0.010192000f, 0.009172800f, 0.008338909f, 0.007644000f, 0.007056000f, 0.006552000f, 0.006115200f,
|
||||
0.005733000f, 0.005395765f, 0.005096000f, 0.004827789f, 0.004586400f, 0.004368000f, 0.004169455f, 0.003988174f,
|
||||
0.003822000f, 0.003669120f, 0.003528000f, 0.003397333f, 0.003276000f, 0.003163034f, 0.003057600f, 0.002958968f,
|
||||
0.002866500f, 0.002779636f, 0.002697882f, 0.002620800f, 0.002548000f, 0.002479135f, 0.002413895f, 0.002352000f,
|
||||
0.002293200f, 0.002237268f, 0.002184000f, 0.002133209f, 0.002084727f, 0.002038400f, 0.001994087f, 0.001951660f,
|
||||
0.001911000f, 0.001872000f, 0.001834560f, 0.001798588f, 0.001764000f, 0.001730717f, 0.001698667f, 0.001667782f,
|
||||
0.001638000f, 0.001609263f, 0.001581517f, 0.001554712f, 0.001528800f, 0.001503738f, 0.001479484f, 0.001456000f,
|
||||
|
||||
/* Row 2 = (4095.0 / (x * ((1.0 / (1.6 * 14.0)) / 8.0 ))) / 1000000.0 */
|
||||
0.0f, 0.733824000f, 0.366912000f, 0.244608000f, 0.183456000f, 0.146764800f, 0.122304000f, 0.104832000f,
|
||||
0.091728000f, 0.081536000f, 0.073382400f, 0.066711273f, 0.061152000f, 0.056448000f, 0.052416000f, 0.048921600f,
|
||||
0.045864000f, 0.043166118f, 0.040768000f, 0.038622316f, 0.036691200f, 0.034944000f, 0.033355636f, 0.031905391f,
|
||||
0.030576000f, 0.029352960f, 0.028224000f, 0.027178667f, 0.026208000f, 0.025304276f, 0.024460800f, 0.023671742f,
|
||||
0.022932000f, 0.022237091f, 0.021583059f, 0.020966400f, 0.020384000f, 0.019833081f, 0.019311158f, 0.018816000f,
|
||||
0.018345600f, 0.017898146f, 0.017472000f, 0.017065674f, 0.016677818f, 0.016307200f, 0.015952696f, 0.015613277f,
|
||||
0.015288000f, 0.014976000f, 0.014676480f, 0.014388706f, 0.014112000f, 0.013845736f, 0.013589333f, 0.013342255f,
|
||||
0.013104000f, 0.012874105f, 0.012652138f, 0.012437695f, 0.012230400f, 0.012029902f, 0.011835871f, 0.011648000f,
|
||||
|
||||
/* Row 3 = (4095.0 / (x * ((1.0 / (1.6 * 14.0)) / 64.0 ))) / 1000000.0 */
|
||||
0.0f, 5.870592000f, 2.935296000f, 1.956864000f, 1.467648000f, 1.174118400f, 0.978432000f, 0.838656000f,
|
||||
0.733824000f, 0.652288000f, 0.587059200f, 0.533690182f, 0.489216000f, 0.451584000f, 0.419328000f, 0.391372800f,
|
||||
0.366912000f, 0.345328941f, 0.326144000f, 0.308978526f, 0.293529600f, 0.279552000f, 0.266845091f, 0.255243130f,
|
||||
0.244608000f, 0.234823680f, 0.225792000f, 0.217429333f, 0.209664000f, 0.202434207f, 0.195686400f, 0.189373935f,
|
||||
0.183456000f, 0.177896727f, 0.172664471f, 0.167731200f, 0.163072000f, 0.158664649f, 0.154489263f, 0.150528000f,
|
||||
0.146764800f, 0.143185171f, 0.139776000f, 0.136525395f, 0.133422545f, 0.130457600f, 0.127621565f, 0.124906213f,
|
||||
0.122304000f, 0.119808000f, 0.117411840f, 0.115109647f, 0.112896000f, 0.110765887f, 0.108714667f, 0.106738036f,
|
||||
0.104832000f, 0.102992842f, 0.101217103f, 0.099501559f, 0.097843200f, 0.096239213f, 0.094686968f, 0.093184000f,
|
||||
|
||||
/* Row 4 = (4095.0 / (x * ((1.0 / (1.6 * 14.0)) / 512.0))) / 1000000.0 */
|
||||
0.0f, 46.964736000f,23.482368000f,15.654912000f,11.741184000f, 9.392947200f, 7.827456000f, 6.709248000f,
|
||||
5.870592000f, 5.218304000f, 4.696473600f, 4.269521455f, 3.913728000f, 3.612672000f, 3.354624000f, 3.130982400f,
|
||||
2.935296000f, 2.762631529f, 2.609152000f, 2.471828211f, 2.348236800f, 2.236416000f, 2.134760727f, 2.041945043f,
|
||||
1.956864000f, 1.878589440f, 1.806336000f, 1.739434667f, 1.677312000f, 1.619473655f, 1.565491200f, 1.514991484f,
|
||||
1.467648000f, 1.423173818f, 1.381315765f, 1.341849600f, 1.304576000f, 1.269317189f, 1.235914105f, 1.204224000f,
|
||||
1.174118400f, 1.145481366f, 1.118208000f, 1.092203163f, 1.067380364f, 1.043660800f, 1.020972522f, 0.999249702f,
|
||||
0.978432000f, 0.958464000f, 0.939294720f, 0.920877176f, 0.903168000f, 0.886127094f, 0.869717333f, 0.853904291f,
|
||||
0.838656000f, 0.823942737f, 0.809736828f, 0.796012475f, 0.782745600f, 0.769913705f, 0.757495742f, 0.745472000f
|
||||
};
|
||||
#endif /* !_WILDMIDI_LIB_C */
|
||||
|
||||
extern struct _sample * _WM_load_gus_pat (const char *filename, int _fix_release);
|
||||
|
||||
#endif /* __GUS_PAT_H */
|
||||
|
252
external/wildmidi-0.4.5/include/internal_midi.h
vendored
Normal file
252
external/wildmidi-0.4.5/include/internal_midi.h
vendored
Normal file
|
@ -0,0 +1,252 @@
|
|||
/*
|
||||
* internal_midi.h -- Midi Wavetable Processing library
|
||||
*
|
||||
* Copyright (C) WildMIDI Developers 2001-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __INTERNAL_MIDI_H
|
||||
#define __INTERNAL_MIDI_H
|
||||
|
||||
struct _channel {
|
||||
uint8_t bank;
|
||||
struct _patch *patch;
|
||||
uint8_t hold;
|
||||
uint8_t volume;
|
||||
uint8_t pressure;
|
||||
uint8_t expression;
|
||||
int8_t balance;
|
||||
int8_t pan;
|
||||
int16_t left_adjust;
|
||||
int16_t right_adjust;
|
||||
int16_t pitch;
|
||||
int16_t pitch_range;
|
||||
int32_t pitch_adjust;
|
||||
uint16_t reg_data;
|
||||
uint8_t reg_non;
|
||||
uint8_t isdrum;
|
||||
};
|
||||
|
||||
struct _event_data {
|
||||
uint8_t channel;
|
||||
union Data {
|
||||
uint32_t value;
|
||||
char * string;
|
||||
} data;
|
||||
};
|
||||
|
||||
struct _note {
|
||||
uint16_t noteid;
|
||||
uint8_t velocity;
|
||||
struct _patch *patch;
|
||||
struct _sample *sample;
|
||||
uint32_t sample_pos;
|
||||
uint32_t sample_inc;
|
||||
int32_t env_inc;
|
||||
uint8_t env;
|
||||
int32_t env_level;
|
||||
uint8_t modes;
|
||||
uint8_t hold;
|
||||
uint8_t active;
|
||||
struct _note *replay;
|
||||
struct _note *next;
|
||||
uint32_t left_mix_volume;
|
||||
uint32_t right_mix_volume;
|
||||
uint8_t is_off;
|
||||
uint8_t ignore_chan_events;
|
||||
};
|
||||
|
||||
struct _mdi;
|
||||
|
||||
enum _event_type {
|
||||
ev_null = -1,
|
||||
ev_midi_divisions,
|
||||
ev_note_off,
|
||||
ev_note_on,
|
||||
ev_aftertouch,
|
||||
ev_control_bank_select,
|
||||
ev_control_data_entry_course,
|
||||
ev_control_channel_volume,
|
||||
ev_control_channel_balance,
|
||||
ev_control_channel_pan,
|
||||
ev_control_channel_expression,
|
||||
ev_control_data_entry_fine,
|
||||
ev_control_channel_hold,
|
||||
ev_control_data_increment,
|
||||
ev_control_data_decrement,
|
||||
ev_control_non_registered_param_fine,
|
||||
ev_control_non_registered_param_course,
|
||||
ev_control_registered_param_fine,
|
||||
ev_control_registered_param_course,
|
||||
ev_control_channel_sound_off,
|
||||
ev_control_channel_controllers_off,
|
||||
ev_control_channel_notes_off,
|
||||
ev_control_dummy,
|
||||
ev_patch,
|
||||
ev_channel_pressure,
|
||||
ev_pitch,
|
||||
ev_sysex_roland_drum_track,
|
||||
ev_sysex_gm_reset,
|
||||
ev_sysex_roland_reset,
|
||||
ev_sysex_yamaha_reset,
|
||||
ev_meta_endoftrack,
|
||||
ev_meta_tempo,
|
||||
ev_meta_timesignature,
|
||||
ev_meta_keysignature,
|
||||
ev_meta_sequenceno,
|
||||
ev_meta_channelprefix,
|
||||
ev_meta_portprefix,
|
||||
ev_meta_smpteoffset,
|
||||
ev_meta_text,
|
||||
ev_meta_copyright,
|
||||
ev_meta_trackname,
|
||||
ev_meta_instrumentname,
|
||||
ev_meta_lyric,
|
||||
ev_meta_marker,
|
||||
ev_meta_cuepoint
|
||||
};
|
||||
|
||||
struct _event {
|
||||
enum _event_type evtype;
|
||||
void (*do_event)(struct _mdi *mdi, struct _event_data *data);
|
||||
struct _event_data event_data;
|
||||
uint32_t samples_to_next;
|
||||
uint32_t samples_to_next_fixed;
|
||||
};
|
||||
|
||||
struct _mdi {
|
||||
int lock;
|
||||
uint32_t samples_to_mix;
|
||||
struct _event *events;
|
||||
struct _event *current_event;
|
||||
uint32_t event_count;
|
||||
uint32_t events_size; /* try to stay optimally ahead to prevent reallocs */
|
||||
struct _WM_Info extra_info;
|
||||
struct _WM_Info *tmp_info;
|
||||
uint16_t midi_master_vol;
|
||||
struct _channel channel[16];
|
||||
struct _note *note;
|
||||
struct _note note_table[2][16][128];
|
||||
|
||||
struct _patch **patches;
|
||||
uint32_t patch_count;
|
||||
int16_t amp;
|
||||
|
||||
int32_t *mix_buffer;
|
||||
uint32_t mix_buffer_size;
|
||||
|
||||
struct _rvb *reverb;
|
||||
|
||||
int32_t dyn_vol_peak;
|
||||
double dyn_vol_adjust;
|
||||
double dyn_vol;
|
||||
double dyn_vol_to_reach;
|
||||
|
||||
uint8_t is_type2;
|
||||
|
||||
char *lyric;
|
||||
};
|
||||
|
||||
|
||||
extern int16_t _WM_lin_volume[];
|
||||
extern uint32_t _WM_freq_table[];
|
||||
|
||||
/* ===================== */
|
||||
|
||||
/*
|
||||
* All "do" functions need to be "extern" for playback
|
||||
*/
|
||||
extern void _WM_do_midi_divisions(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_note_off(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_note_on(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_aftertouch(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_bank_select(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_data_entry_course(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_channel_volume(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_channel_balance(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_channel_pan(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_channel_expression(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_data_entry_fine(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_channel_hold(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_data_increment(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_data_decrement(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_non_registered_param_fine(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_non_registered_param_course(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_registered_param_fine(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_registered_param_course(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_channel_sound_off(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_channel_controllers_off(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_channel_notes_off(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_control_dummy(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_patch(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_channel_pressure(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_pitch(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_sysex_roland_drum_track(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_sysex_gm_reset(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_sysex_roland_reset(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_sysex_yamaha_reset(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_meta_endoftrack(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_meta_tempo(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_meta_timesignature(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_meta_keysignature(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_meta_sequenceno(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_meta_channelprefix(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_meta_portprefix(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_meta_smpteoffset(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_meta_text(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_meta_copyright(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_meta_trackname(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_meta_instrumentname(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_meta_lyric(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_meta_marker(struct _mdi *mdi, struct _event_data *data);
|
||||
extern void _WM_do_meta_cuepoint(struct _mdi *mdi, struct _event_data *data);
|
||||
|
||||
/*
|
||||
* We need to expose these fuctions for use on some or the parsers due to some
|
||||
* formats not being able to trigger these events via _WM_Setup_Midi_Event.
|
||||
*/
|
||||
extern int _WM_midi_setup_noteoff(struct _mdi *mdi, uint8_t channel, uint8_t note, uint8_t velocity);
|
||||
extern int _WM_midi_setup_endoftrack(struct _mdi *mdi);
|
||||
extern int _WM_midi_setup_tempo(struct _mdi *mdi, uint32_t setting);
|
||||
|
||||
/* ===================== */
|
||||
|
||||
/*
|
||||
* Only non-standard midi event or non-track event setup functions need to be here
|
||||
*/
|
||||
extern int _WM_midi_setup_divisions(struct _mdi *mdi, uint32_t divisions);
|
||||
|
||||
/* ===================== */
|
||||
|
||||
/*
|
||||
* All other declarations
|
||||
*/
|
||||
|
||||
extern struct _mdi * _WM_initMDI(void);
|
||||
extern void _WM_freeMDI(struct _mdi *mdi);
|
||||
extern uint32_t _WM_SetupMidiEvent(struct _mdi *mdi, const uint8_t *event_data, uint32_t inlen, uint8_t running_event);
|
||||
extern void _WM_ResetToStart(struct _mdi *mdi);
|
||||
extern void _WM_do_pan_adjust(struct _mdi *mdi, uint8_t ch);
|
||||
extern void _WM_do_note_off_extra(struct _note *nte);
|
||||
/* extern void _WM_DynamicVolumeAdjust(struct _mdi *mdi, int32_t *tmp_buffer, uint32_t buffer_used);*/
|
||||
extern void _WM_AdjustChannelVolumes(struct _mdi *mdi, uint8_t ch);
|
||||
extern float _WM_GetSamplesPerTick(uint32_t divisions, uint32_t tempo);
|
||||
|
||||
#endif /* __INTERNAL_MIDI_H */
|
||||
|
36
external/wildmidi-0.4.5/include/lock.h
vendored
Normal file
36
external/wildmidi-0.4.5/include/lock.h
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* lock.h - data locking code for lib
|
||||
*
|
||||
* Copyright (C) Chris Ison 2001-2011
|
||||
* Copyright (C) Bret Curtis 2013-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __LOCK_H
|
||||
#define __LOCK_H
|
||||
|
||||
extern void _WM_Lock (int * wmlock);
|
||||
extern void _WM_Unlock (int *wmlock);
|
||||
|
||||
#if defined WM_NO_LOCK
|
||||
#define _WM_Lock(p) do {} while (0)
|
||||
#define _WM_Unlock(p) do {} while (0)
|
||||
#endif
|
||||
|
||||
#endif /* __LOCK_H */
|
31
external/wildmidi-0.4.5/include/mus2mid.h
vendored
Normal file
31
external/wildmidi-0.4.5/include/mus2mid.h
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* MUS2MIDI: DMX (DOOM) MUS to MIDI Library Header
|
||||
*
|
||||
* Copyright (C) 2014-2016 Bret Curtis
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef MUSLIB_H
|
||||
#define MUSLIB_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
int _WM_mus2midi (const uint8_t *in, uint32_t insize,
|
||||
uint8_t **out, uint32_t *outsize,
|
||||
uint16_t frequency);
|
||||
|
||||
#endif /* MUSLIB_H */
|
57
external/wildmidi-0.4.5/include/patches.h
vendored
Normal file
57
external/wildmidi-0.4.5/include/patches.h
vendored
Normal file
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* patches.h -- Midi Wavetable Processing library
|
||||
*
|
||||
* Copyright (C) WildMIDI Developers 2001-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __PATCHES_H
|
||||
#define __PATCHES_H
|
||||
|
||||
struct _env {
|
||||
float time;
|
||||
float level;
|
||||
uint8_t set;
|
||||
};
|
||||
|
||||
struct _sample;
|
||||
struct _mdi;
|
||||
|
||||
struct _patch {
|
||||
uint16_t patchid;
|
||||
uint8_t loaded;
|
||||
char *filename;
|
||||
int16_t amp;
|
||||
uint8_t keep;
|
||||
uint8_t remove;
|
||||
struct _env env[6];
|
||||
uint8_t note;
|
||||
uint32_t inuse_count;
|
||||
struct _sample *first_sample;
|
||||
struct _patch *next;
|
||||
};
|
||||
|
||||
extern struct _patch *_WM_patch[128];
|
||||
|
||||
extern int _WM_patch_lock;
|
||||
|
||||
extern struct _patch *_WM_get_patch_data(struct _mdi *mdi, uint16_t patchid);
|
||||
extern void _WM_load_patch(struct _mdi *mdi, uint16_t patchid);
|
||||
|
||||
#endif /* __PATCHES_H */
|
55
external/wildmidi-0.4.5/include/reverb.h
vendored
Normal file
55
external/wildmidi-0.4.5/include/reverb.h
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* reverb.h -- Midi Wavetable Processing library
|
||||
*
|
||||
* Copyright (C) Chris Ison 2001-2011
|
||||
* Copyright (C) Bret Curtis 2013-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __REVERB_H
|
||||
#define __REVERB_H
|
||||
|
||||
struct _rvb {
|
||||
/* filter data */
|
||||
int32_t l_buf_flt_in[8][6][2];
|
||||
int32_t l_buf_flt_out[8][6][2];
|
||||
int32_t r_buf_flt_in[8][6][2];
|
||||
int32_t r_buf_flt_out[8][6][2];
|
||||
int32_t coeff[8][6][5];
|
||||
/* buffer data */
|
||||
int32_t *l_buf;
|
||||
int32_t *r_buf;
|
||||
int l_buf_size;
|
||||
int r_buf_size;
|
||||
int l_out;
|
||||
int r_out;
|
||||
int l_sp_in[8];
|
||||
int r_sp_in[8];
|
||||
int l_in[4];
|
||||
int r_in[4];
|
||||
int gain;
|
||||
uint32_t max_reverb_time;
|
||||
};
|
||||
|
||||
extern void _WM_reset_reverb (struct _rvb *rvb);
|
||||
extern struct _rvb *_WM_init_reverb(int rate, float room_x, float room_y, float listen_x, float listen_y);
|
||||
extern void _WM_free_reverb (struct _rvb *rvb);
|
||||
extern void _WM_do_reverb (struct _rvb *rvb, int32_t *buffer, int size);
|
||||
|
||||
#endif /* __REVERB_H */
|
73
external/wildmidi-0.4.5/include/sample.h
vendored
Normal file
73
external/wildmidi-0.4.5/include/sample.h
vendored
Normal file
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
* sample.h -- Midi Wavetable Processing library
|
||||
*
|
||||
* Copyright (C) WildMIDI Developers 2001-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __SAMPLE_H
|
||||
#define __SAMPLE_H
|
||||
|
||||
#define SAMPLE_16BIT 0x01
|
||||
#define SAMPLE_UNSIGNED 0x02
|
||||
#define SAMPLE_LOOP 0x04
|
||||
#define SAMPLE_PINGPONG 0x08
|
||||
#define SAMPLE_REVERSE 0x10
|
||||
#define SAMPLE_SUSTAIN 0x20
|
||||
#define SAMPLE_ENVELOPE 0x40
|
||||
#define SAMPLE_CLAMPED 0x80
|
||||
|
||||
#ifdef DEBUG_SAMPLES
|
||||
#define SAMPLE_CONVERT_DEBUG(dx) printf("\r%s\n",dx)
|
||||
#else
|
||||
#define SAMPLE_CONVERT_DEBUG(dx)
|
||||
#endif
|
||||
|
||||
struct _patch;
|
||||
struct _mdi;
|
||||
|
||||
struct _sample {
|
||||
uint32_t data_length;
|
||||
uint32_t loop_start;
|
||||
uint32_t loop_end;
|
||||
uint32_t loop_size;
|
||||
uint8_t loop_fraction;
|
||||
uint16_t rate;
|
||||
uint32_t freq_low;
|
||||
uint32_t freq_high;
|
||||
uint32_t freq_root;
|
||||
uint8_t modes;
|
||||
int32_t env_rate[7];
|
||||
int32_t env_target[7];
|
||||
uint32_t inc_div;
|
||||
int16_t *data;
|
||||
struct _sample *next;
|
||||
|
||||
uint32_t note_off_decay;
|
||||
};
|
||||
|
||||
extern int _WM_fix_release;
|
||||
extern int _WM_auto_amp;
|
||||
extern int _WM_auto_amp_with_amp;
|
||||
|
||||
extern struct _sample *_WM_get_sample_data(struct _patch *sample_patch, uint32_t freq);
|
||||
extern int _WM_load_sample(struct _patch *sample_patch);
|
||||
extern uint32_t _WM_get_decay_samples(struct _mdi * mdi, uint8_t channel, uint8_t note);
|
||||
|
||||
#endif /* __SAMPLE_H */
|
27
external/wildmidi-0.4.5/include/stdint/stdint.h
vendored
Normal file
27
external/wildmidi-0.4.5/include/stdint/stdint.h
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
#ifndef WM_STDINT_H
|
||||
#define WM_STDINT_H
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
typedef signed char int8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed short int int16_t;
|
||||
typedef unsigned short int uint16_t;
|
||||
|
||||
#if (INT_MAX == 2147483647)
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
#elif (LONG_MAX == 2147483647)
|
||||
typedef signed long int int32_t;
|
||||
typedef unsigned long int uint32_t;
|
||||
#else
|
||||
#error define a 32bit integral type
|
||||
#endif /* int32_t */
|
||||
|
||||
/* make sure of type sizes */
|
||||
typedef int _wm_int8_test [(sizeof(int8_t ) == 1) * 2 - 1];
|
||||
typedef int _wm_int16_test[(sizeof(int16_t) == 2) * 2 - 1];
|
||||
typedef int _wm_int32_test[(sizeof(int32_t) == 4) * 2 - 1];
|
||||
|
||||
#endif /* WM_STDINT_H */
|
||||
|
166
external/wildmidi-0.4.5/include/wildmidi_lib.h
vendored
Normal file
166
external/wildmidi-0.4.5/include/wildmidi_lib.h
vendored
Normal file
|
@ -0,0 +1,166 @@
|
|||
/*
|
||||
* wildmidi_lib.h -- Midi Wavetable Processing library
|
||||
*
|
||||
* Copyright (C) WildMIDI Developers 2001-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef WILDMIDI_LIB_H
|
||||
#define WILDMIDI_LIB_H
|
||||
|
||||
/* library version number */
|
||||
#define LIBWILDMIDI_VER_MAJOR 0L
|
||||
#define LIBWILDMIDI_VER_MINOR 4L
|
||||
#define LIBWILDMIDI_VER_MICRO 5L
|
||||
#define LIBWILDMIDI_VERSION \
|
||||
((LIBWILDMIDI_VER_MAJOR << 16) | \
|
||||
(LIBWILDMIDI_VER_MINOR << 8) | \
|
||||
(LIBWILDMIDI_VER_MICRO ))
|
||||
|
||||
/* public constants */
|
||||
#define WM_MO_LOG_VOLUME 0x0001
|
||||
#define WM_MO_ENHANCED_RESAMPLING 0x0002
|
||||
#define WM_MO_REVERB 0x0004
|
||||
#define WM_MO_LOOP 0x0008
|
||||
#define WM_MO_SAVEASTYPE0 0x1000
|
||||
#define WM_MO_ROUNDTEMPO 0x2000
|
||||
#define WM_MO_STRIPSILENCE 0x4000
|
||||
#define WM_MO_TEXTASLYRIC 0x8000
|
||||
|
||||
/* conversion options */
|
||||
#define WM_CO_XMI_TYPE 0x0010
|
||||
#define WM_CO_FREQUENCY 0x0020
|
||||
|
||||
/* for WildMidi_GetString */
|
||||
#define WM_GS_VERSION 0x0001
|
||||
|
||||
/* set our symbol export visiblity */
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
/* ========== NOTE TO WINDOWS DEVELOPERS:
|
||||
* If you are compiling for Windows and will link to the static library
|
||||
* (libWildMidi.a with MinGW, or wildmidi_static.lib with MSVC, etc),
|
||||
* you must define WILDMIDI_STATIC in your project. Otherwise dllimport
|
||||
* will be assumed. */
|
||||
# if defined(WILDMIDI_BUILD) && defined(DLL_EXPORT) /* building libWildMidi as a dll for windows */
|
||||
# define WM_SYMBOL __declspec(dllexport)
|
||||
# elif defined(WILDMIDI_BUILD) || defined(WILDMIDI_STATIC) /* building or using static libWildMidi for windows */
|
||||
# define WM_SYMBOL
|
||||
# else /* using libWildMidi dll for windows */
|
||||
# define WM_SYMBOL __declspec(dllimport)
|
||||
# endif
|
||||
#elif defined(WILDMIDI_BUILD)
|
||||
# if defined(SYM_VISIBILITY) /* __GNUC__ >= 4, or older gcc with backported feature */
|
||||
# define WM_SYMBOL __attribute__ ((visibility ("default")))
|
||||
/*
|
||||
# elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
|
||||
# define WM_SYMBOL __attribute__ ((visibility ("default")))
|
||||
*/
|
||||
# elif defined(SYM_LDSCOPE) /* __SUNPRO_C >= 0x550 */
|
||||
# define WM_SYMBOL __global
|
||||
# elif defined(__OS2__) && defined(__WATCOMC__) && defined(__SW_BD)
|
||||
# define WM_SYMBOL __declspec(dllexport)
|
||||
# else
|
||||
# define WM_SYMBOL
|
||||
# endif
|
||||
#else
|
||||
# define WM_SYMBOL
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _WM_Info {
|
||||
char *copyright;
|
||||
uint32_t current_sample;
|
||||
uint32_t approx_total_samples;
|
||||
uint16_t mixer_options;
|
||||
uint32_t total_midi_time;
|
||||
};
|
||||
|
||||
typedef void midi;
|
||||
|
||||
typedef void * (*_WM_VIO_Allocate)(const char *, uint32_t *);
|
||||
typedef void (*_WM_VIO_Free)(void *);
|
||||
|
||||
struct _WM_VIO {
|
||||
/*
|
||||
This function should allocate a buffer which has the size
|
||||
of the requested file plus one (size+1), fill the buffer
|
||||
with the file content, and the second parameter with the
|
||||
size of the file.
|
||||
|
||||
The buffer is in possession of wildmidi until the free_file
|
||||
function is called with the buffer address as argument.
|
||||
*/
|
||||
_WM_VIO_Allocate allocate_file;
|
||||
|
||||
/*
|
||||
This function should free the memory of the given buffer.
|
||||
*/
|
||||
_WM_VIO_Free free_file;
|
||||
};
|
||||
|
||||
WM_SYMBOL const char * WildMidi_GetString (uint16_t info);
|
||||
WM_SYMBOL long WildMidi_GetVersion (void);
|
||||
WM_SYMBOL int WildMidi_Init (const char *config_file, uint16_t rate, uint16_t mixer_options);
|
||||
WM_SYMBOL int WildMidi_InitVIO(struct _WM_VIO * callbacks, const char *config_file, uint16_t rate, uint16_t mixer_options);
|
||||
WM_SYMBOL int WildMidi_MasterVolume (uint8_t master_volume);
|
||||
WM_SYMBOL midi * WildMidi_Open (const char *midifile);
|
||||
WM_SYMBOL midi * WildMidi_OpenBuffer (const uint8_t *midibuffer, uint32_t size);
|
||||
WM_SYMBOL int WildMidi_GetMidiOutput (midi *handle, int8_t **buffer, uint32_t *size);
|
||||
WM_SYMBOL int WildMidi_GetOutput (midi *handle, int8_t *buffer, uint32_t size);
|
||||
WM_SYMBOL int WildMidi_SetOption (midi *handle, uint16_t options, uint16_t setting);
|
||||
WM_SYMBOL int WildMidi_SetCvtOption (uint16_t tag, uint16_t setting);
|
||||
WM_SYMBOL int WildMidi_ConvertToMidi (const char *file, uint8_t **out, uint32_t *size);
|
||||
WM_SYMBOL int WildMidi_ConvertBufferToMidi (const uint8_t *in, uint32_t insize,
|
||||
uint8_t **out, uint32_t *size);
|
||||
WM_SYMBOL struct _WM_Info * WildMidi_GetInfo (midi * handle);
|
||||
WM_SYMBOL int WildMidi_FastSeek (midi * handle, unsigned long int *sample_pos);
|
||||
WM_SYMBOL int WildMidi_SongSeek (midi * handle, int8_t nextsong);
|
||||
WM_SYMBOL int WildMidi_Close (midi * handle);
|
||||
WM_SYMBOL int WildMidi_Shutdown (void);
|
||||
WM_SYMBOL char * WildMidi_GetLyric (midi * handle);
|
||||
|
||||
WM_SYMBOL char * WildMidi_GetError (void);
|
||||
WM_SYMBOL void WildMidi_ClearError (void);
|
||||
|
||||
|
||||
/* NOTE: Not Yet Implemented Or Tested Properly */
|
||||
/* Due to delay in audio output in the player, this is not being developed
|
||||
futher at the moment. Further Development will occur when output latency
|
||||
has been reduced enough to "appear" instant.
|
||||
WM_SYMBOL int WildMidi_Live (midi * handle, uint32_t midi_event);
|
||||
*/
|
||||
|
||||
/* reserved for future coding
|
||||
* need to change these to use a time for cmd_pos and new_cmd_pos
|
||||
|
||||
WM_SYMBOL int WildMidi_InsertMidiEvent (midi * handle, uint8_t char midi_cmd, *char midi_cmd_data, unsigned long int midi_cmd_data_size, unsigned long int *cmd_pos);
|
||||
WM_SYMBOL int WildMidi_DeleteMidiEvent (midi * handle, uint8_t char midi_cmd, unsigned long int *cmd_pos);
|
||||
WM_SYMBOL int WildMidi_MoveMidiEvent (midi * handle, , uint8_t char midi_cmd, unsigned long int *cmd_pos, unsigned long int *new_cmd_pos);
|
||||
*/
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* WILDMIDI_LIB_H */
|
69
external/wildmidi-0.4.5/include/wm_error.h
vendored
Normal file
69
external/wildmidi-0.4.5/include/wm_error.h
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* wm_error.h -- error reporting
|
||||
*
|
||||
* Copyright (C) WildMIDI Developers 2001-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __WM_ERROR_H
|
||||
#define __WM_ERROR_H
|
||||
|
||||
enum {
|
||||
WM_ERR_NONE = 0,
|
||||
WM_ERR_MEM,
|
||||
WM_ERR_STAT,
|
||||
WM_ERR_LOAD,
|
||||
WM_ERR_OPEN,
|
||||
WM_ERR_READ,
|
||||
WM_ERR_INVALID,
|
||||
WM_ERR_CORUPT,
|
||||
WM_ERR_NOT_INIT,
|
||||
WM_ERR_INVALID_ARG,
|
||||
WM_ERR_ALR_INIT,
|
||||
WM_ERR_NOT_MIDI,
|
||||
WM_ERR_LONGFIL,
|
||||
WM_ERR_NOT_HMP,
|
||||
WM_ERR_NOT_HMI,
|
||||
WM_ERR_CONVERT,
|
||||
WM_ERR_NOT_MUS,
|
||||
WM_ERR_NOT_XMI,
|
||||
|
||||
WM_ERR_MAX
|
||||
};
|
||||
|
||||
extern char * _WM_Global_ErrorS;
|
||||
extern int _WM_Global_ErrorI;
|
||||
|
||||
extern void _WM_GLOBAL_ERROR(const char *func, int lne, int wmerno, const char * wmfor, int error);
|
||||
|
||||
/* sets the global error string to a custom msg */
|
||||
extern void _WM_ERROR_NEW(const char * wmfmt, ...)
|
||||
#ifdef __GNUC__
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
#endif
|
||||
;
|
||||
|
||||
/* prints a debug message to stderr */
|
||||
extern void _WM_DEBUG_MSG(const char * wmfmt, ...)
|
||||
#ifdef __GNUC__
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
#endif
|
||||
;
|
||||
|
||||
#endif /* __WM_ERROR_H */
|
35
external/wildmidi-0.4.5/include/wm_tty.h
vendored
Normal file
35
external/wildmidi-0.4.5/include/wm_tty.h
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
/* wm_tty.h - unix termios code for player
|
||||
*
|
||||
* Copyright (C) Chris Ison 2001-2011
|
||||
* Copyright (C) Bret Curtis 2013-2016
|
||||
*
|
||||
* This file is part of WildMIDI.
|
||||
*
|
||||
* WildMIDI is free software: you can redistribute and/or modify the player
|
||||
* under the terms of the GNU General Public License and you can redistribute
|
||||
* and/or modify the library under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of
|
||||
* the licenses, or(at your option) any later version.
|
||||
*
|
||||
* WildMIDI is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and
|
||||
* the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License and the
|
||||
* GNU Lesser General Public License along with WildMIDI. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef wm_tty_h
|
||||
#define wm_tty_h
|
||||
|
||||
void wm_inittty(void);
|
||||
void wm_resetty(void);
|
||||
|
||||
#if defined(_WIN32)||defined(__DJGPP__)||defined(WILDMIDI_AMIGA)||defined(__OS2__)||defined(__EMX__)
|
||||
#define wm_inittty() do {} while (0)
|
||||
#define wm_resetty() do {} while (0)
|
||||
#endif /* _WIN32, __DJGPP__, __OS2__ */
|
||||
|
||||
#endif /* wm_tty_h */
|
42
external/wildmidi-0.4.5/include/xmi2mid.h
vendored
Normal file
42
external/wildmidi-0.4.5/include/xmi2mid.h
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* XMIDI: Miles XMIDI to MID Library Header
|
||||
*
|
||||
* Copyright (C) 2001 Ryan Nunn
|
||||
* Copyright (C) 2014-2016 Bret Curtis
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/* XMIDI Converter */
|
||||
|
||||
#ifndef XMIDILIB_H
|
||||
#define XMIDILIB_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* Conversion types for Midi files */
|
||||
#define XMIDI_CONVERT_NOCONVERSION 0x00
|
||||
#define XMIDI_CONVERT_MT32_TO_GM 0x01
|
||||
#define XMIDI_CONVERT_MT32_TO_GS 0x02
|
||||
#define XMIDI_CONVERT_MT32_TO_GS127 0x03 /* This one is broken, don't use */
|
||||
#define XMIDI_CONVERT_MT32_TO_GS127DRUM 0x04 /* This one is broken, don't use */
|
||||
#define XMIDI_CONVERT_GS127_TO_GS 0x05
|
||||
|
||||
int _WM_xmi2midi(const uint8_t *in, uint32_t insize,
|
||||
uint8_t **out, uint32_t *outsize,
|
||||
uint32_t convert_type);
|
||||
|
||||
#endif /* XMIDILIB_H */
|
120
external/wildmidi-0.4.5/macosx/Makefile
vendored
Normal file
120
external/wildmidi-0.4.5/macosx/Makefile
vendored
Normal file
|
@ -0,0 +1,120 @@
|
|||
# Makefile to build WildMidi library and player for Mac OS X.
|
||||
|
||||
# Set to 1 for debug build
|
||||
DEBUG = 0
|
||||
|
||||
# The tools
|
||||
ifeq ($(CROSS),)
|
||||
CC=gcc
|
||||
AS=as
|
||||
AR=ar
|
||||
RANLIB=ranlib
|
||||
LIPO=lipo
|
||||
else
|
||||
CC=$(CROSS)-gcc
|
||||
AS=$(CROSS)-as
|
||||
AR=$(CROSS)-ar
|
||||
RANLIB=$(CROSS)-ranlib
|
||||
LIPO=$(CROSS)-lipo
|
||||
endif
|
||||
LD = $(CC)
|
||||
|
||||
DYLIB_MAJ=2
|
||||
DYLIB_MID=1
|
||||
DYLIB_MIN=0
|
||||
|
||||
LIBNAME=WildMidi
|
||||
LIBSTATIC=lib$(LIBNAME).a
|
||||
LIBSHARED=lib$(LIBNAME).dylib
|
||||
LIBSHARED_FULL=lib$(LIBNAME).$(DYLIB_MAJ).$(DYLIB_MID).$(DYLIB_MIN).dylib
|
||||
LIBSHARED_MAJ=lib$(LIBNAME).$(DYLIB_MAJ).dylib
|
||||
LIB_INSTALLNAME=$(LIBSHARED_MAJ)
|
||||
PLAYER=wildmidi
|
||||
PLAYER_STATIC=wildmidi-static
|
||||
|
||||
INCLUDE=-I. -I../include
|
||||
ARFLAGS=cr
|
||||
CFLAGS=$(INCLUDE) -Wall -W -fno-common
|
||||
LDFLAGS=
|
||||
LDLIBS=
|
||||
ifeq ($(DEBUG),1)
|
||||
CFLAGS+=-g
|
||||
else
|
||||
CFLAGS+=-O2 -fomit-frame-pointer -ffast-math
|
||||
endif
|
||||
# specifically for 10.5 and newer:
|
||||
#CFLAGS+=-mmacosx-version-min=10.5
|
||||
#LDFLAGS+=-mmacosx-version-min=10.5
|
||||
# specifically for 10.6 and newer:
|
||||
#CFLAGS+=-mmacosx-version-min=10.6
|
||||
#LDFLAGS+=-mmacosx-version-min=10.6 -Wl,-lbundle1.o
|
||||
|
||||
CFLAGS_LIB=$(CFLAGS) -DWILDMIDI_BUILD
|
||||
LDFLAGS_LIB=$(LDFLAGS)
|
||||
LDLIBS_LIB=$(LDLIBS)
|
||||
LDFLAGS_LIB+=-dynamiclib -Wl,-single_module
|
||||
LDFLAGS_LIB+=-Wl,-undefined,error
|
||||
LDFLAGS_LIB+=-Wl,-install_name,"@executable_path/$(LIB_INSTALLNAME)"
|
||||
LDFLAGS_LIB+=-Wl,-compatibility_version,$(DYLIB_MAJ).0.0 -Wl,-current_version,$(DYLIB_MAJ).$(DYLIB_MID).$(DYLIB_MIN)
|
||||
|
||||
CFLAGS_EXE=$(CFLAGS)
|
||||
LDFLAGS_EXE=$(LDFLAGS)
|
||||
LDLIBS_EXE=$(LDLIBS)
|
||||
# OpenAL output support (comment out if not wanted)
|
||||
CFLAGS_EXE+=-DAUDIODRV_OPENAL
|
||||
LDFLAGS_EXE+=-Wl,-framework,OpenAL
|
||||
LDLIBS_EXE+=-L. -l$(LIBNAME)
|
||||
|
||||
# Objects
|
||||
LIB_OBJ = wm_error.o file_io.o lock.o wildmidi_lib.o reverb.o gus_pat.o
|
||||
LIB_OBJ+= f_xmidi.o f_mus.o f_hmp.o f_midi.o f_hmi.o mus2mid.o xmi2mid.o internal_midi.o patches.o sample.o
|
||||
PLAYER_OBJ = wm_tty.o wildmidi.o
|
||||
|
||||
.PHONY: clean distclean
|
||||
|
||||
help:
|
||||
@echo "Valid targets:"
|
||||
@echo ""
|
||||
@echo " $(MAKE) shared"
|
||||
@echo " $(MAKE) static"
|
||||
@echo ""
|
||||
|
||||
shared: $(LIBSHARED) $(PLAYER)
|
||||
shared: CFLAGS_LIB+=-fvisibility=hidden -DSYM_VISIBILITY
|
||||
|
||||
static: $(LIBSTATIC) $(PLAYER_STATIC)
|
||||
static: CFLAGS+=-DWILDMIDI_STATIC
|
||||
|
||||
$(LIBSHARED_FULL): $(LIB_OBJ)
|
||||
$(CC) $^ $(LDFLAGS_LIB) $(LDLIBS_LIB) -o $@
|
||||
$(LIBSHARED_MAJ): $(LIBSHARED_FULL)
|
||||
ln -s $^ $@
|
||||
$(LIBSHARED): $(LIBSHARED_MAJ)
|
||||
ln -s $^ $@
|
||||
|
||||
$(LIBSTATIC): $(LIB_OBJ)
|
||||
$(AR) $(ARFLAGS) $@ $^
|
||||
$(RANLIB) $@
|
||||
|
||||
$(PLAYER): $(PLAYER_OBJ) $(LIBSHARED)
|
||||
$(LD) $(PLAYER_OBJ) $(LDFLAGS_EXE) $(LDLIBS_EXE) -o $@
|
||||
|
||||
$(PLAYER_STATIC): $(PLAYER_OBJ) $(LIBSTATIC)
|
||||
$(LD) $(PLAYER_OBJ) $(LDFLAGS_EXE) $(LDLIBS_EXE) -o $@
|
||||
|
||||
# Build rules
|
||||
%.o: %.c
|
||||
$(CC) -c $(CFLAGS_LIB) -o $@ $<
|
||||
%.o: ../src/%.c
|
||||
$(CC) -c $(CFLAGS_LIB) -o $@ $<
|
||||
# for player objects:
|
||||
wildmidi.o: ../src/wildmidi.c
|
||||
$(CC) -c $(CFLAGS_EXE) -o $@ $<
|
||||
wm_tty.o: ../src/wm_tty.c
|
||||
$(CC) -c $(CFLAGS_EXE) -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -rf $(LIB_OBJ) $(PLAYER_OBJ)
|
||||
|
||||
distclean: clean
|
||||
rm -rf *.a *.dylib $(PLAYER) $(PLAYER_STATIC)
|
22
external/wildmidi-0.4.5/macosx/config.h
vendored
Normal file
22
external/wildmidi-0.4.5/macosx/config.h
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
#define WILDMIDI_CFG "wildmidi.cfg"
|
||||
|
||||
#define PACKAGE_URL "http://www.mindwerks.net/projects/wildmidi/"
|
||||
#define PACKAGE_BUGREPORT "https://github.com/Mindwerks/wildmidi/issues"
|
||||
|
||||
#define PACKAGE_VERSION "0.4.5"
|
||||
|
||||
#define HAVE_C_INLINE
|
||||
|
||||
#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR >= 96)
|
||||
#define HAVE___BUILTIN_EXPECT
|
||||
#endif
|
||||
#ifndef HAVE___BUILTIN_EXPECT
|
||||
#define __builtin_expect(x,c) x
|
||||
#endif
|
||||
|
||||
#if defined(__POWERPC__) || defined(__ppc__) || defined(__BIG_ENDIAN__)
|
||||
#define WORDS_BIGENDIAN 1
|
||||
#endif
|
||||
|
||||
#define HAVE_STDINT_H 1
|
||||
#define HAVE_INTTYPES_H 1
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue