Browse Source

New upstream version 2.0.5

upstream upstream/2.0.5
Fabian Greffrath 4 years ago
parent
commit
151b8b31ae
  1. 63
      .appveyor-mingw.yml
  2. 45
      .appveyor-vcpkg.yml
  3. 45
      .appveyor.yml
  4. 10
      .cirrus.yml
  5. 61
      .clang-format
  6. 54
      .clang-tidy
  7. 45
      .github/issue_template.md
  8. 40
      .gitignore
  9. 202
      .travis.yml
  10. 8
      AUTHORS
  11. 304
      CMakeLists.txt
  12. 40
      CONTRIBUTING.md
  13. 192
      INSTALL
  14. 11
      Makefile.am
  15. 81
      README-OSX
  16. 188
      README.cmake
  17. 115
      README.cmake.md
  18. 50
      README.md
  19. 22
      TODO
  20. 126
      acinclude.m4
  21. 12
      autogen.sh
  22. 11
      bindings/README
  23. 77
      bindings/fluidmax/README.TXT
  24. 339
      bindings/fluidmax/build/osx-macho/fluidmax.xcodeproj/project.pbxproj
  25. 10
      bindings/fluidmax/build/osx-macho/maxternal.plist
  26. 6
      bindings/fluidmax/build/winxp-vs8/fluidsynth.def
  27. 19
      bindings/fluidmax/build/winxp-vs8/fluidsynth.sln
  28. BIN
      bindings/fluidmax/build/winxp-vs8/fluidsynth.suo
  29. 324
      bindings/fluidmax/build/winxp-vs8/fluidsynth.vcproj
  30. 12
      bindings/fluidmax/config_maxmsp.h
  31. 1664
      bindings/fluidmax/fluidmax.c
  32. BIN
      bindings/fluidmax/fluidmax.mcp
  33. 252
      bindings/fluidmax/fluidmax_fakefuns.c
  34. BIN
      bindings/fluidmax/fluidsynth.jpg
  35. BIN
      bindings/fluidmax/fluidsynth~.help
  36. 76
      bindings/fluidmax/ftmax.h
  37. 10
      bindings/fluidsynth_jni/README
  38. 115
      bindings/fluidsynth_jni/fluidsynth_jni.dsp
  39. 29
      bindings/fluidsynth_jni/fluidsynth_jni.dsw
  40. 426
      bindings/fluidsynth_jni/include/sndfile.h
  41. 8
      bindings/fluidsynth_jni/java/fluidsynth/FluidException.java
  42. 39
      bindings/fluidsynth_jni/java/fluidsynth/Sample.java
  43. 49
      bindings/fluidsynth_jni/java/fluidsynth/Synth.java
  44. 36
      bindings/fluidsynth_jni/java/fluidsynth/Test.java
  45. BIN
      bindings/fluidsynth_jni/lib/libsndfile.lib
  46. 17
      bindings/fluidsynth_jni/src/fluidsynth_Sample.cpp
  47. 29
      bindings/fluidsynth_jni/src/fluidsynth_Sample.h
  48. 38
      bindings/fluidsynth_jni/src/fluidsynth_Synth.cpp
  49. 48
      bindings/fluidsynth_jni/src/fluidsynth_Synth.h
  50. 267
      bindings/fluidsynth_jni/src/fluidsynth_jni.cpp
  51. 18
      bindings/fluidsynth_jni/src/fluidsynth_jni.h
  52. 6
      cmake_admin/DefaultDirs.cmake
  53. 28
      cmake_admin/FluidUnitTest.cmake
  54. 15
      cmake_admin/Makefile.am
  55. 2
      cmake_admin/VersionResource.rc
  56. 41
      cmake_admin/report.cmake
  57. 636
      configure.ac
  58. 9
      doc/Doxyfile
  59. 7
      doc/Doxyfile.cmake
  60. BIN
      doc/FluidProfile_0004.pdf
  61. BIN
      doc/FluidSynth-LADSPA.pdf
  62. 40
      doc/Makefile.am
  63. 13
      doc/README
  64. 12
      doc/doxy_formula.css
  65. 71
      doc/example.c
  66. 698
      doc/fluidsettings.xml
  67. 216
      doc/fluidsettings.xsl
  68. 1901
      doc/fluidsynth-v11-devdoc.txt
  69. 754
      doc/fluidsynth-v20-devdoc.txt
  70. 256
      doc/fluidsynth.1
  71. 157
      doc/fluidsynth_arpeggio.c
  72. 230
      doc/fluidsynth_fx.c
  73. 139
      doc/fluidsynth_metronome.c
  74. 117
      doc/fluidsynth_process.c
  75. 31
      doc/fluidsynth_register_adriver.c
  76. 92
      doc/fluidsynth_sfload_mem.c
  77. 143
      doc/fluidsynth_simple.c
  78. 483
      doc/ladspa.md
  79. BIN
      doc/polymono/FluidPolyMono-0004.pdf
  80. 103
      doc/polymono/leg_00.txt
  81. 103
      doc/polymono/leg_01.txt
  82. 107
      doc/polymono/leg_por_00.txt
  83. 107
      doc/polymono/leg_por_01.txt
  84. 8
      doc/polymono/poly_mono_0.txt
  85. 25
      doc/polymono/poly_mono_1.txt
  86. 22
      doc/polymono/poly_mono_2.txt
  87. 26
      doc/polymono/poly_mono_3.txt
  88. 25
      doc/polymono/poly_mono_4.txt
  89. 9
      doc/polymono/poly_mono_5.txt
  90. 22
      doc/polymono/readme.txt
  91. 30
      fluidsynth.anjuta
  92. 2
      fluidsynth.service.in
  93. 26
      include/CMakeLists.txt
  94. 6
      include/Makefile.am
  95. 2
      include/fluidsynth.cmake
  96. 51
      include/fluidsynth/CMakeLists.txt
  97. 22
      include/fluidsynth/Makefile.am
  98. 45
      include/fluidsynth/audio.h
  99. 143
      include/fluidsynth/event.h
  100. 164
      include/fluidsynth/gen.h

63
.appveyor-mingw.yml

