[SCM] fluidsynth/master: New upstream version 1.1.9
mira-guest at users.alioth.debian.org
mira-guest at users.alioth.debian.org
Sun Jan 7 12:03:09 UTC 2018
The following commit has been merged in the master branch:
commit d5b7fe7c545bde878a84aca2997fa8e87d73066c
Author: Jaromír Mikeš <mira.mikes at seznam.cz>
Date: Sun Jan 7 06:18:44 2018 +0100
New upstream version 1.1.9
diff --git a/.appveyor-vcpkg.yml b/.appveyor-vcpkg.yml
new file mode 100644
index 0000000..c467293
--- /dev/null
+++ b/.appveyor-vcpkg.yml
@@ -0,0 +1,38 @@
+os:
+ - Visual Studio 2015
+
+build:
+ verbosity: detailed
+
+configuration:
+ - Release
+
+environment:
+ # update the vcpkg cache even if build fails
+ APPVEYOR_SAVE_CACHE_ON_ERROR: true
+
+ matrix:
+ - platform: x86
+ generator: Visual Studio 14 2015
+
+ - platform: x64
+ generator: Visual Studio 14 2015 Win64
+
+cache:
+ - c:\Tools\vcpkg\installed
+
+install:
+ - 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
+
+after_build:
+ - 7z a fluidsynth.zip %APPVEYOR_BUILD_FOLDER%\build\src\Release\*
+
+artifacts:
+ - path: build/fluidsynth.zip
+ name: FluidSynth
diff --git a/.appveyor.yml b/.appveyor.yml
new file mode 100644
index 0000000..b00b337
--- /dev/null
+++ b/.appveyor.yml
@@ -0,0 +1,58 @@
+os:
+ - Visual Studio 2015
+
+build:
+ 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
+ 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
+ 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
+
+
+install:
+ - 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%
+
+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
+ - mkdir build
+ - cd build
+ - cmake -G "%generator%" ..
+ - cmake --build . --config Release
+
+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
+
+artifacts:
+ - path: build/fluidsynth.zip
+ name: FluidSynth
diff --git a/.travis.yml b/.travis.yml
index d511227..c1833a0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,6 @@ env:
- CMAKE_FLAGS="-Denable-floats=1 -Denable-profiling=1"
- CMAKE_FLAGS="-Denable-trap-on-fpe=1"
- CMAKE_FLAGS="-Denable-fpe-check=1"
- - CMAKE_FLAGS="-Denable-debug=1"
matrix:
include:
- os: linux
@@ -25,6 +24,7 @@ matrix:
- 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"
@@ -45,6 +45,7 @@ matrix:
- 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"
@@ -59,6 +60,7 @@ matrix:
- cmake-data
- cmake
- libglib2.0-0
+ - ladspa-sdk
env:
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
@@ -73,8 +75,10 @@ matrix:
- 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
@@ -87,6 +91,7 @@ matrix:
- cmake-data
- cmake
- libglib2.0-0
+ - ladspa-sdk
env:
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
@@ -96,13 +101,28 @@ matrix:
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"
+
+ # works on Precise and Trusty
+ - os: linux
+ addons:
+ apt:
+ sources:
+ - ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
- - george-edison55-precise-backports
packages:
- clang-3.8
- cmake-data
- cmake
- libglib2.0-0
+ - ladspa-sdk
env:
- MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
@@ -112,12 +132,12 @@ matrix:
apt:
sources:
- llvm-toolchain-trusty-3.9
- - george-edison55-precise-backports
packages:
- clang-3.9
- cmake-data
- cmake
- libglib2.0-0
+ - ladspa-sdk
env:
- MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9"
@@ -127,51 +147,52 @@ matrix:
apt:
sources:
- llvm-toolchain-trusty-4.0
- - george-edison55-precise-backports
packages:
- clang-4.0
- cmake-data
- cmake
- libglib2.0-0
+ - ladspa-sdk
env:
- MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0"
- ## works on Trusty
- #- os: linux
- #addons:
- #apt:
- #sources:
- #- llvm-toolchain-trusty
- #- george-edison55-precise-backports
- #packages:
- #- clang-5.0
- #- cmake-data
- #- cmake
- #- libglib2.0-0
- #env:
- #- MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
-
- #- os: osx
- #osx_image: xcode8
- #env:
- #- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
+ # 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 gcc5 && 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 && 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"
before_install:
+ - if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get update; else brew update; fi
- eval "${MATRIX_EVAL}"
before_script:
- mkdir build && cd build
script:
- - cmake ${CMAKE_FLAGS} "-DCMAKE_BUILD_TYPE=RelWithDebInfo" ..
+ - cmake ${CMAKE_FLAGS} "-Denable-portaudio=1" "-Denable-ladspa=1" "-DCMAKE_BUILD_TYPE=RelWithDebInfo" ..
- make -j4
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ff120d6..c119069 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,8 +19,8 @@
# CMake based build system. Pedro Lopez-Cabanillas <plcl at users.sf.net>
+cmake_minimum_required ( VERSION 3.0.2 )
project ( FluidSynth C )
-cmake_minimum_required ( VERSION 2.6.3 )
set ( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_admin )
# FluidSynth package name
@@ -29,7 +29,7 @@ set ( PACKAGE "fluidsynth" )
# FluidSynth package version
set ( FLUIDSYNTH_VERSION_MAJOR 1 )
set ( FLUIDSYNTH_VERSION_MINOR 1 )
-set ( FLUIDSYNTH_VERSION_MICRO 7 )
+set ( FLUIDSYNTH_VERSION_MICRO 9 )
set ( VERSION "${FLUIDSYNTH_VERSION_MAJOR}.${FLUIDSYNTH_VERSION_MINOR}.${FLUIDSYNTH_VERSION_MICRO}" )
set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" )
@@ -43,7 +43,7 @@ set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" )
# 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 6 )
+set ( LIB_VERSION_AGE 7 )
set ( LIB_VERSION_REVISION 0 )
set ( LIB_VERSION_INFO
"${LIB_VERSION_CURRENT}.${LIB_VERSION_AGE}.${LIB_VERSION_REVISION}" )
@@ -70,28 +70,33 @@ option ( BUILD_SHARED_LIBS "Build a shared object or DLL" on )
option ( enable-ipv6 "enable ipv6 support " on )
# Platform specific options
-if ( ${CMAKE_SYSTEM} MATCHES "Linux" )
+if ( CMAKE_SYSTEM MATCHES "Linux" )
option ( enable-ladcca "compile LADCCA support if it is available (deprecated)" off )
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" )
+endif ( CMAKE_SYSTEM MATCHES "Linux" )
-if ( ${CMAKE_SYSTEM} MATCHES "Darwin" )
+if ( CMAKE_SYSTEM MATCHES "Darwin" )
option ( enable-coreaudio "compile CoreAudio support (if it is available)" on )
option ( enable-coremidi "compile CoreMIDI support (if it is available)" on )
option ( enable-framework "create a Mac OSX style FluidSynth.framework" on )
-endif ( ${CMAKE_SYSTEM} MATCHES "Darwin" )
+endif ( CMAKE_SYSTEM MATCHES "Darwin" )
-if ( ${CMAKE_SYSTEM} MATCHES "OS2" )
+if ( CMAKE_SYSTEM MATCHES "OS2" )
option ( enable-dart "compile DART support (if it is available)" on )
-endif ( ${CMAKE_SYSTEM} MATCHES "OS2" )
+ set ( enable-ipv6 off )
+endif ( CMAKE_SYSTEM MATCHES "OS2" )
# Initialize the library directory name suffix.
+if (NOT MINGW)
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set ( _init_lib_suffix "64" )
else ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set ( _init_lib_suffix "" )
endif ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
+else ()
+ set ( _init_lib_suffix "" )
+endif()
set ( LIB_SUFFIX ${_init_lib_suffix} CACHE STRING
"library directory name suffix (32/64/nothing)" )
mark_as_advanced ( LIB_SUFFIX )
@@ -136,18 +141,25 @@ unset ( FLUID_CPPFLAGS CACHE )
unset ( FLUID_LIBS CACHE )
# Options for the GNU C compiler only
-if ( CMAKE_COMPILER_IS_GNUCC )
+if ( CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" )
if ( NOT APPLE AND NOT OS2 )
set ( CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed" )
set ( CMAKE_SHARED_LINKER_FLAGS
"${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 -fvisibility=hidden -DDEBUG ${GNUCC_WARNING_FLAGS}" )
- set ( CMAKE_C_FLAGS_RELEASE "-std=gnu89 -O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -fvisibility=hidden -DNDEBUG ${GNUCC_WARNING_FLAGS}" )
- set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-std=gnu89 -O2 -g -fomit-frame-pointer -funroll-all-loops -finline-functions -fvisibility=hidden -DNDEBUG ${GNUCC_WARNING_FLAGS}" )
-endif ( CMAKE_COMPILER_IS_GNUCC )
+ 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" )
# Windows
unset ( WINDOWS_SUPPORT CACHE )
@@ -161,8 +173,8 @@ if ( WIN32 )
check_include_files ( "windows.h;mmsystem.h" HAVE_MMSYSTEM_H )
set ( WINDOWS_SUPPORT ${HAVE_WINDOWS_H} )
set ( WINDOWS_LIBS "dsound;winmm;ws2_32" )
+ set ( LIBFLUID_CPPFLAGS "-DFLUIDSYNTH_DLL_EXPORTS" )
set ( FLUID_CPPFLAGS "-DFLUIDSYNTH_NOT_A_DLL" )
- set ( LIBFLUID_CPPFLAGS "${FLUID_CPPFLAGS} -DFLUIDSYNTH_DLL_EXPORTS" )
set ( CMAKE_DEBUG_POSTFIX "_debug" )
# MinGW compiler (a Windows GCC port)
if ( MINGW )
@@ -180,7 +192,7 @@ endif ( WIN32 )
unset ( DART_SUPPORT CACHE )
unset ( DART_LIBS CACHE )
unset ( DART_INCLUDE_DIRS CACHE )
-if ( ${CMAKE_SYSTEM} MATCHES "OS2" )
+if ( CMAKE_SYSTEM MATCHES "OS2" )
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Zbin-files" )
set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Zbin-files" )
if ( enable-dart )
@@ -188,13 +200,13 @@ if ( ${CMAKE_SYSTEM} MATCHES "OS2" )
set ( DART_SUPPORT ${HAVE_DART_H} )
unset ( DART_INCLUDE_DIRS CACHE )
endif ( enable-dart )
-endif ( ${CMAKE_SYSTEM} MATCHES "OS2" )
+endif ( CMAKE_SYSTEM MATCHES "OS2" )
# Solaris / SunOS
-if ( ${CMAKE_SYSTEM} MATCHES "SunOS" )
+if ( CMAKE_SYSTEM MATCHES "SunOS" )
set ( FLUID_LIBS "${FLUID_LIBS};nsl;socket" )
set ( LIBFLUID_LIBS "${LIBFLUID_LIBS};nsl;socket" )
-endif ( ${CMAKE_SYSTEM} MATCHES "SunOS" )
+endif ( CMAKE_SYSTEM MATCHES "SunOS" )
# Apple Mac OSX
unset ( COREAUDIO_SUPPORT CACHE )
@@ -203,7 +215,7 @@ unset ( COREMIDI_SUPPORT CACHE )
unset ( COREMIDI_LIBS CACHE )
unset ( DARWIN CACHE )
unset ( MACOSX_FRAMEWORK CACHE )
-if ( ${CMAKE_SYSTEM} MATCHES "Darwin" )
+if ( CMAKE_SYSTEM MATCHES "Darwin" )
set ( DARWIN 1 )
set ( CMAKE_INSTALL_NAME_DIR
${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}${LIB_SUFFIX} )
@@ -224,7 +236,7 @@ if ( ${CMAKE_SYSTEM} MATCHES "Darwin" )
if ( enable-framework )
set ( MACOSX_FRAMEWORK 1 )
endif ( enable-framework )
-endif ( ${CMAKE_SYSTEM} MATCHES "Darwin" )
+endif ( CMAKE_SYSTEM MATCHES "Darwin" )
unset ( HAVE_INETNTOP CACHE )
@@ -293,10 +305,10 @@ endif ( CMAKE_BUILD_TYPE MATCHES "Debug" )
if(NOT enable-pkgconfig)
- FIND_LIBRARY( GLIB_LIB NAMES glib glib-2.0 PATH GLIB_LIBRARY_DIR NO_DEFAULT_PATH)
- FIND_LIBRARY( GTHREAD_LIB NAMES gthread gthread-2.0 PATH GTHREAD_LIBRARY_DIR NO_DEFAULT_PATH )
- FIND_PATH( GLIBH_DIR glib.h PATH GLIB_INCLUDE_DIR NO_DEFAULT_PATH )
- FIND_PATH( GLIBCONF_DIR glibconfig.h PATH GLIBCONF_INCLUDE_DIR NO_DEFAULT_PATH )
+ FIND_LIBRARY( GLIB_LIB NAMES glib glib-2.0 PATH GLIB_LIBRARY_DIR )
+ FIND_LIBRARY( GTHREAD_LIB NAMES gthread gthread-2.0 PATH GTHREAD_LIBRARY_DIR )
+ FIND_PATH( GLIBH_DIR glib.h PATH GLIB_INCLUDE_DIR )
+ FIND_PATH( GLIBCONF_DIR glibconfig.h PATH GLIBCONF_INCLUDE_DIR )
IF( GLIB_LIB MATCHES "GLIB_LIB-NOTFOUND" OR
GTHREAD_LIB MATCHES "GTHREAD_LIB-NOTFOUND" OR
@@ -472,7 +484,7 @@ if ( UNIX )
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 AUTHORS ChangeLog CMakeLists.txt LICENSE ${PACKAGE}.* INSTALL NEWS README* THANKS TODO ${PACKAGE}-${VERSION}
# COMMAND tar -cj --exclude .svn --exclude Makefile.am -f ${PACKAGE}-${VERSION}.tar.bz2 ${PACKAGE}-${VERSION}
# COMMAND tar -cz --exclude .svn --exclude Makefile.am -f ${PACKAGE}-${VERSION}.tar.gz ${PACKAGE}-${VERSION}
# COMMAND zip -qr ${PACKAGE}-${VERSION}.zip ${PACKAGE}-${VERSION} -x '*.svn*' -x '*Makefile.am'
diff --git a/INSTALL b/INSTALL
index 8986186..9cfb5be 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,10 +1,12 @@
Select build system
===================
- We currently have two different build systems and you can choose
-which one works best for you. If you want to use the CMake build
-system, please see the README.cmake file. For the autotools build
-system, see below.
+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
==================
diff --git a/configure.ac b/configure.ac
index 851f78c..ca258e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,7 +8,7 @@ dnl *** NOTE *** Don't forget to update library version below also
FLUIDSYNTH_VERSION_MAJOR=1
FLUIDSYNTH_VERSION_MINOR=1
-FLUIDSYNTH_VERSION_MICRO=7
+FLUIDSYNTH_VERSION_MICRO=9
FLUIDSYNTH_VERSION=$FLUIDSYNTH_VERSION_MAJOR.$FLUIDSYNTH_VERSION_MINOR.$FLUIDSYNTH_VERSION_MICRO
AC_SUBST(FLUIDSYNTH_VERSION_MAJOR)
@@ -30,7 +30,7 @@ dnl if any interfaces have been removed/changed (compatibility broken): lt_age=0
m4_define([lt_current], [6])
m4_define([lt_revision], [0])
-m4_define([lt_age], [6])
+m4_define([lt_age], [7])
LT_VERSION_INFO="lt_current:lt_revision:lt_age"
AC_SUBST(LT_VERSION_INFO)
diff --git a/doc/Doxyfile b/doc/Doxyfile
index 28a399e..ff6fb76 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -5,7 +5,7 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = libfluidsynth
-PROJECT_NUMBER = 1.1.7
+PROJECT_NUMBER = 1.1.9
OUTPUT_DIRECTORY = api
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
@@ -88,7 +88,7 @@ FILE_PATTERNS = *.c *.h
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS =
+EXCLUDE_PATTERNS = fluid_*.h
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = ../doc
EXAMPLE_PATTERNS = *.c
diff --git a/doc/Doxyfile.cmake b/doc/Doxyfile.cmake
index 2dd443e..aa624cf 100644
--- a/doc/Doxyfile.cmake
+++ b/doc/Doxyfile.cmake
@@ -88,7 +88,7 @@ FILE_PATTERNS = *.c *.h
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS =
+EXCLUDE_PATTERNS = fluid_*.h
EXCLUDE_SYMBOLS =
EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/doc
EXAMPLE_PATTERNS = *.c
diff --git a/doc/fluidsynth-v11-devdoc.txt b/doc/fluidsynth-v11-devdoc.txt
index 1b96382..57a50be 100644
--- a/doc/fluidsynth-v11-devdoc.txt
+++ b/doc/fluidsynth-v11-devdoc.txt
@@ -7,9 +7,9 @@
\author Josh Green
\author David Henningsson
\author Tom Moebert
-\author Copyright © 2003-2017 Peter Hanappe, Conrad Berhörster, Antoine Schmitt, Pedro López-Cabanillas, Josh Green, David Henningsson, Tom Moebert
-\version Revision 1.1.7
-\date 2017-09-04
+\author Copyright © 2003-2018 Peter Hanappe, Conrad Berhörster, Antoine Schmitt, Pedro López-Cabanillas, Josh Green, David Henningsson, Tom Moebert
+\version Revision 1.1.9
+\date 2018-01-02
All the source code examples in this document are in the public domain; you can use them as you please. This document 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/ . The FluidSynth library is distributed under the GNU Lesser General Public License. A copy of the GNU Lesser General Public License is contained in the FluidSynth package; if not, visit http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@@ -21,6 +21,8 @@ All the source code examples in this document are in the public domain; you can
- \ref Disclaimer
- \ref Introduction
+- \ref NewIn1_1_9
+- \ref NewIn1_1_8
- \ref NewIn1_1_7
- \ref NewIn1_1_6
- \ref NewIn1_1_5
@@ -65,6 +67,33 @@ What is FluidSynth?
- FluidSynth is open source, in active development. For more details, take a look at http://www.fluidsynth.org
+\section NewIn1_1_9 Whats new in 1.1.9?
+
+Changes in FluidSynth 1.1.9 concerning developers:
+
+- add a function for registering audio drivers based on acutal needs: fluid_audio_driver_register()
+- dsound driver now uses the desktop window handle, fluid_get_hinstance() and fluid_set_hinstance() are deprecated
+- implement handling of #FLUID_SEQ_ALLSOUNDSOFF events in fluid_seq_fluidsynth_callback()
+- fix return value of fluid_file_set_encoding_quality()
+- deprecate fluid_synth_set_gen2()
+
+- For a full list of bug fixes, see
+ https://github.com/FluidSynth/fluidsynth/wiki/ChangeLog#fluidsynth-119
+
+\section NewIn1_1_8 Whats new in 1.1.8?
+
+Changes in FluidSynth 1.1.8 concerning developers:
+
+- fluid_synth_get_channel_preset() is not deprecated anymore
+- deprecate fluid_synth_get_channel_info()
+- deprecate fluid_synth_set_midi_router()
+- deprecate redundant tuning functions
+- deprecate fluid_gen_set_default_values()
+- deprecate struct _fluid_mod_t, use the respective getter and setter functions
+
+- For a full list of bug fixes, see
+ https://github.com/FluidSynth/fluidsynth/wiki/ChangeLog#fluidsynth-118
+
\section NewIn1_1_7 Whats new in 1.1.7?
Changes in FluidSynth 1.1.7 concerning developers:
@@ -1801,3 +1830,8 @@ Example of a simple metronome using the MIDI sequencer API
\example fluidsynth_arpeggio.c
Example of an arpeggio generated using the MIDI sequencer API
*/
+
+/*!
+\example fluidsynth_register_adriver.c
+Example of how to register audio drivers using fluid_audio_driver_register() (advanced users only)
+*/
diff --git a/doc/fluidsynth.1 b/doc/fluidsynth.1
index 5ca0398..c04a902 100644
--- a/doc/fluidsynth.1
+++ b/doc/fluidsynth.1
@@ -10,10 +10,10 @@
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU Lesser General Public License
-.\" along with this program; see the file COPYING. If not, write to
+.\" along with this program; see the file LICENSE. If not, write to
.\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
.\"
-.TH FluidSynth 1 "Aug 26, 2010"
+.TH FluidSynth 1 "Jan 2, 2018"
.\" Please update the above date whenever this man page is modified.
.\"
.\" Some roff macros, for reference:
@@ -298,7 +298,7 @@ OSS driver output device.
PortAudio driver output device. Available options depends on system.
.TP
.B audio.pulseaudio.adjust-latency BOOL [def=True]
-Increases the latency dynamically if PulseAudio suggests so.
+If TRUE initializes the maximum length of the audio buffer to the highest supported value and increases the latency dynamically if PulseAudio suggests so. Else uses a buffer with length of audio.period-size.
.TP
.B audio.pulseaudio.device STR [def='default']
PulseAudio driver output device.
diff --git a/doc/fluidsynth_register_adriver.c b/doc/fluidsynth_register_adriver.c
new file mode 100644
index 0000000..40d8a1a
--- /dev/null
+++ b/doc/fluidsynth_register_adriver.c
@@ -0,0 +1,68 @@
+/**
+ * This is a simple C99 program that demonstrates the usage of fluid_audio_driver_register()
+ *
+ * There are 3 calls to fluid_audio_driver_register(), i.e. 3 iterations:
+ * First the alsa driver is registered and created, followed by the jack and portaudio driver.
+ *
+ * The usual usecase would be to call fluid_audio_driver_register() only once providing the audio drivers needed during fluidsynth usage.
+ * If necessary however fluid_audio_driver_register() can be called multiple times as demonstrated here.
+ * Therefore the user must make sure to delete all fluid-instances of any kind before making the call to fluid_audio_driver_register().
+ * Else the behaviour is undefined and the application is likely to crash.
+ */
+
+#include <stdio.h>
+#include <fluidsynth.h>
+
+int main()
+{
+ const char* DRV[] = { "alsa", "jack", "portaudio" };
+ const char* adrivers[2];
+
+ for(int i=0; i<sizeof(DRV)/sizeof(DRV[0]); i++)
+ {
+ adrivers[0] = DRV[i];
+ /* register any other driver you need
+ *
+ * adrivers[X] = "whatever";
+ */
+ adrivers[1] = NULL; /* NULL terminate the array */
+
+ /* register those audio drivers. Note that at this time no fluidsynth objects are alive! */
+ int res = fluid_audio_driver_register(adrivers);
+ if(res != FLUID_OK)
+ {
+ puts("adriver reg err");
+ return -1;
+ }
+
+ fluid_settings_t* settings = new_fluid_settings();
+ res = fluid_settings_setstr(settings, "audio.driver", DRV[i]);
+
+ /* settings API will be refactored to return FLUID_OK|FAILED next major release
+ * returning TRUE or FALSE is deprecated
+ */
+#if FLUIDSYNTH_VERSION_MAJOR >= 2
+ if(res != FLUID_OK)
+#else
+ if(res == 0)
+#endif
+ {
+ puts("audio.driver set err");
+ return -1;
+ }
+
+ fluid_synth_t* synth = new_fluid_synth(settings);
+ fluid_audio_driver_t* ad = new_fluid_audio_driver(settings, synth);
+
+ /*
+ * ~~~ Do your daily business here ~~~
+ */
+
+ delete_fluid_audio_driver(ad);
+ delete_fluid_synth(synth);
+ delete_fluid_settings(settings);
+
+ /* everything cleaned up, fluid_audio_driver_register() can be called again if needed */
+ }
+ return 0;
+}
diff --git a/include/fluidsynth.h b/include/fluidsynth.h
index 3713e4b..edb57d2 100644
--- a/include/fluidsynth.h
+++ b/include/fluidsynth.h
@@ -46,6 +46,15 @@ extern "C" {
#endif
+#if defined(__GNUC__) || defined(__clang__)
+# define FLUID_DEPRECATED __attribute__((deprecated))
+#elif defined(_MSC_VER) && _MSC_VER > 1200
+# define FLUID_DEPRECATED __declspec(deprecated)
+#else
+# define FLUID_DEPRECATED
+#endif
+
+
/**
* @file fluidsynth.h
* @brief FluidSynth is a real-time synthesizer designed for SoundFont(R) files.
diff --git a/include/fluidsynth/audio.h b/include/fluidsynth/audio.h
index e666e74..795a000 100644
--- a/include/fluidsynth/audio.h
+++ b/include/fluidsynth/audio.h
@@ -69,6 +69,8 @@ FLUIDSYNTH_API int fluid_file_renderer_process_block(fluid_file_renderer_t* dev)
FLUIDSYNTH_API void delete_fluid_file_renderer(fluid_file_renderer_t* dev);
FLUIDSYNTH_API int fluid_file_set_encoding_quality(fluid_file_renderer_t* dev, double q);
+FLUIDSYNTH_API int fluid_audio_driver_register(const char** adrivers);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/fluidsynth/event.h b/include/fluidsynth/event.h
index ebf70c3..1676163 100644
--- a/include/fluidsynth/event.h
+++ b/include/fluidsynth/event.h
@@ -54,7 +54,7 @@ enum fluid_seq_event_type {
FLUID_SEQ_REVERBSEND, /**< Reverb send set event */
FLUID_SEQ_CHORUSSEND, /**< Chorus send set event */
FLUID_SEQ_TIMER, /**< Timer event (useful for giving a callback at a certain time) */
- FLUID_SEQ_ANYCONTROLCHANGE, /**< DOCME (used for remove_events only) */
+ FLUID_SEQ_ANYCONTROLCHANGE, /**< Any control change message (only internally used for remove_events) */
FLUID_SEQ_CHANNELPRESSURE, /**< Channel aftertouch event @since 1.1.0 */
FLUID_SEQ_SYSTEMRESET, /**< System reset event @since 1.1.0 */
FLUID_SEQ_UNREGISTERING, /**< Called when a sequencer client is being unregistered. @since 1.1.0 */
@@ -68,8 +68,8 @@ FLUIDSYNTH_API fluid_event_t* new_fluid_event(void);
FLUIDSYNTH_API void delete_fluid_event(fluid_event_t* evt);
/* Initializing events */
-FLUIDSYNTH_API void fluid_event_set_source(fluid_event_t* evt, short src);
-FLUIDSYNTH_API void fluid_event_set_dest(fluid_event_t* evt, short dest);
+FLUIDSYNTH_API void fluid_event_set_source(fluid_event_t* evt, fluid_seq_id_t src);
+FLUIDSYNTH_API void fluid_event_set_dest(fluid_event_t* evt, fluid_seq_id_t dest);
/* Timer events */
FLUIDSYNTH_API void fluid_event_timer(fluid_event_t* evt, void* data);
@@ -115,8 +115,8 @@ FLUIDSYNTH_API void fluid_event_unregistering(fluid_event_t* evt);
/* Accessing event data */
FLUIDSYNTH_API int fluid_event_get_type(fluid_event_t* evt);
-FLUIDSYNTH_API short fluid_event_get_source(fluid_event_t* evt);
-FLUIDSYNTH_API short fluid_event_get_dest(fluid_event_t* evt);
+FLUIDSYNTH_API fluid_seq_id_t fluid_event_get_source(fluid_event_t* evt);
+FLUIDSYNTH_API fluid_seq_id_t fluid_event_get_dest(fluid_event_t* evt);
FLUIDSYNTH_API int fluid_event_get_channel(fluid_event_t* evt);
FLUIDSYNTH_API short fluid_event_get_key(fluid_event_t* evt);
FLUIDSYNTH_API short fluid_event_get_velocity(fluid_event_t* evt);
diff --git a/include/fluidsynth/gen.h b/include/fluidsynth/gen.h
index 6aae094..f4b7f47 100644
--- a/include/fluidsynth/gen.h
+++ b/include/fluidsynth/gen.h
@@ -124,7 +124,7 @@ enum fluid_gen_flags
GEN_ABS_NRPN /**< Generator is an absolute value */
};
-FLUIDSYNTH_API int fluid_gen_set_default_values(fluid_gen_t* gen);
+FLUIDSYNTH_API FLUID_DEPRECATED int fluid_gen_set_default_values(fluid_gen_t* gen);
diff --git a/include/fluidsynth/misc.h b/include/fluidsynth/misc.h
index 0527801..3845e30 100644
--- a/include/fluidsynth/misc.h
+++ b/include/fluidsynth/misc.h
@@ -65,8 +65,8 @@ FLUIDSYNTH_API int fluid_is_midifile (const char *filename);
#ifdef WIN32
-FLUIDSYNTH_API void* fluid_get_hinstance(void);
-FLUIDSYNTH_API void fluid_set_hinstance(void* hinstance);
+FLUIDSYNTH_API FLUID_DEPRECATED void* fluid_get_hinstance(void);
+FLUIDSYNTH_API FLUID_DEPRECATED void fluid_set_hinstance(void* hinstance);
#endif
diff --git a/include/fluidsynth/mod.h b/include/fluidsynth/mod.h
index 01857dc..a50c521 100644
--- a/include/fluidsynth/mod.h
+++ b/include/fluidsynth/mod.h
@@ -34,6 +34,8 @@ extern "C" {
/**
* Modulator structure. See SoundFont 2.04 PDF section 8.2.
+ *
+ * @deprecated To be removed from the public API.
*/
struct _fluid_mod_t
{
diff --git a/include/fluidsynth/seq.h b/include/fluidsynth/seq.h
index 0187b66..9f0ee6c 100644
--- a/include/fluidsynth/seq.h
+++ b/include/fluidsynth/seq.h
@@ -46,11 +46,11 @@ FLUIDSYNTH_API fluid_sequencer_t* new_fluid_sequencer2(int use_system_timer);
FLUIDSYNTH_API void delete_fluid_sequencer(fluid_sequencer_t* seq);
FLUIDSYNTH_API int fluid_sequencer_get_use_system_timer(fluid_sequencer_t* seq);
FLUIDSYNTH_API
-short fluid_sequencer_register_client(fluid_sequencer_t* seq, const char *name,
+fluid_seq_id_t fluid_sequencer_register_client(fluid_sequencer_t* seq, const char *name,
fluid_event_callback_t callback, void* data);
-FLUIDSYNTH_API void fluid_sequencer_unregister_client(fluid_sequencer_t* seq, short id);
+FLUIDSYNTH_API void fluid_sequencer_unregister_client(fluid_sequencer_t* seq, fluid_seq_id_t id);
FLUIDSYNTH_API int fluid_sequencer_count_clients(fluid_sequencer_t* seq);
-FLUIDSYNTH_API short fluid_sequencer_get_client_id(fluid_sequencer_t* seq, int index);
+FLUIDSYNTH_API fluid_seq_id_t fluid_sequencer_get_client_id(fluid_sequencer_t* seq, int index);
FLUIDSYNTH_API char* fluid_sequencer_get_client_name(fluid_sequencer_t* seq, int id);
FLUIDSYNTH_API int fluid_sequencer_client_is_dest(fluid_sequencer_t* seq, int id);
FLUIDSYNTH_API void fluid_sequencer_process(fluid_sequencer_t* seq, unsigned int msec);
@@ -59,7 +59,7 @@ FLUIDSYNTH_API
int fluid_sequencer_send_at(fluid_sequencer_t* seq, fluid_event_t* evt,
unsigned int time, int absolute);
FLUIDSYNTH_API
-void fluid_sequencer_remove_events(fluid_sequencer_t* seq, short source, short dest, int type);
+void fluid_sequencer_remove_events(fluid_sequencer_t* seq, fluid_seq_id_t source, fluid_seq_id_t dest, int type);
FLUIDSYNTH_API unsigned int fluid_sequencer_get_tick(fluid_sequencer_t* seq);
FLUIDSYNTH_API void fluid_sequencer_set_time_scale(fluid_sequencer_t* seq, double scale);
FLUIDSYNTH_API double fluid_sequencer_get_time_scale(fluid_sequencer_t* seq);
diff --git a/include/fluidsynth/seqbind.h b/include/fluidsynth/seqbind.h
index fc46f08..1fa707c 100644
--- a/include/fluidsynth/seqbind.h
+++ b/include/fluidsynth/seqbind.h
@@ -33,7 +33,7 @@ extern "C" {
*/
FLUIDSYNTH_API
-short fluid_sequencer_register_fluidsynth(fluid_sequencer_t* seq, fluid_synth_t* synth);
+fluid_seq_id_t fluid_sequencer_register_fluidsynth(fluid_sequencer_t* seq, fluid_synth_t* synth);
FLUIDSYNTH_API int
fluid_sequencer_add_midi_event_to_buffer(void* data, fluid_midi_event_t* event);
diff --git a/include/fluidsynth/settings.h b/include/fluidsynth/settings.h
index 613ad77..5551b92 100644
--- a/include/fluidsynth/settings.h
+++ b/include/fluidsynth/settings.h
@@ -148,6 +148,7 @@ FLUIDSYNTH_API
int fluid_settings_dupstr(fluid_settings_t* settings, const char *name, char** str);
FLUIDSYNTH_API
+FLUID_DEPRECATED
int fluid_settings_getstr(fluid_settings_t* settings, const char *name, char** str);
FLUIDSYNTH_API
diff --git a/include/fluidsynth/sfont.h b/include/fluidsynth/sfont.h
index 73f35a7..b550e0a 100644
--- a/include/fluidsynth/sfont.h
+++ b/include/fluidsynth/sfont.h
@@ -75,7 +75,7 @@ enum {
* SoundFont loader structure.
*/
struct _fluid_sfloader_t {
- void* data; /**< User defined data pointer */
+ void* data; /**< User defined data pointer used by _fluid_sfloader_t::load() */
/**
* The free method should free the memory allocated for the loader in
diff --git a/include/fluidsynth/synth.h b/include/fluidsynth/synth.h
index bee64d4..db9a4a9 100644
--- a/include/fluidsynth/synth.h
+++ b/include/fluidsynth/synth.h
@@ -94,18 +94,22 @@ FLUIDSYNTH_API
int fluid_synth_get_program(fluid_synth_t* synth, int chan, unsigned int* sfont_id,
unsigned int* bank_num, unsigned int* preset_num);
FLUIDSYNTH_API int fluid_synth_unset_program (fluid_synth_t *synth, int chan);
-FLUIDSYNTH_API int fluid_synth_get_channel_info (fluid_synth_t *synth, int chan,
- fluid_synth_channel_info_t *info);
+FLUIDSYNTH_API
+FLUID_DEPRECATED
+int fluid_synth_get_channel_info (fluid_synth_t *synth, int chan, fluid_synth_channel_info_t *info);
FLUIDSYNTH_API int fluid_synth_program_reset(fluid_synth_t* synth);
FLUIDSYNTH_API int fluid_synth_system_reset(fluid_synth_t* synth);
FLUIDSYNTH_API int fluid_synth_all_notes_off(fluid_synth_t* synth, int chan);
FLUIDSYNTH_API int fluid_synth_all_sounds_off(fluid_synth_t* synth, int chan);
+/**
+ * The midi channel type used by fluid_synth_set_channel_type()
+ */
enum fluid_midi_channel_type
{
- CHANNEL_TYPE_MELODIC = 0,
- CHANNEL_TYPE_DRUM = 1
+ CHANNEL_TYPE_MELODIC = 0, /**< Melodic midi channel */
+ CHANNEL_TYPE_DRUM = 1 /**< Drum midi channel */
};
FLUIDSYNTH_API int fluid_synth_set_channel_type(fluid_synth_t* synth, int chan, int type);
@@ -217,7 +221,9 @@ enum fluid_interp {
FLUIDSYNTH_API
int fluid_synth_set_gen(fluid_synth_t* synth, int chan, int param, float value);
-FLUIDSYNTH_API int fluid_synth_set_gen2 (fluid_synth_t* synth, int chan,
+FLUIDSYNTH_API
+FLUID_DEPRECATED
+int fluid_synth_set_gen2 (fluid_synth_t* synth, int chan,
int param, float value,
int absolute, int normalized);
FLUIDSYNTH_API float fluid_synth_get_gen(fluid_synth_t* synth, int chan, int param);
@@ -226,12 +232,14 @@ FLUIDSYNTH_API float fluid_synth_get_gen(fluid_synth_t* synth, int chan, int par
/* Tuning */
FLUIDSYNTH_API
+FLUID_DEPRECATED
int fluid_synth_create_key_tuning(fluid_synth_t* synth, int bank, int prog,
const char* name, const double* pitch);
FLUIDSYNTH_API
int fluid_synth_activate_key_tuning(fluid_synth_t* synth, int bank, int prog,
const char* name, const double* pitch, int apply);
FLUIDSYNTH_API
+FLUID_DEPRECATED
int fluid_synth_create_octave_tuning(fluid_synth_t* synth, int bank, int prog,
const char* name, const double* pitch);
FLUIDSYNTH_API
@@ -241,11 +249,14 @@ FLUIDSYNTH_API
int fluid_synth_tune_notes(fluid_synth_t* synth, int bank, int prog,
int len, const int *keys, const double* pitch, int apply);
FLUIDSYNTH_API
+FLUID_DEPRECATED
int fluid_synth_select_tuning(fluid_synth_t* synth, int chan, int bank, int prog);
FLUIDSYNTH_API
int fluid_synth_activate_tuning(fluid_synth_t* synth, int chan, int bank, int prog,
int apply);
-FLUIDSYNTH_API int fluid_synth_reset_tuning(fluid_synth_t* synth, int chan);
+FLUIDSYNTH_API
+FLUID_DEPRECATED
+int fluid_synth_reset_tuning(fluid_synth_t* synth, int chan);
FLUIDSYNTH_API
int fluid_synth_deactivate_tuning(fluid_synth_t* synth, int chan, int apply);
FLUIDSYNTH_API void fluid_synth_tuning_iteration_start(fluid_synth_t* synth);
@@ -305,8 +316,9 @@ FLUIDSYNTH_API void fluid_synth_start_voice(fluid_synth_t* synth, fluid_voice_t*
FLUIDSYNTH_API void fluid_synth_get_voicelist(fluid_synth_t* synth,
fluid_voice_t* buf[], int bufsize, int ID);
FLUIDSYNTH_API int fluid_synth_handle_midi_event(void* data, fluid_midi_event_t* event);
-FLUIDSYNTH_API void fluid_synth_set_midi_router(fluid_synth_t* synth,
- fluid_midi_router_t* router);
+FLUIDSYNTH_API
+FLUID_DEPRECATED
+void fluid_synth_set_midi_router(fluid_synth_t* synth, fluid_midi_router_t* router);
#ifdef __cplusplus
}
diff --git a/include/fluidsynth/types.h b/include/fluidsynth/types.h
index a019bbd..ebe40a8 100644
--- a/include/fluidsynth/types.h
+++ b/include/fluidsynth/types.h
@@ -60,6 +60,7 @@ typedef struct _fluid_rampreset_t fluid_rampreset_t; /**< RAM SoundFo
typedef int fluid_istream_t; /**< Input stream descriptor */
typedef int fluid_ostream_t; /**< Output stream descriptor */
+typedef short fluid_seq_id_t; /**< Unique client IDs used by the sequencer and #fluid_event_t, obtained by fluid_sequencer_register_client() and fluid_sequencer_register_fluidsynth() */
#ifdef __cplusplus
}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 98f4d99..c143a7f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -32,6 +32,10 @@ include_directories (
${CMAKE_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/include
${PTHREADS_INCLUDE_DIR}
+)
+
+include_directories (
+ SYSTEM
${GLIB_INCLUDEDIR}
${GLIB_INCLUDE_DIRS}
)
@@ -76,7 +80,7 @@ if ( PORTAUDIO_SUPPORT )
endif ( PORTAUDIO_SUPPORT )
if ( WINDOWS_SUPPORT )
- set ( fluid_windows_SOURCES fluid_dll.c drivers/fluid_dsound.c drivers/fluid_winmidi.c )
+ set ( fluid_windows_SOURCES drivers/fluid_dsound.c drivers/fluid_winmidi.c )
endif ( WINDOWS_SUPPORT )
if ( OSS_SUPPORT )
@@ -266,11 +270,19 @@ if ( MACOSX_FRAMEWORK )
elseif ( OS2 )
set_target_properties ( libfluidsynth
PROPERTIES
- OUTPUT_NAME "fluidsyn"
- ARCHIVE_OUTPUT_NAME "fluidsynth"
+ OUTPUT_NAME "fluidsynth"
VERSION ${LIB_VERSION_INFO}
SOVERSION ${LIB_VERSION_CURRENT}
)
+elseif ( WIN32 )
+ set_target_properties ( libfluidsynth
+ PROPERTIES
+ ARCHIVE_OUTPUT_NAME "fluidsynth"
+ PREFIX "lib"
+ OUTPUT_NAME "fluidsynth-${LIB_VERSION_CURRENT}"
+ VERSION ${LIB_VERSION_INFO}
+ SOVERSION ${LIB_VERSION_CURRENT}
+ )
else ( MACOSX_FRAMEWORK )
set_target_properties ( libfluidsynth
PROPERTIES
diff --git a/src/bindings/fluid_cmd.c b/src/bindings/fluid_cmd.c
index 58dc504..12104da 100644
--- a/src/bindings/fluid_cmd.c
+++ b/src/bindings/fluid_cmd.c
@@ -350,6 +350,7 @@ fluid_source(fluid_cmd_handler_t* handler, const char *filename)
{
int file;
fluid_shell_t shell;
+ int result;
#ifdef WIN32
file = _open(filename, _O_RDONLY);
@@ -360,7 +361,15 @@ fluid_source(fluid_cmd_handler_t* handler, const char *filename)
return file;
}
fluid_shell_init(&shell, NULL, handler, file, fluid_get_stdout());
- return fluid_shell_run(&shell);
+ result = fluid_shell_run(&shell);
+
+#ifdef WIN32
+ _close(file);
+#else
+ close(file);
+#endif
+
+ return result;
}
/**
@@ -1237,7 +1246,7 @@ fluid_handle_tunings(fluid_synth_t* synth, int ac, char** av, fluid_ostream_t ou
int
fluid_handle_dumptuning(fluid_synth_t* synth, int ac, char** av, fluid_ostream_t out)
{
- int bank, prog, i;
+ int bank, prog, i, res;
double pitch[128];
char name[256];
@@ -1266,7 +1275,11 @@ fluid_handle_dumptuning(fluid_synth_t* synth, int ac, char** av, fluid_ostream_t
return -1;
};
- fluid_synth_tuning_dump(synth, bank, prog, name, 256, pitch);
+ res = fluid_synth_tuning_dump(synth, bank, prog, name, 256, pitch);
+ if (FLUID_OK != res) {
+ fluid_ostream_printf(out, "Tuning %03d-%03d does not exist.\n", bank, prog);
+ return -1;
+ }
fluid_ostream_printf(out, "%03d-%03d %s:\n", bank, prog, name);
diff --git a/src/bindings/fluid_filerenderer.c b/src/bindings/fluid_filerenderer.c
index bbe903b..fd0208c 100644
--- a/src/bindings/fluid_filerenderer.c
+++ b/src/bindings/fluid_filerenderer.c
@@ -310,13 +310,14 @@ new_fluid_file_renderer(fluid_synth_t* synth)
/**
* Set vbr encoding quality (only available with libsndfile support)
* @param dev File renderer object.
+ * @return #FLUID_OK if the quality has been successfully set, #FLUID_FAILED otherwise
* @since 1.1.7
*/
int
fluid_file_set_encoding_quality(fluid_file_renderer_t* r, double q)
{
#if LIBSNDFILE_SUPPORT
- if (sf_command (r->sndfile, SFC_SET_VBR_ENCODING_QUALITY, &q, sizeof (double)) == 0)
+ if (sf_command (r->sndfile, SFC_SET_VBR_ENCODING_QUALITY, &q, sizeof (double)) == SF_TRUE)
return FLUID_OK;
else
#endif
diff --git a/src/config_win32.cmake b/src/config_win32.cmake
index a7a4be3..650fd36 100644
--- a/src/config_win32.cmake
+++ b/src/config_win32.cmake
@@ -6,12 +6,12 @@
#define WINMIDI_SUPPORT 1
#if _MSC_VER < 1900
-#define snprintf _snprintf
+#define snprintf g_snprintf
#endif
#define strcasecmp _stricmp
#if _MSC_VER < 1500
-#define vsnprintf _vsnprintf
+#define vsnprintf g_vsnprintf
#endif
#define STDIN_FILENO 0
diff --git a/src/config_win32.h.in b/src/config_win32.h.in
index 788add5..163a3e8 100644
--- a/src/config_win32.h.in
+++ b/src/config_win32.h.in
@@ -15,13 +15,13 @@
#define WITH_FLOAT 1
#if _MSC_VER < 1900
-#define snprintf _snprintf
+#define snprintf g_snprintf
#endif
#define strcasecmp _stricmp
#if _MSC_VER < 1500
-#define vsnprintf _vsnprintf
+#define vsnprintf g_vsnprintf
#endif
#define STDIN_FILENO 0
diff --git a/src/drivers/fluid_adriver.c b/src/drivers/fluid_adriver.c
index c41e354..da77e1f 100644
--- a/src/drivers/fluid_adriver.c
+++ b/src/drivers/fluid_adriver.c
@@ -118,87 +118,102 @@ fluid_audio_driver_t* new_fluid_file_audio_driver(fluid_settings_t* settings,
int delete_fluid_file_audio_driver(fluid_audio_driver_t* p);
#endif
+
/* Available audio drivers, listed in order of preference */
-fluid_audriver_definition_t fluid_audio_drivers[] = {
+static const fluid_audriver_definition_t fluid_audio_drivers[] =
+{
#if JACK_SUPPORT
- { "jack",
- new_fluid_jack_audio_driver,
- new_fluid_jack_audio_driver2,
- delete_fluid_jack_audio_driver,
- fluid_jack_audio_driver_settings },
+ { "jack",
+ new_fluid_jack_audio_driver,
+ new_fluid_jack_audio_driver2,
+ delete_fluid_jack_audio_driver,
+ fluid_jack_audio_driver_settings },
#endif
+
#if ALSA_SUPPORT
- { "alsa",
- new_fluid_alsa_audio_driver,
- new_fluid_alsa_audio_driver2,
- delete_fluid_alsa_audio_driver,
- fluid_alsa_audio_driver_settings },
+ { "alsa",
+ new_fluid_alsa_audio_driver,
+ new_fluid_alsa_audio_driver2,
+ delete_fluid_alsa_audio_driver,
+ fluid_alsa_audio_driver_settings },
#endif
+
#if OSS_SUPPORT
- { "oss",
- new_fluid_oss_audio_driver,
- new_fluid_oss_audio_driver2,
- delete_fluid_oss_audio_driver,
- fluid_oss_audio_driver_settings },
+ { "oss",
+ new_fluid_oss_audio_driver,
+ new_fluid_oss_audio_driver2,
+ delete_fluid_oss_audio_driver,
+ fluid_oss_audio_driver_settings },
#endif
+
#if PULSE_SUPPORT
- { "pulseaudio",
- new_fluid_pulse_audio_driver,
- new_fluid_pulse_audio_driver2,
- delete_fluid_pulse_audio_driver,
- fluid_pulse_audio_driver_settings },
+ { "pulseaudio",
+ new_fluid_pulse_audio_driver,
+ new_fluid_pulse_audio_driver2,
+ delete_fluid_pulse_audio_driver,
+ fluid_pulse_audio_driver_settings },
#endif
+
#if COREAUDIO_SUPPORT
- { "coreaudio",
- new_fluid_core_audio_driver,
- new_fluid_core_audio_driver2,
- delete_fluid_core_audio_driver,
- fluid_core_audio_driver_settings },
+ { "coreaudio",
+ new_fluid_core_audio_driver,
+ new_fluid_core_audio_driver2,
+ delete_fluid_core_audio_driver,
+ fluid_core_audio_driver_settings },
#endif
+
#if DSOUND_SUPPORT
- { "dsound",
- new_fluid_dsound_audio_driver,
- NULL,
- delete_fluid_dsound_audio_driver,
- fluid_dsound_audio_driver_settings },
+ { "dsound",
+ new_fluid_dsound_audio_driver,
+ NULL,
+ delete_fluid_dsound_audio_driver,
+ fluid_dsound_audio_driver_settings },
#endif
+
#if PORTAUDIO_SUPPORT
- { "portaudio",
- new_fluid_portaudio_driver,
- NULL,
- delete_fluid_portaudio_driver,
- fluid_portaudio_driver_settings },
+ { "portaudio",
+ new_fluid_portaudio_driver,
+ NULL,
+ delete_fluid_portaudio_driver,
+ fluid_portaudio_driver_settings },
#endif
+
#if SNDMAN_SUPPORT
- { "sndman",
- new_fluid_sndmgr_audio_driver,
- new_fluid_sndmgr_audio_driver2,
- delete_fluid_sndmgr_audio_driver,
- NULL },
+ { "sndman",
+ new_fluid_sndmgr_audio_driver,
+ new_fluid_sndmgr_audio_driver2,
+ delete_fluid_sndmgr_audio_driver,
+ NULL },
#endif
+
#if DART_SUPPORT
- { "dart",
- new_fluid_dart_audio_driver,
- NULL,
- delete_fluid_dart_audio_driver,
- fluid_dart_audio_driver_settings },
+ { "dart",
+ new_fluid_dart_audio_driver,
+ NULL,
+ delete_fluid_dart_audio_driver,
+ fluid_dart_audio_driver_settings },
#endif
+
#if AUFILE_SUPPORT
- { "file",
- new_fluid_file_audio_driver,
- NULL,
- delete_fluid_file_audio_driver,
- NULL },
+ { "file",
+ new_fluid_file_audio_driver,
+ NULL,
+ delete_fluid_file_audio_driver,
+ NULL },
#endif
- { NULL, NULL, NULL, NULL, NULL }
};
+#define ENABLE_AUDIO_DRIVER(_drv, _idx) \
+ _drv[(_idx) / (sizeof(*(_drv))*8)] &= ~(1 << ((_idx) % (sizeof((*_drv))*8)))
+#define IS_AUDIO_DRIVER_ENABLED(_drv, _idx) \
+ (!(_drv[(_idx) / (sizeof(*(_drv))*8)] & (1 << ((_idx) % (sizeof((*_drv))*8)))))
+static uint8 fluid_adriver_disable_mask[(FLUID_N_ELEMENTS(fluid_audio_drivers)+7)/8] = {0};
void fluid_audio_driver_settings(fluid_settings_t* settings)
{
- int i;
+ unsigned int i;
fluid_settings_register_str(settings, "audio.sample-format", "16bits", 0, NULL, NULL);
fluid_settings_add_option(settings, "audio.sample-format", "16bits");
@@ -279,13 +294,42 @@ void fluid_audio_driver_settings(fluid_settings_t* settings)
fluid_settings_add_option(settings, "audio.driver", "file");
#endif
- for (i = 0; fluid_audio_drivers[i].name != NULL; i++) {
- if (fluid_audio_drivers[i].settings != NULL) {
+ for (i = 0; i < FLUID_N_ELEMENTS(fluid_audio_drivers); i++) {
+ if (fluid_audio_drivers[i].settings != NULL &&
+ IS_AUDIO_DRIVER_ENABLED(fluid_adriver_disable_mask, i)) {
fluid_audio_drivers[i].settings(settings);
}
}
}
+static const fluid_audriver_definition_t*
+find_fluid_audio_driver(fluid_settings_t* settings)
+{
+ unsigned int i;
+ char* name;
+ char *allnames;
+
+ for (i = 0; i < FLUID_N_ELEMENTS(fluid_audio_drivers); i++) {
+ /* If this driver is de-activated, just ignore it */
+ if (!IS_AUDIO_DRIVER_ENABLED(fluid_adriver_disable_mask, i))
+ continue;
+
+ if (fluid_settings_str_equal(settings, "audio.driver", fluid_audio_drivers[i].name)) {
+ FLUID_LOG(FLUID_DBG, "Using '%s' audio driver", fluid_audio_drivers[i].name);
+ return &fluid_audio_drivers[i];
+ }
+ }
+
+ allnames = fluid_settings_option_concat (settings, "audio.driver", NULL);
+ fluid_settings_dupstr (settings, "audio.driver", &name); /* ++ alloc name */
+ FLUID_LOG(FLUID_ERR, "Couldn't find the requested audio driver %s. Valid drivers are: %s.",
+ name ? name : "NULL", allnames ? allnames : "ERROR");
+ if (name) FLUID_FREE (name);
+ if (allnames) FLUID_FREE (allnames);
+
+ return NULL;
+}
+
/**
* Create a new audio driver.
* @param settings Configuration settings used to select and create the audio
@@ -299,28 +343,17 @@ void fluid_audio_driver_settings(fluid_settings_t* settings)
fluid_audio_driver_t*
new_fluid_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth)
{
- int i;
- fluid_audio_driver_t* driver = NULL;
- char* name;
- char *allnames;
+ const fluid_audriver_definition_t *def = find_fluid_audio_driver(settings);
- for (i = 0; fluid_audio_drivers[i].name != NULL; i++) {
- if (fluid_settings_str_equal(settings, "audio.driver", fluid_audio_drivers[i].name)) {
- FLUID_LOG(FLUID_DBG, "Using '%s' audio driver", fluid_audio_drivers[i].name);
- driver = (*fluid_audio_drivers[i].new)(settings, synth);
- if (driver) {
- driver->name = fluid_audio_drivers[i].name;
- }
- return driver;
- }
+ if (def) {
+ fluid_audio_driver_t *driver = (*def->new)(settings, synth);
+
+ if (driver)
+ driver->name = def->name;
+
+ return driver;
}
- allnames = fluid_settings_option_concat (settings, "audio.driver", NULL);
- fluid_settings_dupstr (settings, "audio.driver", &name); /* ++ alloc name */
- FLUID_LOG(FLUID_ERR, "Couldn't find the requested audio driver %s. Valid drivers are: %s.",
- name ? name : "NULL", allnames ? allnames : "ERROR");
- if (name) FLUID_FREE (name);
- if (allnames) FLUID_FREE (allnames);
return NULL;
}
@@ -341,26 +374,22 @@ new_fluid_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth)
fluid_audio_driver_t*
new_fluid_audio_driver2(fluid_settings_t* settings, fluid_audio_func_t func, void* data)
{
- int i;
- fluid_audio_driver_t* driver = NULL;
- char* name;
+ const fluid_audriver_definition_t *def = find_fluid_audio_driver(settings);
- for (i = 0; fluid_audio_drivers[i].name != NULL; i++) {
- if (fluid_settings_str_equal(settings, "audio.driver", fluid_audio_drivers[i].name) &&
- (fluid_audio_drivers[i].new2 != NULL)) {
- FLUID_LOG(FLUID_DBG, "Using '%s' audio driver", fluid_audio_drivers[i].name);
- driver = (*fluid_audio_drivers[i].new2)(settings, func, data);
- if (driver) {
- driver->name = fluid_audio_drivers[i].name;
- }
- return driver;
+ if (def) {
+ fluid_audio_driver_t *driver = NULL;
+
+ if (def->new2 == NULL)
+ FLUID_LOG(FLUID_DBG, "Callback mode unsupported on '%s' audio driver", def->name);
+ else {
+ driver = (*def->new2)(settings, func, data);
+ if (driver)
+ driver->name = def->name;
}
+
+ return driver;
}
- fluid_settings_dupstr(settings, "audio.driver", &name); /* ++ alloc name */
- FLUID_LOG(FLUID_ERR, "Couldn't find the requested audio driver: %s",
- name ? name : "NULL");
- if (name) FLUID_FREE (name);
return NULL;
}
@@ -373,12 +402,84 @@ new_fluid_audio_driver2(fluid_settings_t* settings, fluid_audio_func_t func, voi
void
delete_fluid_audio_driver(fluid_audio_driver_t* driver)
{
- int i;
+ unsigned int i;
- for (i = 0; fluid_audio_drivers[i].name != NULL; i++) {
+ /* iterate over fluid_audio_drivers_template to ensure deleting even drivers currently not registered */
+ for (i = 0; i < FLUID_N_ELEMENTS(fluid_audio_drivers); i++) {
if (fluid_audio_drivers[i].name == driver->name) {
fluid_audio_drivers[i].free(driver);
return;
}
}
}
+
+
+/**
+ * @brief Registers audio drivers to use
+ *
+ * When creating a settings instance with new_fluid_settings(), all audio drivers are initialized once.
+ * In the past this has caused segfaults and application crashes due to buggy soundcard drivers.
+ *
+ * This function enables the user to only initialize specific audio drivers when settings instances are created.
+ * Therefore pass a NULL-terminated array of C-strings containing the \c names of audio drivers to register
+ * for the usage with fluidsynth.
+ * The \c names are the same as being used for the \c audio.driver setting.
+ *
+ * By default all audio drivers fluidsynth has been compiled with are registered, so calling this function is optional.
+ *
+ * @warning This function may only be called if no thread is residing in fluidsynth's API and no instances of any kind
+ * are alive (e.g. as it would be the case right after fluidsynth's inital creation). Else the behaviour is undefined.
+ * Furtermore any attempt of using audio drivers that have not been registered is undefined behaviour!
+ *
+ * @param adrivers NULL-terminated array of audio drivers to register. Pass NULL to register all available drivers.
+ * @return #FLUID_OK if all the audio drivers requested by the user are supported by fluidsynth and have been
+ * successfully registered. Otherwise #FLUID_FAILED is returned and this function has no effect.
+ *
+ * @note This function is not thread safe and will never be!
+ * @since 1.1.9
+ */
+int fluid_audio_driver_register(const char** adrivers)
+{
+ unsigned int i;
+ uint8 disable_mask[FLUID_N_ELEMENTS(fluid_adriver_disable_mask)];
+
+ if (adrivers == NULL) {
+ /* Pass NULL to register all available drivers. */
+ FLUID_MEMSET(fluid_adriver_disable_mask, 0, sizeof(fluid_adriver_disable_mask));
+
+ return FLUID_OK;
+ }
+
+ FLUID_MEMSET(disable_mask, 0xFF, sizeof(disable_mask));
+
+ for(i=0; adrivers[i] != NULL; i++)
+ {
+ unsigned int j;
+ /* search the requested audio driver in the template and copy it over if found */
+ for (j = 0; j < FLUID_N_ELEMENTS(fluid_audio_drivers); j++)
+ {
+ if (FLUID_STRCMP(adrivers[i], fluid_audio_drivers[j].name) == 0)
+ {
+ ENABLE_AUDIO_DRIVER(disable_mask, j);
+ break;
+ }
+ }
+
+ if(j >= FLUID_N_ELEMENTS(fluid_audio_drivers))
+ {
+ /* requested driver not found, failure */
+ return FLUID_FAILED;
+ }
+ }
+
+ if(i >= FLUID_N_ELEMENTS(fluid_audio_drivers))
+ {
+ /* user requested more drivers than this build of fluidsynth supports, failure */
+ return FLUID_FAILED;
+ }
+
+ /* Update list of activated drivers */
+ FLUID_MEMCPY(fluid_adriver_disable_mask, disable_mask, sizeof(disable_mask));
+
+ return FLUID_OK;
+}
diff --git a/src/drivers/fluid_adriver.h b/src/drivers/fluid_adriver.h
index 58b60ad..e3fe7ef 100644
--- a/src/drivers/fluid_adriver.h
+++ b/src/drivers/fluid_adriver.h
@@ -21,7 +21,7 @@
#ifndef _FLUID_AUDRIVER_H
#define _FLUID_AUDRIVER_H
-#include "fluidsynth_priv.h"
+#include "fluid_sys.h"
void fluid_audio_driver_settings(fluid_settings_t* settings);
diff --git a/src/drivers/fluid_dsound.c b/src/drivers/fluid_dsound.c
index 7a39258..dc69dfb 100644
--- a/src/drivers/fluid_dsound.c
+++ b/src/drivers/fluid_dsound.c
@@ -35,12 +35,8 @@ new_fluid_dsound_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth);
int delete_fluid_dsound_audio_driver(fluid_audio_driver_t* data);
DWORD WINAPI fluid_dsound_audio_run(LPVOID lpParameter);
-HWND fluid_win32_get_window(void);
char* fluid_win32_error(HRESULT hr);
-
-#define FLUID_HINSTANCE ((HINSTANCE)fluid_get_hinstance())
-
typedef struct {
fluid_audio_driver_t driver;
LPDIRECTSOUND direct_sound;
@@ -109,21 +105,7 @@ new_fluid_dsound_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth)
double sample_rate;
int periods, period_size;
fluid_dsound_devsel_t devsel;
-
- /* check if the globals are initialized */
- if (FLUID_HINSTANCE == NULL) {
- FLUID_LOG(FLUID_ERR, "FluidSynth hinstance not set, which is needed for DirectSound");
- return NULL;
- }
-
-/*
- if (fluid_wnd == NULL) {
- if (fluid_win32_create_window() != 0) {
- FLUID_LOG(FLUID_ERR, "Couldn't create window needed for DirectSound");
- return NULL;
- }
- }
-*/
+
/* create and clear the driver data */
dev = FLUID_NEW(fluid_dsound_audio_driver_t);
if (dev == NULL) {
@@ -131,7 +113,6 @@ new_fluid_dsound_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth)
return NULL;
}
FLUID_MEMSET(dev, 0, sizeof(fluid_dsound_audio_driver_t));
-
dev->synth = synth;
dev->cont = 1;
@@ -182,8 +163,8 @@ new_fluid_dsound_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth)
FLUID_LOG(FLUID_ERR, "Failed to create the DirectSound object");
goto error_recovery;
}
-
- hr = IDirectSound_SetCooperativeLevel(dev->direct_sound, fluid_win32_get_window(), DSSCL_PRIORITY);
+
+ hr = IDirectSound_SetCooperativeLevel(dev->direct_sound, GetDesktopWindow(), DSSCL_PRIORITY);
if (hr != DS_OK) {
FLUID_LOG(FLUID_ERR, "Failed to set the cooperative level");
goto error_recovery;
@@ -306,7 +287,6 @@ int delete_fluid_dsound_audio_driver(fluid_audio_driver_t* d)
if (dev->direct_sound != NULL) {
IDirectSound_Release(dev->direct_sound);
}
-
FLUID_FREE(dev);
// fluid_win32_destroy_window();
diff --git a/src/drivers/fluid_mdriver.c b/src/drivers/fluid_mdriver.c
index 5404920..b7c188b 100644
--- a/src/drivers/fluid_mdriver.c
+++ b/src/drivers/fluid_mdriver.c
@@ -21,6 +21,13 @@
#include "fluid_mdriver.h"
#include "fluid_settings.h"
+#undef FLUID_MIDI_SUPPORT
+
+#if ALSA_SUPPORT || JACK_SUPPORT || OSS_SUPPORT || \
+ WINMIDI_SUPPORT || MIDISHARE_SUPPORT || COREMIDI_SUPPORT
+/* At least an input driver exits */
+#define FLUID_MIDI_SUPPORT 1
+#endif
/* ALSA */
#if ALSA_SUPPORT
@@ -82,6 +89,8 @@ void fluid_coremidi_driver_settings(fluid_settings_t* settings);
#endif
+#ifdef FLUID_MIDI_SUPPORT
+
/*
* fluid_mdriver_definition
*/
@@ -139,7 +148,7 @@ struct fluid_mdriver_definition_t fluid_midi_drivers[] = {
{ NULL, NULL, NULL, NULL }
};
-
+#endif /* FLUID_MIDI_SUPPORT */
void fluid_midi_driver_settings(fluid_settings_t* settings)
{
@@ -186,11 +195,13 @@ void fluid_midi_driver_settings(fluid_settings_t* settings)
fluid_settings_add_option(settings, "midi.driver", "coremidi");
#endif
+#ifdef FLUID_MIDI_SUPPORT
for (i = 0; fluid_midi_drivers[i].name != NULL; i++) {
if (fluid_midi_drivers[i].settings != NULL) {
fluid_midi_drivers[i].settings(settings);
}
}
+#endif
}
/**
@@ -203,6 +214,7 @@ void fluid_midi_driver_settings(fluid_settings_t* settings)
*/
fluid_midi_driver_t* new_fluid_midi_driver(fluid_settings_t* settings, handle_midi_event_func_t handler, void* event_handler_data)
{
+#ifdef FLUID_MIDI_SUPPORT
fluid_midi_driver_t* driver = NULL;
char *allnames;
int i;
@@ -222,7 +234,7 @@ fluid_midi_driver_t* new_fluid_midi_driver(fluid_settings_t* settings, handle_mi
FLUID_LOG(FLUID_ERR, "Couldn't find the requested midi driver. Valid drivers are: %s.",
allnames ? allnames : "ERROR");
if (allnames) FLUID_FREE (allnames);
-
+#endif
return NULL;
}
@@ -232,6 +244,7 @@ fluid_midi_driver_t* new_fluid_midi_driver(fluid_settings_t* settings, handle_mi
*/
void delete_fluid_midi_driver(fluid_midi_driver_t* driver)
{
+#ifdef FLUID_MIDI_SUPPORT
int i;
for (i = 0; fluid_midi_drivers[i].name != NULL; i++) {
@@ -240,4 +253,5 @@ void delete_fluid_midi_driver(fluid_midi_driver_t* driver)
return;
}
}
+#endif
}
diff --git a/src/drivers/fluid_portaudio.c b/src/drivers/fluid_portaudio.c
index 0f28363..0d1e9a7 100644
--- a/src/drivers/fluid_portaudio.c
+++ b/src/drivers/fluid_portaudio.c
@@ -37,9 +37,6 @@
#if PORTAUDIO_SUPPORT
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
#include <portaudio.h>
diff --git a/src/drivers/fluid_pulse.c b/src/drivers/fluid_pulse.c
index ba207bb..8e42b1d 100644
--- a/src/drivers/fluid_pulse.c
+++ b/src/drivers/fluid_pulse.c
@@ -251,6 +251,9 @@ fluid_pulse_audio_run2(void* d)
if (left == NULL || right == NULL || buf == NULL)
{
+ FLUID_FREE(left);
+ FLUID_FREE(right);
+ FLUID_FREE(buf);
FLUID_LOG(FLUID_ERR, "Out of memory.");
return;
}
diff --git a/src/fluid_dll.c b/src/fluid_dll.c
index 89ec205..9e1f812 100644
--- a/src/fluid_dll.c
+++ b/src/fluid_dll.c
@@ -23,12 +23,7 @@
#include "fluid_sys.h"
static HINSTANCE fluid_hinstance = NULL;
-static HWND fluid_wnd = NULL;
-static int fluid_refCount = 0;
-int fluid_win32_create_window(void);
-void fluid_win32_destroy_window(void);
-HWND fluid_win32_get_window(void);
#ifndef FLUIDSYNTH_NOT_A_DLL
BOOL WINAPI DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
@@ -36,17 +31,7 @@ BOOL WINAPI DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
FLUID_LOG(FLUID_DBG, "DllMain");
switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH:
- fluid_refCount++;
- if (1 == fluid_refCount) {
fluid_set_hinstance((void*) hModule);
- fluid_win32_create_window();
- }
- break;
- case DLL_PROCESS_DETACH:
- fluid_refCount--;
- if (fluid_refCount == 0) {
- fluid_win32_destroy_window();
- }
break;
}
return TRUE;
@@ -58,6 +43,8 @@ BOOL WINAPI DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
* @param Application instance pointer
*
* The handle is needed to open DirectSound.
+ *
+ * @deprecated As of 1.1.9 DirectSound driver uses the desktop window handle, making this function redundant.
*/
void fluid_set_hinstance(void* hinstance)
{
@@ -70,64 +57,10 @@ void fluid_set_hinstance(void* hinstance)
/**
* Get the handle to the instance of the application on the Windows platform.
* @return Application instance pointer or NULL if not set
+ *
+ * @deprecated As of 1.1.9 DirectSound driver uses the desktop window handle, making this function redundant.
*/
void* fluid_get_hinstance(void)
{
return (void*) fluid_hinstance;
}
-
-static long FAR PASCAL fluid_win32_wndproc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- switch (message) {
- case WM_CREATE:
- break;
- case WM_DESTROY:
- break;
- default:
- return DefWindowProc(hWnd, message, wParam, lParam);
- break;
- }
- return(0L);
-}
-
-int fluid_win32_create_window(void)
-{
- WNDCLASS myClass;
- myClass.hCursor = LoadCursor( NULL, IDC_ARROW );
- myClass.hIcon = NULL;
- myClass.lpszMenuName = (LPSTR) NULL;
- myClass.lpszClassName = (LPSTR) "FluidSynth";
- myClass.hbrBackground = (HBRUSH)(COLOR_WINDOW);
- myClass.hInstance = fluid_hinstance;
- myClass.style = CS_GLOBALCLASS;
- myClass.lpfnWndProc = fluid_win32_wndproc;
- myClass.cbClsExtra = 0;
- myClass.cbWndExtra = 0;
- if (!RegisterClass(&myClass)) {
- return -100;
- }
- fluid_wnd = CreateWindow((LPSTR) "FluidSynth", (LPSTR) "FluidSynth", WS_OVERLAPPEDWINDOW,
- CW_USEDEFAULT, CW_USEDEFAULT, 400, 300, (HWND) NULL, (HMENU) NULL,
- fluid_hinstance, (LPSTR) NULL);
- if (fluid_wnd == NULL) {
- FLUID_LOG(FLUID_ERR, "Can't create window");
- return -101;
- }
- return 0;
-}
-
-void fluid_win32_destroy_window(void)
-{
- HWND hwnd = fluid_win32_get_window();
- if (hwnd) {
- DestroyWindow(hwnd);
- fluid_wnd = 0;
- }
-}
-
-HWND fluid_win32_get_window(void)
-{
- return fluid_wnd;
-}
-
-#endif // #ifdef WIN32
diff --git a/src/fluidsynth.c b/src/fluidsynth.c
index 2799821..96d410b 100644
--- a/src/fluidsynth.c
+++ b/src/fluidsynth.c
@@ -34,6 +34,7 @@
#if defined(HAVE_GETOPT_H)
#include <getopt.h>
+#define GETOPT_SUPPORT 1
#endif
#include "fluidsynth.h"
@@ -66,15 +67,6 @@ static fluid_cmd_handler_t* newclient(void* data, char* addr);
fluid_cmd_handler_t* cmd_handler = NULL;
int option_help = 0; /* set to 1 if "-o help" is specified */
-/*
- * support for the getopt function
- */
-#if defined(HAVE_GETOPT_H)
-#define GETOPT_SUPPORT 1
-int getopt(int argc, char * const argv[], const char *optstring);
-extern char *optarg;
-extern int optind, opterr, optopt;
-#endif
/* Process a command line option -o setting=value, for example: -o synth.polyhony=16 */
void process_o_cmd_line_option(fluid_settings_t* settings, char* optarg)
@@ -591,14 +583,18 @@ int main(int argc, char** argv)
}
#endif
- /* The 'groups' setting is only relevant for LADSPA operation
+ /* The 'groups' setting is relevant for LADSPA operation and channel mapping
+ * in rvoice_mixer.
* If not given, set number groups to number of audio channels, because
* they are the same (there is nothing between synth output and 'sound card')
*/
if ((audio_groups == 0) && (audio_channels != 0)) {
audio_groups = audio_channels;
}
- fluid_settings_setint(settings, "synth.audio-groups", audio_groups);
+ if (audio_groups != 0)
+ {
+ fluid_settings_setint(settings, "synth.audio-groups", audio_groups);
+ }
if (fast_render) {
midi_in = 0;
@@ -770,7 +766,7 @@ int main(int argc, char** argv)
cleanup:
-#if !defined(MACINTOSH) && !defined(WIN32)
+#if !defined(MACINTOSH)
if (server != NULL) {
/* if the user typed 'quit' in the shell, kill the server */
if (!interactive) {
@@ -847,7 +843,7 @@ void
print_welcome()
{
printf("FluidSynth version %s\n"
- "Copyright (C) 2000-2012 Peter Hanappe and others.\n"
+ "Copyright (C) 2000-2018 Peter Hanappe and others.\n"
"Distributed under the LGPL license.\n"
"SoundFont(R) is a registered trademark of E-mu Systems, Inc.\n\n",
FLUIDSYNTH_VERSION);
diff --git a/src/midi/fluid_midi.c b/src/midi/fluid_midi.c
index e589d5c..f6fbb60 100644
--- a/src/midi/fluid_midi.c
+++ b/src/midi/fluid_midi.c
@@ -227,8 +227,8 @@ int fluid_midi_file_eof(fluid_midi_file* mf)
int
fluid_midi_file_read_mthd(fluid_midi_file *mf)
{
- char mthd[15];
- if (fluid_midi_file_read(mf, mthd, 14) != FLUID_OK) {
+ char mthd[14];
+ if (fluid_midi_file_read(mf, mthd, sizeof(mthd)) != FLUID_OK) {
return FLUID_FAILED;
}
if ((FLUID_STRNCMP(mthd, "MThd", 4) != 0) || (mthd[7] != 6)
@@ -240,15 +240,15 @@ fluid_midi_file_read_mthd(fluid_midi_file *mf)
mf->type = mthd[9];
mf->ntracks = (unsigned) mthd[11];
mf->ntracks += (unsigned int) (mthd[10]) << 16;
- if ((mthd[12]) < 0) {
+ if ((signed char)mthd[12] < 0) {
mf->uses_smpte = 1;
- mf->smpte_fps = -mthd[12];
+ mf->smpte_fps = -(signed char)mthd[12];
mf->smpte_res = (unsigned) mthd[13];
FLUID_LOG(FLUID_ERR, "File uses SMPTE timing -- Not implemented yet");
return FLUID_FAILED;
} else {
mf->uses_smpte = 0;
- mf->division = (mthd[12] << 8) | (mthd[13] & 0xff);
+ mf->division = ((unsigned)mthd[12] << 8) | ((unsigned)mthd[13] & 0xff);
FLUID_LOG(FLUID_DBG, "Division=%d", mf->division);
}
return FLUID_OK;
diff --git a/src/midi/fluid_midi.h b/src/midi/fluid_midi.h
index fc26c9b..a696580 100644
--- a/src/midi/fluid_midi.h
+++ b/src/midi/fluid_midi.h
@@ -265,7 +265,7 @@ int fluid_track_send_events(fluid_track_t* track,
#define fluid_track_eot(track) ((track)->cur == NULL)
-/**
+/*
* fluid_playlist_item
* Used as the `data' elements of the fluid_player.playlist.
* Represents either a filename or a pre-loaded memory buffer.
diff --git a/src/midi/fluid_seq.c b/src/midi/fluid_seq.c
index b97ff4d..62789dd 100644
--- a/src/midi/fluid_seq.c
+++ b/src/midi/fluid_seq.c
@@ -46,7 +46,7 @@ struct _fluid_sequencer_t {
gboolean useSystemTimer;
double scale; // ticks per second
fluid_list_t* clients;
- short clientsID;
+ fluid_seq_id_t clientsID;
/* for queue + heap */
fluid_evt_entry* preQueue;
fluid_evt_entry* preQueueLast;
@@ -67,7 +67,7 @@ struct _fluid_sequencer_t {
/* Private data for clients */
typedef struct _fluid_sequencer_client_t {
- short id;
+ fluid_seq_id_t id;
char* name;
fluid_event_callback_t callback;
void* data;
@@ -77,7 +77,7 @@ typedef struct _fluid_sequencer_client_t {
static short _fluid_seq_queue_init(fluid_sequencer_t* seq, int nbEvents);
static void _fluid_seq_queue_end(fluid_sequencer_t* seq);
static short _fluid_seq_queue_pre_insert(fluid_sequencer_t* seq, fluid_event_t * evt);
-static void _fluid_seq_queue_pre_remove(fluid_sequencer_t* seq, short src, short dest, int type);
+static void _fluid_seq_queue_pre_remove(fluid_sequencer_t* seq, fluid_seq_id_t src, fluid_seq_id_t dest, int type);
static int _fluid_seq_queue_process(void* data, unsigned int msec); // callback from timer
static void _fluid_seq_queue_insert_entry(fluid_sequencer_t* seq, fluid_evt_entry * evtentry);
static void _fluid_seq_queue_remove_entries_matching(fluid_sequencer_t* seq, fluid_evt_entry* temp);
@@ -265,7 +265,7 @@ void fluid_seq_dotrace(fluid_sequencer_t* seq, char *fmt, ...) {}
* Clients can be sources or destinations of events. Sources don't need to
* register a callback.
*/
-short
+fluid_seq_id_t
fluid_sequencer_register_client (fluid_sequencer_t* seq, const char *name,
fluid_event_callback_t callback, void* data)
{
@@ -303,7 +303,7 @@ fluid_sequencer_register_client (fluid_sequencer_t* seq, const char *name,
* @param id Client ID as returned by fluid_sequencer_register_client().
*/
void
-fluid_sequencer_unregister_client (fluid_sequencer_t* seq, short id)
+fluid_sequencer_unregister_client (fluid_sequencer_t* seq, fluid_seq_id_t id)
{
fluid_list_t *tmp;
fluid_event_t* evt;
@@ -358,7 +358,7 @@ fluid_sequencer_count_clients(fluid_sequencer_t* seq)
* @param index Index of register client
* @return Client ID or #FLUID_FAILED if not found
*/
-short fluid_sequencer_get_client_id (fluid_sequencer_t* seq, int index)
+fluid_seq_id_t fluid_sequencer_get_client_id (fluid_sequencer_t* seq, int index)
{
fluid_list_t *tmp = fluid_list_nth(seq->clients, index);
if (tmp == NULL) {
@@ -430,7 +430,7 @@ fluid_sequencer_client_is_dest(fluid_sequencer_t* seq, int id)
void
fluid_sequencer_send_now(fluid_sequencer_t* seq, fluid_event_t* evt)
{
- short destID = fluid_event_get_dest(evt);
+ fluid_seq_id_t destID = fluid_event_get_dest(evt);
/* find callback */
fluid_list_t *tmp = seq->clients;
@@ -481,8 +481,8 @@ fluid_sequencer_send_at (fluid_sequencer_t* seq, fluid_event_t* evt,
* @param type Event type to match or -1 for wildcard (#fluid_seq_event_type)
*/
void
-fluid_sequencer_remove_events (fluid_sequencer_t* seq, short source,
- short dest, int type)
+fluid_sequencer_remove_events (fluid_sequencer_t* seq, fluid_seq_id_t source,
+ fluid_seq_id_t dest, int type)
{
_fluid_seq_queue_pre_remove(seq, source, dest, type);
}
@@ -750,7 +750,7 @@ _fluid_seq_queue_pre_insert(fluid_sequencer_t* seq, fluid_event_t * evt)
* May be called from the main thread (usually) but also recursively
* from the queue thread, when a callback itself does an insert... */
static void
-_fluid_seq_queue_pre_remove(fluid_sequencer_t* seq, short src, short dest, int type)
+_fluid_seq_queue_pre_remove(fluid_sequencer_t* seq, fluid_seq_id_t src, fluid_seq_id_t dest, int type)
{
fluid_evt_entry * evtentry = _fluid_seq_heap_get_free(seq->heap);
if (evtentry == NULL) {
@@ -982,7 +982,7 @@ _fluid_seq_queue_insert_entry(fluid_sequencer_t* seq, fluid_evt_entry * evtentry
}
static int
-_fluid_seq_queue_matchevent(fluid_event_t* evt, int templType, short templSrc, short templDest)
+_fluid_seq_queue_matchevent(fluid_event_t* evt, int templType, fluid_seq_id_t templSrc, fluid_seq_id_t templDest)
{
int eventType;
@@ -1019,7 +1019,7 @@ _fluid_seq_queue_remove_entries_matching(fluid_sequencer_t* seq, fluid_evt_entry
{
/* we walk everything : this is slow, but that is life */
int i, type;
- short src, dest;
+ fluid_seq_id_t src, dest;
src = templ->evt.src;
dest = templ->evt.dest;
diff --git a/src/midi/fluid_seqbind.c b/src/midi/fluid_seqbind.c
index 4cead70..5204313 100644
--- a/src/midi/fluid_seqbind.c
+++ b/src/midi/fluid_seqbind.c
@@ -41,7 +41,7 @@ struct _fluid_seqbind_t {
fluid_synth_t* synth;
fluid_sequencer_t* seq;
fluid_sample_timer_t* sample_timer;
- short client_id;
+ fluid_seq_id_t client_id;
};
typedef struct _fluid_seqbind_t fluid_seqbind_t;
@@ -77,7 +77,7 @@ delete_fluid_seqbind(fluid_seqbind_t* seqbind)
* @param synth Synthesizer instance
* @returns Sequencer client ID, or #FLUID_FAILED on error.
*/
-short
+fluid_seq_id_t
fluid_sequencer_register_fluidsynth (fluid_sequencer_t* seq, fluid_synth_t* synth)
{
fluid_seqbind_t* seqbind;
@@ -153,7 +153,7 @@ fluid_seq_fluidsynth_callback(unsigned int time, fluid_event_t* evt, fluid_seque
break;
case FLUID_SEQ_ALLSOUNDSOFF:
- /* NYI */
+ fluid_synth_all_sounds_off(synth, fluid_event_get_channel(evt));
break;
case FLUID_SEQ_ALLNOTESOFF:
@@ -259,9 +259,10 @@ fluid_seq_fluidsynth_callback(unsigned int time, fluid_event_t* evt, fluid_seque
}
}
-static int get_fluidsynth_dest(fluid_sequencer_t* seq)
+static fluid_seq_id_t get_fluidsynth_dest(fluid_sequencer_t* seq)
{
- int i, id;
+ int i;
+ fluid_seq_id_t id;
char* name;
int j = fluid_sequencer_count_clients(seq);
for (i = 0; i < j; i++) {
@@ -295,24 +296,24 @@ fluid_sequencer_add_midi_event_to_buffer(void* data, fluid_midi_event_t* event)
switch (fluid_midi_event_get_type(event)) {
case NOTE_OFF:
- fluid_event_noteoff(&evt, chan, fluid_midi_event_get_key(event));
+ fluid_event_noteoff(&evt, chan, (short)fluid_midi_event_get_key(event));
break;
case NOTE_ON:
fluid_event_noteon(&evt, fluid_midi_event_get_channel(event),
- fluid_midi_event_get_key(event), fluid_midi_event_get_velocity(event));
+ (short)fluid_midi_event_get_key(event), (short)fluid_midi_event_get_velocity(event));
break;
case CONTROL_CHANGE:
- fluid_event_control_change(&evt, chan, fluid_midi_event_get_control(event),
- fluid_midi_event_get_value(event));
+ fluid_event_control_change(&evt, chan, (short)fluid_midi_event_get_control(event),
+ (short)fluid_midi_event_get_value(event));
break;
case PROGRAM_CHANGE:
- fluid_event_program_change(&evt, chan, fluid_midi_event_get_program(event));
+ fluid_event_program_change(&evt, chan, (short)fluid_midi_event_get_program(event));
break;
case PITCH_BEND:
fluid_event_pitch_bend(&evt, chan, fluid_midi_event_get_pitch(event));
break;
case CHANNEL_PRESSURE:
- fluid_event_channel_pressure(&evt, chan, fluid_midi_event_get_program(event));
+ fluid_event_channel_pressure(&evt, chan, (short)fluid_midi_event_get_program(event));
break;
case MIDI_SYSTEM_RESET:
fluid_event_system_reset(&evt);
diff --git a/src/rvoice/fluid_rvoice.h b/src/rvoice/fluid_rvoice.h
index 44cd97d..2b6cba0 100644
--- a/src/rvoice/fluid_rvoice.h
+++ b/src/rvoice/fluid_rvoice.h
@@ -48,7 +48,7 @@ enum fluid_loop {
FLUID_LOOP_UNTIL_RELEASE = 3
};
-/**
+/*
* rvoice ticks-based parameters
* These parameters must be updated even if the voice is currently quiet.
*/
@@ -77,7 +77,7 @@ struct _fluid_rvoice_envlfo_t
fluid_real_t viblfo_to_pitch;
};
-/**
+/*
* rvoice parameters needed for dsp interpolation
*/
struct _fluid_rvoice_dsp_t
@@ -129,7 +129,7 @@ struct _fluid_rvoice_dsp_t
ever add surround positioning, or stereo reverb/chorus */
#define FLUID_RVOICE_MAX_BUFS (4)
-/**
+/*
* rvoice mixer-related parameters
*/
struct _fluid_rvoice_buffers_t
@@ -142,7 +142,7 @@ struct _fluid_rvoice_buffers_t
};
-/**
+/*
* Hard real-time parameters needed to synthesize a voice
*/
struct _fluid_rvoice_t
diff --git a/src/rvoice/fluid_rvoice_event.h b/src/rvoice/fluid_rvoice_event.h
index c2bb669..94ba58b 100644
--- a/src/rvoice/fluid_rvoice_event.h
+++ b/src/rvoice/fluid_rvoice_event.h
@@ -42,7 +42,7 @@ struct _fluid_rvoice_event_t {
void fluid_rvoice_event_dispatch(fluid_rvoice_event_t* event);
-/**
+/*
* Bridge between the renderer thread and the midi state thread.
* If is_threadsafe is true, that means fluid_rvoice_eventhandler_fetch_all
* can be called in parallell with fluid_rvoice_eventhandler_push/flush
diff --git a/src/rvoice/fluid_rvoice_mixer.c b/src/rvoice/fluid_rvoice_mixer.c
index e1cc549..9dcb162 100644
--- a/src/rvoice/fluid_rvoice_mixer.c
+++ b/src/rvoice/fluid_rvoice_mixer.c
@@ -545,7 +545,7 @@ new_fluid_rvoice_mixer(int buf_count, int fx_buf_count, fluid_real_t sample_rate
/* allocate the reverb module */
mixer->fx.reverb = new_fluid_revmodel(sample_rate);
mixer->fx.chorus = new_fluid_chorus(sample_rate);
- if (mixer->fx.reverb == NULL) {
+ if (mixer->fx.reverb == NULL || mixer->fx.chorus == NULL) {
FLUID_LOG(FLUID_ERR, "Out of memory");
delete_fluid_rvoice_mixer(mixer);
return NULL;
diff --git a/src/sfloader/fluid_defsfont.c b/src/sfloader/fluid_defsfont.c
index cb08d0b..160479e 100644
--- a/src/sfloader/fluid_defsfont.c
+++ b/src/sfloader/fluid_defsfont.c
@@ -1987,6 +1987,8 @@ fluid_sample_import_sfont(fluid_sample_t* sample, SFSample* sfsample, fluid_defs
{
FLUID_LOG (FLUID_WARN, _("Vorbis sample '%s' has invalid loop points"), sample->name);
}
+#else
+ return FLUID_FAILED;
#endif
}
diff --git a/src/synth/fluid_event.c b/src/synth/fluid_event.c
index 3b27cb7..0af29e9 100644
--- a/src/synth/fluid_event.c
+++ b/src/synth/fluid_event.c
@@ -96,23 +96,23 @@ fluid_event_set_time(fluid_event_t* evt, unsigned int time)
}
/**
- * Set source of a sequencer event (DOCME).
+ * Set source of a sequencer event. \c src must be a unique sequencer ID or -1 if not set.
* @param evt Sequencer event structure
- * @param src DOCME
+ * @param src Unique sequencer ID
*/
void
-fluid_event_set_source(fluid_event_t* evt, short src)
+fluid_event_set_source(fluid_event_t* evt, fluid_seq_id_t src)
{
evt->src = src;
}
/**
- * Set destination of a sequencer event (DOCME).
+ * Set destination of this sequencer event, i.e. the sequencer client this event will be sent to. \c dest must be a unique sequencer ID.
* @param evt Sequencer event structure
- * @param dest DOCME
+ * @param dest The destination unique sequencer ID
*/
void
-fluid_event_set_dest(fluid_event_t* evt, short dest)
+fluid_event_set_dest(fluid_event_t* evt, fluid_seq_id_t dest)
{
evt->dest = dest;
}
@@ -120,7 +120,7 @@ fluid_event_set_dest(fluid_event_t* evt, short dest)
/**
* Set a sequencer event to be a timer event.
* @param evt Sequencer event structure
- * @param data DOCME
+ * @param data User supplied data pointer
*/
void
fluid_event_timer(fluid_event_t* evt, void* data)
@@ -165,7 +165,7 @@ fluid_event_noteoff(fluid_event_t* evt, int channel, short key)
* @param channel MIDI channel number
* @param key MIDI note number (0-127)
* @param vel MIDI velocity value (0-127)
- * @param duration Duration of note (DOCME units?)
+ * @param duration Duration of note in the time scale used by the sequencer (by default milliseconds)
*/
void
fluid_event_note(fluid_event_t* evt, int channel, short key, short vel, unsigned int duration)
@@ -249,10 +249,9 @@ fluid_event_program_select(fluid_event_t* evt, int channel,
}
/**
- * Set a sequencer event to be an any control change event.
+ * Set a sequencer event to be an any control change event (for internal use).
* @param evt Sequencer event structure
* @param channel MIDI channel number
- * DOCME
*/
void
fluid_event_any_control_change(fluid_event_t* evt, int channel)
@@ -281,7 +280,7 @@ fluid_event_pitch_bend(fluid_event_t* evt, int channel, int pitch)
* Set a sequencer event to be a pitch wheel sensitivity event.
* @param evt Sequencer event structure
* @param channel MIDI channel number
- * @param value MIDI pitch wheel sensitivity value (DOCME units?)
+ * @param value MIDI pitch wheel sensitivity value in semitones
*/
void
fluid_event_pitch_wheelsens(fluid_event_t* evt, int channel, short value)
@@ -328,7 +327,7 @@ fluid_event_sustain(fluid_event_t* evt, int channel, short val)
* @param evt Sequencer event structure
* @param channel MIDI channel number
* @param control MIDI control number (0-127)
- * @param val MIDI control value (0-16383 DOCME is that true?)
+ * @param val MIDI control value (0-127)
*/
void
fluid_event_control_change(fluid_event_t* evt, int channel, short control, short val)
@@ -460,9 +459,10 @@ int fluid_event_get_type(fluid_event_t* evt)
}
/**
+ * @internal
* Get the time field from a sequencer event structure.
* @param evt Sequencer event structure
- * @return Time value (DOCME units?)
+ * @return Time value
*/
unsigned int fluid_event_get_time(fluid_event_t* evt)
{
@@ -470,21 +470,21 @@ unsigned int fluid_event_get_time(fluid_event_t* evt)
}
/**
- * Get the source field from a sequencer event structure.
+ * Get the source sequencer client from a sequencer event structure.
* @param evt Sequencer event structure
- * @return DOCME
+ * @return source field of the sequencer event
*/
-short fluid_event_get_source(fluid_event_t* evt)
+fluid_seq_id_t fluid_event_get_source(fluid_event_t* evt)
{
return evt->src;
}
/**
- * Get the dest field from a sequencer event structure.
+ * Get the dest sequencer client from a sequencer event structure.
* @param evt Sequencer event structure
- * @return DOCME
+ * @return dest field of the sequencer event
*/
-short fluid_event_get_dest(fluid_event_t* evt)
+fluid_seq_id_t fluid_event_get_dest(fluid_event_t* evt)
{
return evt->dest;
}
@@ -492,7 +492,7 @@ short fluid_event_get_dest(fluid_event_t* evt)
/**
* Get the MIDI channel field from a sequencer event structure.
* @param evt Sequencer event structure
- * @return MIDI channel number (DOCME 0-15 or more?)
+ * @return MIDI zero-based channel number
*/
int fluid_event_get_channel(fluid_event_t* evt)
{
@@ -561,7 +561,7 @@ void* fluid_event_get_data(fluid_event_t* evt)
/**
* Get the duration field from a sequencer event structure.
* @param evt Sequencer event structure
- * @return Note duration value (DOCME units?)
+ * @return Note duration value in the time scale used by the sequencer (by default milliseconds)
*
* Used by the #FLUID_SEQ_NOTE event type.
*/
diff --git a/src/synth/fluid_event_priv.h b/src/synth/fluid_event_priv.h
index f1fbb91..87a0d75 100644
--- a/src/synth/fluid_event_priv.h
+++ b/src/synth/fluid_event_priv.h
@@ -30,8 +30,8 @@
struct _fluid_event_t {
unsigned int time;
int type;
- short src;
- short dest;
+ fluid_seq_id_t src;
+ fluid_seq_id_t dest;
int channel;
short key;
short vel;
diff --git a/src/synth/fluid_gen.c b/src/synth/fluid_gen.c
index 996e2f3..afabc38 100644
--- a/src/synth/fluid_gen.c
+++ b/src/synth/fluid_gen.c
@@ -92,7 +92,8 @@ fluid_gen_info_t fluid_gen_info[] = {
/**
* Set an array of generators to their default values.
* @param gen Array of generators (should be #GEN_LAST in size).
- * @return Always returns 0
+ * @return Always returns #FLUID_OK
+ * @deprecated Will be removed from the public API in a future release, because there is no current usecase for it.
*/
int
fluid_gen_set_default_values(fluid_gen_t* gen)
diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c
index c44baf8..c44d462 100644
--- a/src/synth/fluid_synth.c
+++ b/src/synth/fluid_synth.c
@@ -2017,6 +2017,11 @@ fluid_synth_program_change(fluid_synth_t* synth, int chan, int prognum)
* @param chan MIDI channel number (0 to MIDI channel count - 1)
* @param bank MIDI bank number
* @return FLUID_OK on success, FLUID_FAILED otherwise
+ * @note This function does not change the instrument currently assigned to \c chan,
+ * as it is usually called prior to fluid_synth_program_change(). If you still want
+ * instrument changes to take effect immediately, call fluid_synth_program_reset()
+ * after having set up the bank configuration.
+ *
*/
int
fluid_synth_bank_select(fluid_synth_t* synth, int chan, unsigned int bank)
@@ -2034,6 +2039,10 @@ fluid_synth_bank_select(fluid_synth_t* synth, int chan, unsigned int bank)
* @param chan MIDI channel number (0 to MIDI channel count - 1)
* @param sfont_id ID of a loaded SoundFont
* @return FLUID_OK on success, FLUID_FAILED otherwise
+ * @note This function does not change the instrument currently assigned to \c chan,
+ * as it is usually called prior to fluid_synth_bank_select() or fluid_synth_program_change().
+ * If you still want instrument changes to take effect immediately, call fluid_synth_program_reset()
+ * after having selected the soundfont.
*/
int
fluid_synth_sfont_select(fluid_synth_t* synth, int chan, unsigned int sfont_id)
@@ -2408,7 +2417,7 @@ fluid_synth_get_internal_bufsize(fluid_synth_t* synth)
}
/**
- * Resend a bank select and a program change for every channel.
+ * Resend a bank select and a program change for every channel and assign corresponding instruments.
* @param synth FluidSynth instance
* @return FLUID_OK on success, FLUID_FAILED otherwise
*
@@ -2419,6 +2428,7 @@ int
fluid_synth_program_reset(fluid_synth_t* synth)
{
int i, prog;
+ fluid_return_val_if_fail (synth != NULL, FLUID_FAILED);
fluid_synth_api_enter(synth);
/* try to set the correct presets */
for (i = 0; i < synth->midi_channels; i++){
@@ -2574,10 +2584,10 @@ fluid_synth_nwrite_float(fluid_synth_t* synth, int len,
{
#ifdef WITH_FLOAT
if(fx_left != NULL)
- FLUID_MEMCPY(fx_left[i + count], fx_left_in[i], bytes);
+ FLUID_MEMCPY(fx_left[i] + count, fx_left_in[i], bytes);
if(fx_right != NULL)
- FLUID_MEMCPY(fx_right[i + count], fx_right_in[i], bytes);
+ FLUID_MEMCPY(fx_right[i] + count, fx_right_in[i], bytes);
#else //WITH_FLOAT
int j;
if(fx_left != NULL) {
@@ -3191,10 +3201,10 @@ fluid_synth_start_voice(fluid_synth_t* synth, fluid_voice_t* voice)
}
/**
- * Add a SoundFont loader interface.
+ * Add a SoundFont loader to the synth. This function takes ownership of \c loader
+ * and frees it automatically upon \c synth destruction.
* @param synth FluidSynth instance
- * @param loader Loader API structure, used directly and should remain allocated
- * as long as the synth instance is used.
+ * @param loader Loader API structure
*
* SoundFont loaders are used to add custom instrument loading to FluidSynth.
* The caller supplied functions for loading files, allocating presets,
@@ -3224,9 +3234,9 @@ fluid_synth_add_sfloader(fluid_synth_t* synth, fluid_sfloader_t* loader)
* stack. Presets are searched starting from the SoundFont on the
* top of the stack, working the way down the stack until a preset is found.
*
- * @param synth SoundFont instance
+ * @param synth FluidSynth instance
* @param filename File to load
- * @param reset_presets TRUE to re-assign presets for all MIDI channels
+ * @param reset_presets TRUE to re-assign presets for all MIDI channels (equivalent to calling fluid_synth_program_reset())
* @return SoundFont ID on success, FLUID_FAILED on error
*/
int
@@ -3297,7 +3307,7 @@ new_fluid_sfont_info (fluid_synth_t *synth, fluid_sfont_t *sfont)
/**
* Unload a SoundFont.
- * @param synth SoundFont instance
+ * @param synth FluidSynth instance
* @param id ID of SoundFont to unload
* @param reset_presets TRUE to re-assign presets for all MIDI channels
* @return FLUID_OK on success, FLUID_FAILED on error
@@ -3386,7 +3396,7 @@ fluid_synth_sfunload_callback(void* data, unsigned int msec)
/**
* Reload a SoundFont. The SoundFont retains its ID and index on the SoundFont stack.
- * @param synth SoundFont instance
+ * @param synth FluidSynth instance
* @param id ID of SoundFont to reload
* @return SoundFont ID on success, FLUID_FAILED on error
*/
@@ -3619,11 +3629,10 @@ fluid_synth_get_sfont_by_name(fluid_synth_t* synth, const char *name)
* Get active preset on a MIDI channel.
* @param synth FluidSynth instance
* @param chan MIDI channel number (0 to MIDI channel count - 1)
- * @return Preset or NULL if no preset active on channel
- * @deprecated fluid_synth_get_channel_info() should replace most use cases.
+ * @return Preset or NULL if no preset active on \c chan
*
* @note Should only be called from within synthesis thread, which includes
- * SoundFont loader preset noteon methods. Not thread safe otherwise.
+ * SoundFont loader preset noteon methods. Not thread safe otherwise.
*/
fluid_preset_t *
fluid_synth_get_channel_preset(fluid_synth_t* synth, int chan)
@@ -3644,6 +3653,8 @@ fluid_synth_get_channel_preset(fluid_synth_t* synth, int chan)
* @param chan MIDI channel number (0 to MIDI channel count - 1)
* @param info Caller supplied structure to fill with preset information
* @return #FLUID_OK on success, #FLUID_FAILED otherwise
+ * @deprecated Provides redundant functionality that can be achieved with
+ * fluid_synth_get_channel_preset() or fluid_synth_get_program().
* @since 1.1.1
*/
int
@@ -4308,12 +4319,14 @@ fluid_synth_update_voice_tuning_LOCAL (fluid_synth_t *synth, fluid_channel_t *ch
* @param name Label name for this tuning
* @param pitch Array of pitch values (length of 128, each value is number of
* cents, for example normally note 0 is 0.0, 1 is 100.0, 60 is 6000.0, etc).
- * Pass NULL to create a well-tempered (normal) scale.
+ * Pass NULL to create a equal tempered (normal) scale.
* @return FLUID_OK on success, FLUID_FAILED otherwise
*
* @note Tuning is not applied in realtime to existing notes of the replaced
* tuning (if any), use fluid_synth_activate_key_tuning() instead to specify
* this behavior.
+ *
+ * @deprecated Use fluid_synth_activate_key_tuning(synth, bank, prog, name, pitch, FALSE) instead.
*/
int
fluid_synth_create_key_tuning(fluid_synth_t* synth, int bank, int prog,
@@ -4330,7 +4343,7 @@ fluid_synth_create_key_tuning(fluid_synth_t* synth, int bank, int prog,
* @param name Label name for this tuning
* @param pitch Array of pitch values (length of 128, each value is number of
* cents, for example normally note 0 is 0.0, 1 is 100.0, 60 is 6000.0, etc).
- * Pass NULL to create a well-tempered (normal) scale.
+ * Pass NULL to create a equal tempered (normal) scale.
* @param apply TRUE to apply new tuning in realtime to existing notes which
* are using the replaced tuning (if any), FALSE otherwise
* @return FLUID_OK on success, FLUID_FAILED otherwise
@@ -4376,6 +4389,8 @@ fluid_synth_activate_key_tuning(fluid_synth_t* synth, int bank, int prog,
* @note Tuning is not applied in realtime to existing notes of the replaced
* tuning (if any), use fluid_synth_activate_octave_tuning() instead to specify
* this behavior.
+ *
+ * @deprecated Use fluid_synth_activate_octave_tuning(synth, bank, prog, name, pitch, FALSE) instead.
*/
int
fluid_synth_create_octave_tuning(fluid_synth_t* synth, int bank, int prog,
@@ -4439,7 +4454,7 @@ fluid_synth_activate_octave_tuning(fluid_synth_t* synth, int bank, int prog,
* @return FLUID_OK on success, FLUID_FAILED otherwise
*
* @note Prior to version 1.1.0 it was an error to specify a tuning that didn't
- * already exist. Starting with 1.1.0, the default equal tempered scale will be
+ * already exist. Starting with 1.1.0, the default equal tempered scale will be
* used as a basis, if no tuning exists for the given bank and prog.
*/
int
@@ -4491,8 +4506,10 @@ fluid_synth_tune_notes(fluid_synth_t* synth, int bank, int prog,
* should cause existing notes to update.
*
* @note Prior to version 1.1.0 it was an error to select a tuning that didn't
- * already exist. Starting with 1.1.0, a default equal tempered scale will be
+ * already exist. Starting with 1.1.0, a default equal tempered scale will be
* created, if no tuning exists for the given bank and prog.
+ *
+ * @deprecated Use fluid_synth_activate_tuning(synth, chan, bank, prog, FALSE) instead.
*/
int
fluid_synth_select_tuning(fluid_synth_t* synth, int chan, int bank, int prog)
@@ -4576,7 +4593,7 @@ fluid_synth_set_tuning_LOCAL (fluid_synth_t *synth, int chan,
}
/**
- * Clear tuning scale on a MIDI channel (set it to the default well-tempered scale).
+ * Clear tuning scale on a MIDI channel (set it to the default equal tempered scale).
* @param synth FluidSynth instance
* @param chan MIDI channel number (0 to MIDI channel count - 1)
* @return FLUID_OK on success, FLUID_FAILED otherwise
@@ -4584,6 +4601,8 @@ fluid_synth_set_tuning_LOCAL (fluid_synth_t *synth, int chan,
* @note This function does NOT activate tuning change in realtime, use
* fluid_synth_deactivate_tuning() instead to specify whether tuning change
* should cause existing notes to update.
+ *
+ * @deprecated Use fluid_synth_deactivate_tuning(synth, chan, FALSE) instead.
*/
int
fluid_synth_reset_tuning(fluid_synth_t* synth, int chan)
@@ -4731,6 +4750,7 @@ fluid_synth_get_settings(fluid_synth_t* synth)
* @param name Name of setting parameter
* @param str Value to assign to the setting
* @return FLUID_OK on success, FLUID_FAILED otherwise
+ * @deprecated Use fluid_settings_setstr() in combination with fluid_synth_get_settings() instead.
*/
int
fluid_synth_setstr(fluid_synth_t* synth, const char* name, const char* str)
@@ -4747,6 +4767,7 @@ fluid_synth_setstr(fluid_synth_t* synth, const char* name, const char* str)
* @param name Name of setting parameter
* @param str Location to store a pointer to the newly allocated string value
* @return FLUID_OK on success, FLUID_FAILED otherwise
+ * @deprecated Use fluid_settings_dupstr() in combination with fluid_synth_get_settings() instead.
*
* The returned string is owned by the caller and should be freed with free()
* when finished with it.
@@ -4767,6 +4788,7 @@ fluid_synth_dupstr(fluid_synth_t* synth, const char* name, char** str)
* @param name Name of setting parameter
* @param val Value to assign to the setting
* @return FLUID_OK on success, FLUID_FAILED otherwise
+ * @deprecated Use fluid_settings_setnum() in combination with fluid_synth_get_settings() instead.
*/
int
fluid_synth_setnum(fluid_synth_t* synth, const char* name, double val)
@@ -4783,6 +4805,7 @@ fluid_synth_setnum(fluid_synth_t* synth, const char* name, double val)
* @param name Name of setting parameter
* @param val Location to store the current value of the setting
* @return FLUID_OK on success, FLUID_FAILED otherwise
+ * @deprecated Use fluid_settings_getnum() in combination with fluid_synth_get_settings() instead.
*/
int
fluid_synth_getnum(fluid_synth_t* synth, const char* name, double* val)
@@ -4799,6 +4822,7 @@ fluid_synth_getnum(fluid_synth_t* synth, const char* name, double* val)
* @param name Name of setting parameter
* @param val Value to assign to the setting
* @return FLUID_OK on success, FLUID_FAILED otherwise
+ * @deprecated Use fluid_settings_setint() in combination with fluid_synth_get_settings() instead.
*/
int
fluid_synth_setint(fluid_synth_t* synth, const char* name, int val)
@@ -4815,6 +4839,7 @@ fluid_synth_setint(fluid_synth_t* synth, const char* name, int val)
* @param name Name of setting parameter
* @param val Location to store the current value of the setting
* @return FLUID_OK on success, FLUID_FAILED otherwise
+ * @deprecated Use fluid_settings_getint() in combination with fluid_synth_get_settings() instead.
*/
int
fluid_synth_getint(fluid_synth_t* synth, const char* name, int* val)
@@ -4877,6 +4902,9 @@ fluid_synth_set_gen_LOCAL (fluid_synth_t* synth, int chan, int param, float valu
* generator effect range (scaled and shifted as necessary).
* @return FLUID_OK on success, FLUID_FAILED otherwise
* @since 1.1.0
+ *
+ * @deprecated As of 1.1.9 this function is deprecated, because there doesn't seem
+ * to be a use-case for it.
*
* This function allows for setting all effect parameters in real time on a
* MIDI channel. Setting absolute to non-zero will cause the value to override
@@ -4923,6 +4951,7 @@ fluid_synth_get_gen(fluid_synth_t* synth, int chan, int param)
* @param router MIDI router to assign to the synth
*
* @note This should only be done once and prior to using the synth.
+ * @deprecated This function is only used by shell command handler, which will be refactored in a future release.
*/
void
fluid_synth_set_midi_router(fluid_synth_t* synth, fluid_midi_router_t* router)
@@ -5043,7 +5072,9 @@ fluid_synth_stop_LOCAL (fluid_synth_t *synth, unsigned int id)
}
/**
- * Offset the bank numbers of a loaded SoundFont.
+ * Offset the bank numbers of a loaded SoundFont, i.e.\ subtract
+ * \c offset from any bank number when assigning instruments.
+ *
* @param synth FluidSynth instance
* @param sfont_id ID of a loaded SoundFont
* @param offset Bank offset value to apply to all instruments
@@ -5141,7 +5172,7 @@ void fluid_synth_api_exit(fluid_synth_t* synth)
* Set midi channel type
* @param synth FluidSynth instance
* @param chan MIDI channel number (0 to MIDI channel count - 1)
- * @param type CHANNEL_TYPE_MELODIC, or CHANNEL_TYPE_DRUM
+ * @param type MIDI channel type (#fluid_midi_channel_type)
* @return FLUID_OK on success, FLUID_FAILED otherwise
* @since 1.1.4
*/
diff --git a/src/synth/fluid_synth.h b/src/synth/fluid_synth.h
index 4bcc361..952b957 100644
--- a/src/synth/fluid_synth.h
+++ b/src/synth/fluid_synth.h
@@ -78,7 +78,7 @@ enum fluid_synth_status
#define SYNTH_REVERB_CHANNEL 0
#define SYNTH_CHORUS_CHANNEL 1
-/**
+/*
* Structure used for sfont_info field in #fluid_synth_t for each loaded
* SoundFont with the SoundFont instance and additional fields.
*/
diff --git a/src/synth/fluid_voice.c b/src/synth/fluid_voice.c
index 625b376..bb572ad 100644
--- a/src/synth/fluid_voice.c
+++ b/src/synth/fluid_voice.c
@@ -1445,7 +1445,7 @@ int fluid_voice_is_on(const fluid_voice_t* voice)
}
/**
- * Check if a voice is sustained.
+ * Check if a voice keeps playing after it has received a noteoff due to being held by sustain.
* @param voice Voice instance
* @return TRUE if sustained, FALSE otherwise
* @since 1.1.7
@@ -1456,7 +1456,7 @@ int fluid_voice_is_sustained(const fluid_voice_t* voice)
}
/**
- * Check if a voice is held by sostenuto.
+ * Check if a voice keeps playing after it has received a noteoff due to being held by sostenuto.
* @param voice Voice instance
* @return TRUE if sostenuto, FALSE otherwise
* @since 1.1.7
diff --git a/src/utils/fluid_ringbuffer.h b/src/utils/fluid_ringbuffer.h
index 417807e..1c82971 100644
--- a/src/utils/fluid_ringbuffer.h
+++ b/src/utils/fluid_ringbuffer.h
@@ -23,7 +23,7 @@
#include "fluid_sys.h"
-/**
+/*
* Lockless event queue instance.
*/
struct _fluid_ringbuffer_t
diff --git a/src/utils/fluid_sys.c b/src/utils/fluid_sys.c
index f55fa1f..7fb6dbe 100644
--- a/src/utils/fluid_sys.c
+++ b/src/utils/fluid_sys.c
@@ -753,7 +753,15 @@ new_fluid_timer (int msec, fluid_timer_callback_t callback, void* data,
return NULL;
}
}
- else fluid_timer_run (timer); /* Run directly, instead of as a separate thread */
+ else
+ {
+ fluid_timer_run (timer); /* Run directly, instead of as a separate thread */
+ if(auto_destroy)
+ {
+ /* do NOT return freed memory */
+ return NULL;
+ }
+ }
return timer;
}
@@ -1299,8 +1307,10 @@ int delete_fluid_server_socket(fluid_server_socket_t *server_socket)
if (server_socket->socket != INVALID_SOCKET)
fluid_socket_close (server_socket->socket);
- if (server_socket->thread)
+ if (server_socket->thread) {
+ fluid_thread_join(server_socket->thread);
delete_fluid_thread (server_socket->thread);
+ }
FLUID_FREE (server_socket);
diff --git a/src/utils/fluid_sys.h b/src/utils/fluid_sys.h
index 06ebcc5..b5034e9 100644
--- a/src/utils/fluid_sys.h
+++ b/src/utils/fluid_sys.h
@@ -265,7 +265,6 @@ typedef GStaticPrivate fluid_private_t;
/* Atomic operations */
#define fluid_atomic_int_inc(_pi) g_atomic_int_inc(_pi)
-#define fluid_atomic_int_add(_pi, _val) g_atomic_int_add(_pi, _val)
#define fluid_atomic_int_get(_pi) g_atomic_int_get(_pi)
#define fluid_atomic_int_set(_pi, _val) g_atomic_int_set(_pi, _val)
#define fluid_atomic_int_dec_and_test(_pi) g_atomic_int_dec_and_test(_pi)
@@ -275,9 +274,13 @@ typedef GStaticPrivate fluid_private_t;
#if GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 30)
#define fluid_atomic_int_exchange_and_add(_pi, _add) \
g_atomic_int_add(_pi, _add)
+#define fluid_atomic_int_add(_pi, _add) \
+ g_atomic_int_add(_pi, _add)
#else
#define fluid_atomic_int_exchange_and_add(_pi, _add) \
g_atomic_int_exchange_and_add(_pi, _add)
+#define fluid_atomic_int_add(_pi, _add) \
+ g_atomic_int_exchange_and_add(_pi, _add)
#endif
#define fluid_atomic_pointer_get(_pp) g_atomic_pointer_get(_pp)
diff --git a/src/utils/fluidsynth_priv.h b/src/utils/fluidsynth_priv.h
index 1e51b4f..3038799 100644
--- a/src/utils/fluidsynth_priv.h
+++ b/src/utils/fluidsynth_priv.h
@@ -122,8 +122,8 @@
#ifdef MINGW32
#include <stdint.h>
-#define snprintf _snprintf
-#define vsnprintf _vsnprintf
+#define snprintf g_snprintf
+#define vsnprintf g_vsnprintf
#define DSOUND_SUPPORT 1
#define WINMIDI_SUPPORT 1
--
fluidsynth packaging
More information about the pkg-multimedia-commits
mailing list