@ -0,0 +1,63 @@
image:
- Visual Studio 2013
build:
parallel: true
verbosity: detailed
environment:
matrix:
- platform: x86
glib-url: http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib_2.28.8-1_win32.zip
glib-dev-url: http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib-dev_2.28.8-1_win32.zip
pkg-config-url: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip
gettext-url: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip
proxy-libintl-dev-url: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/proxy-libintl-dev_20100902_win32.zip
- platform: x64
glib-url: http://ftp.gnome.org/pub/gnome/binaries/win64/glib/2.26/glib_2.26.1-1_win64.zip
glib-dev-url: http://ftp.gnome.org/pub/gnome/binaries/win64/glib/2.26/glib-dev_2.26.1-1_win64.zip
pkg-config-url: http://ftp.gnome.org/pub/gnome/binaries/win64/dependencies/pkg-config_0.23-2_win64.zip
gettext-url: http://ftp.gnome.org/pub/gnome/binaries/win64/dependencies/gettext-runtime_0.18.1.1-2_win64.zip
proxy-libintl-dev-url: http://ftp.gnome.org/pub/gnome/binaries/win64/dependencies/proxy-libintl-dev_20100902_win64.zip
init:
- echo %APPVEYOR_BUILD_WORKER_IMAGE%
install:
# make sure the latest version of git is installed
- choco upgrade git -y
- mkdir c:\deps
- cd c:\deps
- curl -fsS -o glib.zip %glib-url%
- curl -fsS -o glib-dev.zip %glib-dev-url%
- curl -fsS -o pkg-config.zip %pkg-config-url%
- curl -fsS -o gettext.zip %gettext-url%
- curl -fsS -o libintl-dev.zip %proxy-libintl-dev-url%
- 7z x glib.zip > NUL
- 7z x glib-dev.zip > NUL
- 7z x pkg-config.zip > NUL
- 7z x gettext.zip > NUL
- 7z x libintl-dev.zip > NUL
- SET PATH=C:\deps\bin;%PATH%
- if "%platform%"=="x64" ( SET "PATH=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%" ) else ( SET "PATH=C:\MinGW\bin;%PATH%" )
build_script:
# - call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
# - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
- cd C:\projects\fluidsynth-rjimi
- mkdir build
- cd build
# remove that path from PATH to make sure sh.exe is not found (cmake will complain otherwise)
- set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
- echo %PATH%
- echo %CFLAGS%
- cmake -G "MinGW Makefiles" -DCMAKE_VERBOSE_MAKEFILE=1 ..
- mingw32-make.exe check
after_build:
- 7z a fluidsynth-%platform%.zip %APPVEYOR_BUILD_FOLDER%\build\src\* c:\deps\bin\libglib*.dll c:\deps\bin\libgthread*.dll c:\deps\bin\*intl*.dll
artifacts:
- path: build/fluidsynth-%platform%.zip
name: FluidSynth

45
.appveyor-vcpkg.yml

@ -1,7 +1,8 @@
os:
- Visual Studio 2015
image:
- Visual Studio 2017
build:
parallel: true
verbosity: detailed
configuration:
@ -13,26 +14,54 @@ environment:
matrix:
- platform: x86
generator: Visual Studio 14 2015
CMAKE_FLAGS:
- platform: x86
CMAKE_FLAGS: -Denable-network=0
- platform: x86
CMAKE_FLAGS: -DBUILD_SHARED_LIBS=0
- platform: x64
CMAKE_FLAGS:
- platform: x64
CMAKE_FLAGS: -Denable-network=0
- platform: x64
generator: Visual Studio 14 2015 Win64
CMAKE_FLAGS: -DBUILD_SHARED_LIBS=0
# - platform: ARM ## currently fails to build pcre:arm-windows
cache:
- c:\Tools\vcpkg\installed
init:
- set TARGET_PLATFORM=
- if "%platform%"=="x64" ( set TARGET_PLATFORM= Win64)
- if "%platform%"=="ARM" ( set TARGET_PLATFORM= ARM)
- echo %TARGET_PLATFORM%
- echo %APPVEYOR_BUILD_WORKER_IMAGE%
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( set "generator=Visual Studio 15 2017%TARGET_PLATFORM%" && set "toolset=v141_xp" )
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" ( set "generator=Visual Studio 14 2015%TARGET_PLATFORM%" && set "toolset=v140_xp" )
- echo %generator%
- echo %toolset%
install:
# make sure the latest version of git is installed
- choco upgrade git -y
- vcpkg install glib:%platform%-windows
build_script:
- mkdir build
- cd build
- cmake -G "%generator%" -Denable-pkgconfig=0 -DCMAKE_TOOLCHAIN_FILE=c:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake ..
- cmake --build . --config Release
- cmake -G "%generator%" -T "%toolset%" %CMAKE_FLAGS% -Denable-pkgconfig=0 -DCMAKE_TOOLCHAIN_FILE=c:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake ..
- cmake --build . --config Release # build libfluidsynth and fluidsynth exec
- cmake --build . --config Release --target check # build and exec unittests
after_build:
- 7z a fluidsynth.zip %APPVEYOR_BUILD_FOLDER%\build\src\Release\*
- 7z a fluidsynth-vcpkg-%platform%.zip %APPVEYOR_BUILD_FOLDER%\build\src\Release\*
artifacts:
- path: build/fluidsynth.zip
- path: build/fluidsynth-vcpkg-%platform%.zip
name: FluidSynth

45
.appveyor.yml

@ -1,16 +1,16 @@
os:
image:
- Visual Studio 2015
build:
parallel: true
verbosity: detailed
configuration:
- Release
environment:
matrix:
- platform: x86
generator: Visual Studio 14 2015
glib-url: http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib_2.28.8-1_win32.zip
glib-dev-url: http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib-dev_2.28.8-1_win32.zip
pkg-config-url: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip
@ -18,15 +18,39 @@ environment:
proxy-libintl-dev-url: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/proxy-libintl-dev_20100902_win32.zip
- platform: x64
generator: Visual Studio 14 2015 Win64
glib-url: http://ftp.gnome.org/pub/gnome/binaries/win64/glib/2.26/glib_2.26.1-1_win64.zip
glib-dev-url: http://ftp.gnome.org/pub/gnome/binaries/win64/glib/2.26/glib-dev_2.26.1-1_win64.zip
pkg-config-url: http://ftp.gnome.org/pub/gnome/binaries/win64/dependencies/pkg-config_0.23-2_win64.zip
gettext-url: http://ftp.gnome.org/pub/gnome/binaries/win64/dependencies/gettext-runtime_0.18.1.1-2_win64.zip
proxy-libintl-dev-url: http://ftp.gnome.org/pub/gnome/binaries/win64/dependencies/proxy-libintl-dev_20100902_win64.zip
- platform: x86
glib-url: http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.16/glib_2.16.6-1_win32.zip
glib-dev-url: http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.16/glib-dev_2.16.6-1_win32.zip
pkg-config-url: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip
gettext-url: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip
proxy-libintl-dev-url: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/proxy-libintl-dev_20100902_win32.zip
- platform: x64
glib-url: http://ftp.acc.umu.se/pub/gnome/binaries/win64/glib/2.24/glib_2.24.2-2_win64.zip
glib-dev-url: http://ftp.acc.umu.se/pub/gnome/binaries/win64/glib/2.24/glib-dev_2.24.0-1_win64.zip
pkg-config-url: http://ftp.gnome.org/pub/gnome/binaries/win64/dependencies/pkg-config_0.23-2_win64.zip
gettext-url: http://ftp.gnome.org/pub/gnome/binaries/win64/dependencies/gettext-runtime_0.18.1.1-2_win64.zip
proxy-libintl-dev-url: http://ftp.gnome.org/pub/gnome/binaries/win64/dependencies/proxy-libintl-dev_20100902_win64.zip
init:
- set TARGET_PLATFORM=
- if "%platform%"=="x64" ( set TARGET_PLATFORM= Win64)
- echo %TARGET_PLATFORM%
- echo %APPVEYOR_BUILD_WORKER_IMAGE%
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( set "generator=Visual Studio 15 2017%TARGET_PLATFORM%" && set "toolset=v141_xp" )
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" ( set "generator=Visual Studio 14 2015%TARGET_PLATFORM%" && set "toolset=v140_xp" )
- echo %generator%
- echo %toolset%
install:
# make sure the latest version of git is installed
- choco upgrade git -y
- mkdir c:\deps
- cd c:\deps
- curl -fsS -o glib.zip %glib-url%
@ -39,7 +63,7 @@ install:
- 7z x pkg-config.zip > NUL
- 7z x gettext.zip > NUL
- 7z x libintl-dev.zip > NUL
- SET PATH=C:\deps\bin;%PATH%
- SET "PATH=C:\deps\bin;%PATH%"
build_script:
# - call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
@ -47,12 +71,13 @@ build_script:
- cd C:\projects\fluidsynth
- mkdir build
- cd build
- cmake -G "%generator%" ..
- cmake -G "%generator%" -T "%toolset%" ..
- cmake --build . --config Release
- cmake --build . --config Release --target check # build and exec unittests
after_build:
- 7z a fluidsynth.zip %APPVEYOR_BUILD_FOLDER%\build\src\Release\* c:\deps\bin\libglib*.dll c:\deps\bin\libgthread*.dll c:\deps\bin\*intl*.dll
- 7z a fluidsynth-%platform%.zip %APPVEYOR_BUILD_FOLDER%\build\src\Release\* c:\deps\bin\libglib*.dll c:\deps\bin\libgthread*.dll c:\deps\bin\*intl*.dll
artifacts:
- path: build/fluidsynth.zip
- path: build/fluidsynth-%platform%.zip
name: FluidSynth

10
.cirrus.yml

@ -0,0 +1,10 @@
freebsd_instance:
image: freebsd-12-0-release-amd64
task:
install_script: pwd && ls -la && pkg install -y cmake glib alsa-lib ladspa portaudio pulseaudio pkgconf
compile_script: pwd && ls -la && mkdir $HOME/fluidsynth_install/ && mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=$HOME/fluidsynth_install -Denable-portaudio=1 -Denable-ladspa=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE=0 .. && make -j4 && make check && make install

61
.clang-format

@ -0,0 +1,61 @@
AccessModifierOffset: 0
AlignEscapedNewlinesLeft: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
ColumnLimit: 100
CommentPragmas: ''
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 0
Cpp11BracedListStyle: false
DerivePointerAlignment: false
IndentCaseLabels: true
IndentWidth: 4
Language: Cpp
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
PenaltyBreakBeforeFirstCallParameter: 100
PenaltyBreakComment: 100
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 100
PenaltyExcessCharacter: 1
PenaltyReturnTypeOnItsOwnLine: 20
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SortIncludes: false
Standard: Cpp11
TabWidth: 4
UseTab: Never

54
.clang-tidy

@ -0,0 +1,54 @@
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,cert-*,clang-analyzer-*,performance-*,readability-avoid-const-params-in-decls,readability-braces-around-statements,readability-delete-null-pointer,readability-implicit-bool-conversion,readability-misleading-indentation,readability-misplaced-array-index,readability-non-const-parameter,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-simplify-boolean-expr'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: file
User: tom
CheckOptions:
- key: cert-dcl59-cpp.HeaderFileExtensions
value: h,hh,hpp,hxx
- key: cert-err09-cpp.CheckThrowTemporaries
value: '1'
- key: cert-err61-cpp.CheckThrowTemporaries
value: '1'
- key: cert-oop11-cpp.IncludeStyle
value: llvm
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
- key: google-readability-function-size.StatementThreshold
value: '800'
- key: google-readability-namespace-comments.ShortNamespaceLines
value: '10'
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
- key: modernize-loop-convert.MaxCopySize
value: '16'
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
- key: performance-faster-string-find.StringLikeClasses
value: 'std::basic_string'
- key: performance-for-range-copy.WarnOnAllAutoCopies
value: '0'
- key: performance-inefficient-string-concatenation.StrictMode
value: '0'
- key: performance-type-promotion-in-math-fn.IncludeStyle
value: llvm
- key: performance-unnecessary-value-param.IncludeStyle
value: llvm
- key: readability-braces-around-statements.ShortStatementLines
value: '0'
- key: readability-simplify-boolean-expr.ChainedConditionalAssignment
value: '0'
- key: readability-simplify-boolean-expr.ChainedConditionalReturn
value: '0'
...

45
.github/issue_template.md

@ -0,0 +1,45 @@
<!--
This issue tracker is only for bug reports and concrete feature requests.
DO NOT SUBMIT SUPPORT REQUESTS OR "HOW TO" QUESTIONS HERE!
Else it might be closed without further notice.
If you have a question look into our wiki
( https://github.com/FluidSynth/fluidsynth/wiki )
or the developer resources
( http://www.fluidsynth.org/api/ )
If you still have a question, need support or want to discuss ideas, contact our mailing list:
https://lists.nongnu.org/mailman/listinfo/fluid-dev
Below is a form that shall help getting relevant information for bugs and feature requests together.
We strongly recommend to use it! Feel free to edit or remove inapplicable/unneeded parts.
-->
### FluidSynth version <!-- enter FluidSynths version you're using -->
1.1.x
### Current behavior
<!-- Describe the current situation, e.g. how the bug manifests. -->
### Expected behavior
<!-- Describe what the behavior would be without the bug or how the
feature request would make your life easier. -->
### Steps to reproduce
<!-- Please explain the steps required to duplicate the issue,
esp. if you are able to provide a sample application.
E.g. how to start fluidsynth, what shell commands to enter, what midi events to send, etc. -->
### Other information
<!-- If you are able to illustrate the bug or feature request with an example, please provide simple
source code below or as attatched file. List any other information that is relevant to your issue:
Stack traces,
related issues,
build logs,
suggestions on how to fix,
links to related discussions at fluid-dev
etc.
-->
```
insert code snippets, soundfonts or anything relevant here, or attach it as extra file(s) if it's too much
```

40
.gitignore

@ -0,0 +1,40 @@
build/
CMakeCache.txt
CMakeFiles
Makefile
cmake_install.cmake
install_manifest.txt
# Object files
*.o
*.ko
*.obj
*.elf
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# ProjectFiles
*.pro.user*

202
.travis.yml

@ -1,198 +1,72 @@
language: c
#sudo: required
sudo: false
os: linux
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
- llvm-toolchain-trusty-7
packages:
- cmake-data
- cmake
- libglib2.0-0
- libsndfile-dev
- libasound2-dev
- libjack-dev
- portaudio19-dev
- libpulse-dev
- libdbus-glib-1-dev
- ladspa-sdk
env:
- CMAKE_FLAGS="-Denable-profiling=1"
- CMAKE_FLAGS="-Denable-floats=1 -Denable-profiling=1"
- CMAKE_FLAGS="-Denable-floats=0"
- CMAKE_FLAGS="-Denable-trap-on-fpe=1"
- CMAKE_FLAGS="-Denable-fpe-check=1"
- CMAKE_FLAGS="-Denable-ipv6=0"
- CMAKE_FLAGS="-Denable-network=0"
- CMAKE_FLAGS="-Denable-aufile=0"
- CMAKE_FLAGS="-DBUILD_SHARED_LIBS=0"
matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- cmake-data
- cmake
- libglib2.0-0
- libsndfile-dev
- libasound2-dev
- libjack-dev
- portaudio19-dev
- libpulse-dev
- libdbus-glib-1-dev
- ladspa-sdk
env:
- MATRIX_EVAL="CC=gcc-4.8 && CXX=g++-4.8"
- CMAKE_FLAGS="-Denable-floats=1"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- cmake-data
- cmake
- libglib2.0-0
- libsndfile-dev
- libasound2-dev
- libjack-dev
- portaudio19-dev
- libpulse-dev
- libdbus-glib-1-dev
- ladspa-sdk
env:
- MATRIX_EVAL="CC=gcc-4.8 && CXX=g++-4.8"
- CMAKE_FLAGS="-Denable-floats=0"
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
- cmake-data
- cmake
- libglib2.0-0
- ladspa-sdk
env:
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
# works on Precise and Trusty
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
- cmake-data
- cmake
- libglib2.0-0
- ladspa-sdk
env:
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
- CMAKE_FLAGS="-Denable-debug=1"
# works on Precise and Trusty
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
- cmake-data
- cmake
- libglib2.0-0
- ladspa-sdk
env:
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
- os: osx
osx_image: xcode10
# works on Precise and Trusty
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- cmake-data
- cmake
- libglib2.0-0
- ladspa-sdk
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && sudo apt-get install gcc-7"
# works on Precise and Trusty
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
- cmake-data
- cmake
- libglib2.0-0
- ladspa-sdk
env:
- MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8 && sudo apt-get install gcc-8"
- CMAKE_FLAGS="-Denable-debug=1 -DCMAKE_C_FLAGS_DEBUG=-fuse-ld=gold"
# works on Trusty
- os: linux
addons:
apt:
sources:
- llvm-toolchain-trusty-3.9
packages:
- clang-3.9
- cmake-data
- cmake
- libglib2.0-0
- ladspa-sdk
env:
- MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
- MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8 && sudo apt-get install clang-3.8"
# works on Trusty
- os: linux
addons:
apt:
sources:
- llvm-toolchain-trusty-4.0
packages:
- clang-4.0
- cmake-data
- cmake
- libglib2.0-0
- ladspa-sdk
env:
- MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
- MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0 && sudo apt-get install clang-6.0"
# works on Trusty
- os: linux
addons:
apt:
sources:
- llvm-toolchain-trusty-5.0
packages:
- clang-5.0
- cmake-data
- cmake
- libglib2.0-0
- ladspa-sdk
env:
- MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
- os: osx
osx_image: xcode8
env:
- MATRIX_EVAL="brew install gcc5 glib && CC=gcc-5 && CXX=g++-5"
- os: osx
osx_image: xcode8
env:
- MATRIX_EVAL="brew install gcc6 glib && CC=gcc-6 && CXX=g++-6"
- os: osx
osx_image: xcode8
env:
- MATRIX_EVAL="brew install gcc glib libsndfile jack dbus-glib pulseaudio portaudio && CC=gcc-7 && CXX=g++-7"
- MATRIX_EVAL="CC=clang-7 && CXX=clang++-7 && sudo apt-get install clang-7"
before_install:
- if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get update; else brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install glib gettext libsndfile jack dbus-glib pulseaudio portaudio; fi # && brew link gettext
- eval "${MATRIX_EVAL}"
before_script:
- mkdir $HOME/fluidsynth_install/
- mkdir build && cd build
script:
- cmake ${CMAKE_FLAGS} "-Denable-portaudio=1" "-Denable-ladspa=1" "-DCMAKE_BUILD_TYPE=RelWithDebInfo" ..
- cmake -DCMAKE_INSTALL_PREFIX=$HOME/fluidsynth_install ${CMAKE_FLAGS} -Denable-portaudio=1 -Denable-ladspa=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE=0 ..
- make -j4
- make check
- if [ $TRAVIS_OS_NAME = linux ]; then make install; fi # install only on linux, as CMAKE_INSTALL_PREFIX is ignored for frameworks on macosx and I cant tell whether that's correct or a bug.

8
AUTHORS

@ -120,6 +120,11 @@ summary of contributions.
* Matt Giuca improved the midi player by letting it load midi files from RAM,
and by making it handle EOT events.
* Tom Moebert (fluidsynth's maintainer since Jun 2017) cleaned up and refactored
fluidsynth's API and revised its documentation, added support for 24 bit sample
soundfonts, fixed various bugs, implemented unit tests and CI builds for
Windows, Linux, MacOSX.
* Growing list of individuals who contributed bug fixes, corrections and minor features:
Nicolas Boulicault for ALSA sequencer midi.portname setting.
Werner Schweer
@ -143,3 +148,6 @@ Nick Daly
David Hilvert
Bernat Arlandis i Mañó
Sven Meier
Marcus Weseloh
Jean-jacques Ceresa

304
CMakeLists.txt

@ -19,7 +19,7 @@
# CMake based build system. Pedro Lopez-Cabanillas <plcl@users.sf.net>
cmake_minimum_required ( VERSION 3.0.2 )
cmake_minimum_required ( VERSION 3.1.0 ) # because of CMAKE_C_STANDARD
project ( FluidSynth C )
set ( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_admin )
@ -27,9 +27,9 @@ set ( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_admin )
set ( PACKAGE "fluidsynth" )
# FluidSynth package version
set ( FLUIDSYNTH_VERSION_MAJOR 1 )
set ( FLUIDSYNTH_VERSION_MINOR 1 )
set ( FLUIDSYNTH_VERSION_MICRO 11 )
set ( FLUIDSYNTH_VERSION_MAJOR 2 )
set ( FLUIDSYNTH_VERSION_MINOR 0 )
set ( FLUIDSYNTH_VERSION_MICRO 5 )
set ( VERSION "${FLUIDSYNTH_VERSION_MAJOR}.${FLUIDSYNTH_VERSION_MINOR}.${FLUIDSYNTH_VERSION_MICRO}" )
set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" )
@ -42,8 +42,8 @@ set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" )
# if any interfaces have been added: AGE++
# if any interfaces have been removed/changed (compatibility broken): AGE=0
# This is not exactly the same algorithm as the libtool one, but the results are the same.
set ( LIB_VERSION_CURRENT 1 )
set ( LIB_VERSION_AGE 7 )
set ( LIB_VERSION_CURRENT 2 )
set ( LIB_VERSION_AGE 1 )
set ( LIB_VERSION_REVISION 2 )
set ( LIB_VERSION_INFO
"${LIB_VERSION_CURRENT}.${LIB_VERSION_AGE}.${LIB_VERSION_REVISION}" )
@ -51,10 +51,9 @@ set ( LIB_VERSION_INFO
# Options disabled by default
option ( enable-debug "enable debugging (default=no)" off )
option ( enable-floats "enable type float instead of double for DSP samples" off )
option ( enable-profiling "profile the dsp code" off )
option ( enable-ladspa "enable LADSPA effect units" off )
option ( enable-fpe-check "enable Floating Point Exception checks and debug messages" off )
option ( enable-portaudio "compile PortAudio support" off )
option ( enable-profiling "profile the dsp code" off )
option ( enable-trap-on-fpe "enable SIGFPE trap on Floating Point Exceptions" off )
# Options enabled by default
@ -63,18 +62,26 @@ option ( BUILD_SHARED_LIBS "Build a shared object or DLL" on )
option ( enable-dbus "compile DBUS support (if it is available)" on )
option ( enable-ipv6 "enable ipv6 support" on )
option ( enable-jack "compile JACK support (if it is available)" on )
option ( enable-ladspa "enable LADSPA effect units" on )
option ( enable-libsndfile "compile libsndfile support (if it is available)" on )
option ( enable-midishare "compile MidiShare support (if it is available)" on )
option ( enable-network "enable network support (requires BSD sockets)" on )
option ( enable-oss "compile OSS support (if it is available)" on )
option ( enable-dsound "compile DirectSound support (if it is available)" on )
option ( enable-winmidi "compile Windows MIDI support (if it is available)" on )
option ( enable-pkgconfig "use pkg-config to locate fluidsynth's (mostly optional) dependencies" on )
option ( enable-pulseaudio "compile PulseAudio support (if it is available)" on )
option ( enable-readline "compile readline lib line editing (if it is available)" on )
option ( enable-threads "enable multi-threading support (such as parallel voice synthesis)" on )
# Platform specific options
if ( CMAKE_SYSTEM MATCHES "Linux" )
option ( enable-ladcca "compile LADCCA support if it is available (deprecated)" off )
if ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" )
option ( enable-lash "compile LASH support (if it is available)" on )
option ( enable-alsa "compile ALSA support (if it is available)" on )
endif ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" )
if ( CMAKE_SYSTEM MATCHES "Linux" )
option ( enable-systemd "compile systemd support (if it is available)" on )
endif ( CMAKE_SYSTEM MATCHES "Linux" )
if ( CMAKE_SYSTEM MATCHES "Darwin" )
@ -89,7 +96,7 @@ if ( CMAKE_SYSTEM MATCHES "OS2" )
endif ( CMAKE_SYSTEM MATCHES "OS2" )
# Initialize the library directory name suffix.
if (NOT MINGW AND NOT MSVC)
if (NOT MINGW AND NOT MSVC AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD|DragonFly")
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set ( _init_lib_suffix "64" )
else ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
@ -102,6 +109,25 @@ set ( LIB_SUFFIX ${_init_lib_suffix} CACHE STRING
"library directory name suffix (32/64/nothing)" )
mark_as_advanced ( LIB_SUFFIX )
# the default C standard to use for all targets
set(CMAKE_C_STANDARD 90)
# Compile with position independent code if the user requested a shared lib, i.e. no PIC if static requested.
# This is cmakes default behavior, but here it's explicitly required due to the use of libfluidsynth-OBJ as object library,
# which would otherwise always be compiled without PIC.
set ( CMAKE_POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS} )
# the default global visibility level for all target
# no visibility support on OS2
if ( NOT OS2 )
set ( CMAKE_C_VISIBILITY_PRESET hidden )
endif ( NOT OS2 )
# enforce visibility control for all types of cmake targets
if ( POLICY CMP0063 )
cmake_policy ( SET CMP0063 NEW )
endif ( POLICY CMP0063 )
# Default install directory names
include ( DefaultDirs )
@ -131,6 +157,7 @@ check_include_file ( limits.h HAVE_LIMITS_H )
check_include_file ( pthread.h HAVE_PTHREAD_H )
check_include_file ( signal.h HAVE_SIGNAL_H )
check_include_file ( getopt.h HAVE_GETOPT_H )
check_include_file ( stdint.h HAVE_STDINT_H )
include ( TestInline )
include ( TestVLA )
include ( TestBigEndian )
@ -142,7 +169,7 @@ unset ( FLUID_CPPFLAGS CACHE )
unset ( FLUID_LIBS CACHE )
# Options for the GNU C compiler only
if ( CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" )
if ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "Intel" )
if ( NOT APPLE AND NOT OS2 )
set ( CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed" )
@ -150,39 +177,84 @@ if ( CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" )
"${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
endif ( NOT APPLE AND NOT OS2 )
if ( OS2 )
set ( GNUCC_VISIBILITY_FLAG "" )
else ( OS2 )
set ( GNUCC_VISIBILITY_FLAG "-fvisibility=hidden" )
endif ( OS2 )
set ( GNUCC_WARNING_FLAGS "-Wall -W -Wpointer-arith -Wbad-function-cast -Wno-cast-qual -Wcast-align -Wstrict-prototypes -Wno-unused-parameter -Wdeclaration-after-statement" )
set ( CMAKE_C_FLAGS_DEBUG "-std=gnu89 -g ${GNUCC_VISIBILITY_FLAG} -DDEBUG ${GNUCC_WARNING_FLAGS}" )
set ( CMAKE_C_FLAGS_RELEASE "-std=gnu89 -O2 -fomit-frame-pointer -finline-functions ${GNUCC_VISIBILITY_FLAG} -DNDEBUG ${GNUCC_WARNING_FLAGS}" )
set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-std=gnu89 -O2 -g -fomit-frame-pointer -finline-functions ${GNUCC_VISIBILITY_FLAG} -DNDEBUG ${GNUCC_WARNING_FLAGS}" )
endif ( CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" )
# define some warning flags
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wno-unused-parameter -Wdeclaration-after-statement" )
if ( CMAKE_C_COMPILER_ID STREQUAL "Intel" )
# icc needs the restrict flag to recognize C99 restrict pointers
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -restrict" )
else () # not intel
# gcc and clang support bad function cast and alignment warnings; add them as well.
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wbad-function-cast -Wcast-align" )
endif (CMAKE_C_COMPILER_ID STREQUAL "Intel" )
# prepend to build type specific flags, to allow users to override
set ( CMAKE_C_FLAGS_DEBUG "-g -DDEBUG -fsanitize=undefined ${CMAKE_C_FLAGS_DEBUG}" )
endif ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "Intel" )
# Windows
unset ( WINDOWS_SUPPORT CACHE )
unset ( WINDOWS_LIBS CACHE )
unset ( DSOUND_SUPPORT CACHE )
unset ( WINMIDI_SUPPORT CACHE )
unset ( MINGW32 CACHE )
if ( WIN32 )
include ( CheckIncludeFiles )
# Check presence of MS include files
check_include_file ( windows.h HAVE_WINDOWS_H )
check_include_file ( io.h HAVE_IO_H )
check_include_file ( dsound.h HAVE_DSOUND_H )
check_include_files ( "windows.h;mmsystem.h" HAVE_MMSYSTEM_H )
set ( WINDOWS_SUPPORT ${HAVE_WINDOWS_H} )
set ( WINDOWS_LIBS "dsound;winmm;ws2_32" )
if ( enable-network )
set ( WINDOWS_LIBS "${WINDOWS_LIBS};ws2_32" )
endif ( enable-network )
if ( enable-dsound AND HAVE_DSOUND_H )
set ( WINDOWS_LIBS "${WINDOWS_LIBS};dsound" )
set ( DSOUND_SUPPORT 1 )
endif ()
if ( enable-winmidi AND HAVE_MMSYSTEM_H )
set ( WINDOWS_LIBS "${WINDOWS_LIBS};winmm" )
set ( WINMIDI_SUPPORT 1 )
endif ()
set ( LIBFLUID_CPPFLAGS "-DFLUIDSYNTH_DLL_EXPORTS" )
set ( FLUID_CPPFLAGS "-DFLUIDSYNTH_NOT_A_DLL" )
if (NOT MSVC)
if ( MSVC )
# statically link in the CRT library to avoid a bunch of runtime DLL dependencies and allow
# the CI windows builds to be run under WinXP
foreach ( flag_var
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_RELWITHDEBINFO
)
if ( ${flag_var} MATCHES "/MD" )
string ( REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}" )
endif ( ${flag_var} MATCHES "/MD" )
endforeach ( flag_var )
else ( MSVC )
# only set debug postfix if not MSVS building
set ( CMAKE_DEBUG_POSTFIX "_debug" )
endif()
endif ( MSVC )
# MinGW compiler (a Windows GCC port)
if ( MINGW )
set ( MINGW32 1 )
add_definitions ( -mms-bitfields )
add_compile_options ( -mms-bitfields )
endif ( MINGW )
else ( WIN32 )
# Check PThreads, but not in Windows
@ -251,6 +323,11 @@ if ( enable-ipv6 )
endif ( HAVE_INETNTOP )
endif ( enable-ipv6 )
unset ( NETWORK_SUPPORT )
if ( enable-network )
set ( NETWORK_SUPPORT 1 )
endif ( enable-network )
unset ( WITH_FLOAT CACHE )
if ( enable-floats )
set ( WITH_FLOAT 1 )
@ -259,20 +336,28 @@ endif ( enable-floats )
unset ( WITH_PROFILING CACHE )
if ( enable-profiling )
set ( WITH_PROFILING 1 )
endif ( enable-profiling )
if ( CMAKE_C_COMPILER_ID STREQUAL "Clang" )
set ( OPT_FLAGS "-Rpass=loop-vectorize -Rpass-analysis=loop-vectorize" )
elseif ( CMAKE_C_COMPILER_ID STREQUAL "Intel" )
set ( OPT_FLAGS "-qopt-report=3" )
elseif ( CMAKE_C_COMPILER_ID STREQUAL "GNU" )
set ( OPT_FLAGS "" )
endif ( )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OPT_FLAGS}" )
if ( CMAKE_VERSION VERSION_GREATER "3.6.0" )
find_program( CLANG_TIDY
NAMES "clang-tidy"
DOC "Path to clang-tidy executable" )
if ( CLANG_TIDY )
message ( STATUS "Found clang-tidy" )
set ( CMAKE_C_CLANG_TIDY "clang-tidy" )
endif ( CLANG_TIDY )
endif ( CMAKE_VERSION VERSION_GREATER "3.6.0" )
unset ( HAVE_LIBDL CACHE )
unset ( LADSPA_SUPPORT CACHE )
if ( enable-ladspa )
check_include_file ( ladspa.h LADSPA_SUPPORT )
if ( LADSPA_SUPPORT )
set ( LADSPA 1 )
if ( CMAKE_DL_LIBS )
set ( HAVE_LIBDL 1 )
set ( LIBFLUID_LIBS "${LIBFLUID_LIBS};${CMAKE_DL_LIBS}" )
endif ( CMAKE_DL_LIBS )
endif ( LADSPA_SUPPORT )
endif ( enable-ladspa )
endif ( enable-profiling )
unset ( ENABLE_TRAPONFPE CACHE )
unset ( TRAP_ON_FPE CACHE )
@ -290,12 +375,12 @@ endif ( enable-fpe-check )
if ( enable-debug )
set ( CMAKE_BUILD_TYPE "Debug" CACHE STRING
"Choose the build type, options: Debug Release RelWithDebInfo" FORCE )
"Choose the build type, options: Debug Release RelWithDebInfo MinSizeRel" FORCE )
endif ( enable-debug )
if ( NOT CMAKE_BUILD_TYPE )
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Choose the build type, options: Debug Release RelWithDebInfo" FORCE )
"Choose the build type, options: Debug Release RelWithDebInfo MinSizeRel" FORCE )
endif ( NOT CMAKE_BUILD_TYPE )
unset ( ENABLE_DEBUG CACHE )
@ -305,6 +390,48 @@ if ( CMAKE_BUILD_TYPE MATCHES "Debug" )
set ( DEBUG 1 )
endif ( CMAKE_BUILD_TYPE MATCHES "Debug" )
# Additional targets to perform clang-format/clang-tidy
# Get all project files
file(GLOB_RECURSE
ALL_SOURCE_FILES
LIST_DIRECTORIES false
${CMAKE_SOURCE_DIR}/*.[chi]
${CMAKE_SOURCE_DIR}/*.[chi]pp
${CMAKE_SOURCE_DIR}/*.[chi]xx
${CMAKE_SOURCE_DIR}/*.cc
${CMAKE_SOURCE_DIR}/*.hh
${CMAKE_SOURCE_DIR}/*.ii
${CMAKE_SOURCE_DIR}/*.[CHI]
)
# Adding clang-format target if executable is found
# find_program ( CLANG_FORMAT "clang-format" )
# if ( CLANG_FORMAT )
# add_custom_target(
# clang-format
# COMMAND ${CLANG_FORMAT}
# -i
# -style=file
# ${ALL_SOURCE_FILES}
# )
# endif(CLANG_FORMAT)
find_program ( ASTYLE "astyle" )
if ( ASTYLE )
add_custom_target(
format
COMMAND ${ASTYLE}
-A1
-xb
-j
-k3
-p
-f
-n
-U
${ALL_SOURCE_FILES}
)
endif(ASTYLE)
if(NOT enable-pkgconfig)
@ -333,6 +460,10 @@ else(NOT enable-pkgconfig)
# Mandatory libraries: glib and gthread
pkg_check_modules ( GLIB REQUIRED glib-2.0>=2.6.5 gthread-2.0>=2.6.5 )
if ( GLIB_glib-2.0_VERSION AND GLIB_glib-2.0_VERSION VERSION_LESS "2.26.0" )
message ( WARNING "Your version of glib is very old. This may cause problems with fluidsynth's sample cache on Windows. Consider updating to glib 2.26 or newer!" )
endif ( GLIB_glib-2.0_VERSION AND GLIB_glib-2.0_VERSION VERSION_LESS "2.26.0" )
include ( UnsetPkgConfig )
# Optional features
@ -394,13 +525,13 @@ else(NOT enable-pkgconfig)
remove_definitions( -DHAVE_LASH )
endif ( enable-lash )
unset ( LADCCA_SUPPORT CACHE )
if ( enable-ladcca )
pkg_check_modules ( LADCCA ladcca-1.0>=0.3 )
set ( LADCCA_SUPPORT ${LADCCA_FOUND} )
else ( enable-ladcca )
unset_pkg_config ( LADCCA )
endif ( enable-ladcca )
unset ( SYSTEMD_SUPPORT CACHE )
if ( enable-systemd )
pkg_check_modules ( SYSTEMD libsystemd )
set ( SYSTEMD_SUPPORT ${SYSTEMD_FOUND} )
else ( enable-systemd )
unset_pkg_config ( SYSTEMD )
endif ( enable-systemd )
unset ( DBUS_SUPPORT CACHE )
if ( enable-dbus )
@ -409,6 +540,15 @@ else(NOT enable-pkgconfig)
else ( enable-dbus )
unset_pkg_config ( DBUS )
endif ( enable-dbus )
unset ( LADSPA_SUPPORT CACHE )
if ( enable-ladspa )
check_include_file ( ladspa.h LADSPA_SUPPORT )
if ( LADSPA_SUPPORT )
pkg_check_modules ( GMODULE REQUIRED gmodule-2.0>=2.6.5 )
set ( LADSPA 1 )
endif ( LADSPA_SUPPORT )
endif ( enable-ladspa )
endif(NOT enable-pkgconfig)
@ -448,23 +588,50 @@ else ( enable-readline )
unset ( READLINE_LIBS CACHE )
endif ( enable-readline )
unset ( ENABLE_MIXER_THREADS CACHE )
if ( enable-threads )
set ( ENABLE_MIXER_THREADS 1 )
endif ( enable-threads )
unset ( HAVE_OPENMP CACHE )
find_package ( OpenMP QUIET )
if ( OpenMP_FOUND OR OpenMP_C_FOUND )
message(STATUS "Found OpenMP ${OpenMP_C_SPEC_DATE}")
# require at least OMP 4.0
if ( ( NOT OpenMP_C_SPEC_DATE LESS "201307" ) OR NOT ( OpenMP_C_VERSION VERSION_LESS "4.0" ) )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
# currently no need to link against openMP runtime lib(s). If need be, uncomment below.
# set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}" )
# set ( LIBFLUID_LIBS "${OpenMP_C_LIBRARIES};${LIBFLUID_LIBS}" )
set ( HAVE_OPENMP 1 )
endif()
endif()
# manipulate some variables to setup a proper test env
set(TEST_SOUNDFONT "${CMAKE_SOURCE_DIR}/sf2/VintageDreamsWaves-v2.sf2")
set(TEST_SOUNDFONT_SF3 "${CMAKE_SOURCE_DIR}/sf2/VintageDreamsWaves-v2.sf3")
# General configuration file
configure_file ( ${CMAKE_SOURCE_DIR}/src/config.cmake
${CMAKE_BINARY_DIR}/config.h )
configure_file ( ${CMAKE_SOURCE_DIR}/include/fluidsynth.cmake
${CMAKE_BINARY_DIR}/include/fluidsynth.h )
add_definitions ( -DHAVE_CONFIG_H )
# Extra configuration file for MS VisualC compiler
if ( MSVC )
configure_file ( ${CMAKE_SOURCE_DIR}/src/config_win32.cmake
${CMAKE_BINARY_DIR}/config_win32.h )
endif ( MSVC )
# Setup linker directories NOW, as the command will apply only to targets created after it has been called.
link_directories (
${GLIB_LIBRARY_DIRS}
${LASH_LIBRARY_DIRS}
${JACK_LIBRARY_DIRS}
${ALSA_LIBRARY_DIRS}
${PULSE_LIBRARY_DIRS}
${PORTAUDIO_LIBRARY_DIRS}
${LIBSNDFILE_LIBRARY_DIRS}
${DBUS_LIBRARY_DIRS}
)
# Process subdirectories
add_subdirectory ( src )
add_subdirectory ( include )
add_subdirectory ( test )
add_subdirectory ( doc )
# pkg-config support
@ -525,27 +692,6 @@ if ( UNIX )
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
# tarball custom target
add_custom_target ( tarball-autotools
COMMAND mkdir -p ${PACKAGE}-${VERSION}
COMMAND cp -r bindings ${PACKAGE}-${VERSION}
COMMAND cp -r cmake_admin ${PACKAGE}-${VERSION}
COMMAND cp -r doc ${PACKAGE}-${VERSION}
COMMAND cp -r include ${PACKAGE}-${VERSION}
COMMAND cp -r src ${PACKAGE}-${VERSION}
COMMAND cp AUTHORS ChangeLog CMakeLists.txt ../LICENSE ${PACKAGE}.* INSTALL NEWS README* ../README.md THANKS TODO ${PACKAGE}-${VERSION}
COMMAND cp acinclude.m4 autogen.sh configure.ac install-sh missing mkinstalldirs Makefile.am ${PACKAGE}-${VERSION}
# Files below are added when running autogen.sh
# COMMAND cp -r autom4te.cache ${PACKAGE}-${VERSION}
COMMAND cp -r m4 ${PACKAGE}-${VERSION}
COMMAND cp aclocal.m4 compile config.guess config.sub configure depcomp ltmain.sh Makefile.in ${PACKAGE}-${VERSION}
COMMAND tar -cj --exclude .svn -f ${PACKAGE}-${VERSION}.tar.bz2 ${PACKAGE}-${VERSION}
COMMAND tar -cz --exclude .svn -f ${PACKAGE}-${VERSION}.tar.gz ${PACKAGE}-${VERSION}
COMMAND zip -qr ${PACKAGE}-${VERSION}.zip ${PACKAGE}-${VERSION} -x '*.svn*'
COMMAND rm -rf ${PACKAGE}-${VERSION}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
endif ( UNIX )
include ( report )

40
CONTRIBUTING.md

@ -0,0 +1,40 @@
# Contributing
Thanks for considering to contribute to FluidSynth. Before implementing
any huge new feature, consider bringing up your ideas on our mailing list:
https://lists.nongnu.org/mailman/listinfo/fluid-dev
Contributing can be done by
* [submitting pull requests on Github](
https://help.github.com/articles/proposing-changes-to-your-work-with-pull-requests/) or
* submitting patches to the mailing list.
Patches should be created with `git format-patch`, so in every case you should be familiar with the basics of git. Make sure you develop against the master branch, i.e. **not** against any FluidSynth release.
Some things that will increase the chance that your pull request or patch is accepted:
* Give a reasoning / motivation for any changes or proposals you make.
* Follow our style guide.
* Keep your commits "atomic".
* Write meaningful commit messages.
## Style Guide
Find FluidSynth's style guide below. Syntax related issues, like missing braces, will be automatically taken care of when compiling fluidsynth by calling `make` (provided that cmake has found `clang-tidy >= 5.0` on your system). An explicit reformatting can be achieved using `make format` (provided that cmake has found `clang-format` on your system).
#### General
* Every function should have a short comment explaining it's purpose
* Every public API function **must** be documented with purpose, params and return value
* Prefer signed integer types to unsigned ones
* Use spaces rather than tabs
* Avoid macros
#### Naming Conventions
* Words separated by underscores
* Macros always UPPER_CASE
* Function and Variable names always lower_case, (e.g. `fluid_componentname_purpose()`)
#### Bracing
* Every block after an if, else, while or for should be enclosed in braces
* **Allman-Style** braces everywhere

192
INSTALL

@ -1,192 +0,0 @@
Select build system
===================
fluidsynth currently provides two different build systems, one based
on autotools, the other based on cmake. The autotools build system
is deprected, unmaintained and will be removed in a future release.
The recommend way to build is using cmake, please see the
README.cmake file. If you still want to use the unsupported
autotools build system, see below.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.

11
Makefile.am

@ -1,11 +0,0 @@
## Process this file with automake to produce Makefile.in
ACLOCAL_AMFLAGS=-I m4
SUBDIRS = src doc include cmake_admin
EXTRA_DIST = TODO acinclude.m4 autogen.sh fluidsynth.pc.in \
fluidsynth.spec.in fluidsynth.spec fluidsynth.anjuta README-OSX \
README.cmake CMakeLists.txt
DISTCLEANFILES = fluidsynth.pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = fluidsynth.pc

81
README-OSX

<
@ -1,80 +1,3 @@
fluidsynth-1.1.2 on Mac OS X
-----------------------------------------------------------------------
fluidsynth-1.1.2 can be installed in three ways on your Apple computer:
A. Compilation and installation by hand using autotools
-------------------------------------------------------
Requirements:
- "XcodeTools.mpkg","DevSDK.pkg", "CoreAudioSDK.pkg" packages (The Leopard/Snow Leopard Install DVD)
- Fink installation <http://fink.sourceforge.net>
- libgnugetopt, readline5, libflac8-dev, libsndfile1-dev and glib2-dev from fink: e.g. "fink install libgnugetopt"
- MIDI Patchbay 1.0.3 <http://www.apple.com/downloads/macosx/audio/index6.html>
- Optional: JackOSX.0.85*.pkg.zip <http://www.jackosx.com>