diff --git a/fluidsynth/CMakeLists.txt b/fluidsynth/CMakeLists.txt index 88daa46b..43ace788 100644 --- a/fluidsynth/CMakeLists.txt +++ b/fluidsynth/CMakeLists.txt @@ -1,4 +1,4 @@ -# FluidSynth - A Software Synthesize +# FluidSynth - A Software Synthesizer # # Copyright (C) 2003-2010 Peter Hanappe and others. # @@ -30,7 +30,7 @@ set ( PACKAGE "fluidsynth" ) set ( FLUIDSYNTH_VERSION_MAJOR 1 ) set ( FLUIDSYNTH_VERSION_MINOR 1 ) set ( FLUIDSYNTH_VERSION_MICRO 3 ) -set ( VERSION "${FLUIDSYNTH_VERSION_MAJOR}.${FLUIDSYNTH_VERSION_MINOR}.${FLUIDSYNTH_VERSION_MICRO}" ) +set ( VERSION "${FLUIDSYNTH_VERSION_MAJOR}.${FLUIDSYNTH_VERSION_MINOR}.${FLUIDSYNTH_VERSION_MICRO}" ) set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" ) # libfluidsynth - Library version @@ -45,7 +45,7 @@ set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" ) set ( LIB_VERSION_CURRENT 1 ) set ( LIB_VERSION_AGE 4 ) set ( LIB_VERSION_REVISION 1 ) -set ( LIB_VERSION_INFO +set ( LIB_VERSION_INFO "${LIB_VERSION_CURRENT}.${LIB_VERSION_AGE}.${LIB_VERSION_REVISION}" ) # Options disabled by default @@ -60,7 +60,7 @@ option ( enable-debug "enable debugging (default=no)" off ) # Options enabled by default option ( enable-libsndfile "compile libsndfile support (if it is available)" on ) option ( enable-aufile "compile support for sound file output" on ) -option ( enable-pulseaudio "compile PulseAudio support (if it is available)" on ) +option ( enable-pulseaudio "compile PulseAudio support (if it is available)" on ) option ( enable-jack "compile JACK support (if it is available)" on ) option ( enable-midishare "compile MidiShare support (if it is available)" on ) option ( enable-readline "compile readline lib line editing (if it is available)" on ) @@ -77,7 +77,7 @@ endif ( ${CMAKE_SYSTEM} MATCHES "Linux" ) 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 ) + option ( enable-framework "create a Mac OSX style FluidSynth.framework" on ) endif ( ${CMAKE_SYSTEM} MATCHES "Darwin" ) if ( ${CMAKE_SYSTEM} MATCHES "os2" ) @@ -90,7 +90,7 @@ if ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) else ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) set ( _init_lib_suffix "" ) endif ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) -set ( LIB_SUFFIX ${_init_lib_suffix} CACHE STRING +set ( LIB_SUFFIX ${_init_lib_suffix} CACHE STRING "library directory name suffix (32/64/nothing)" ) mark_as_advanced ( LIB_SUFFIX ) @@ -101,26 +101,26 @@ include ( DefaultDirs ) include ( CheckSTDC ) include ( CheckIncludeFile ) check_include_file ( string.h HAVE_STRING_H ) -check_include_file ( stdlib.h HAVE_STDLIB_H ) -check_include_file ( stdio.h HAVE_STDIO_H ) -check_include_file ( math.h HAVE_MATH_H ) -check_include_file ( errno.h HAVE_ERRNO_H ) -check_include_file ( stdarg.h HAVE_STDARG_H ) -check_include_file ( unistd.h HAVE_UNISTD_H ) +check_include_file ( stdlib.h HAVE_STDLIB_H ) +check_include_file ( stdio.h HAVE_STDIO_H ) +check_include_file ( math.h HAVE_MATH_H ) +check_include_file ( errno.h HAVE_ERRNO_H ) +check_include_file ( stdarg.h HAVE_STDARG_H ) +check_include_file ( unistd.h HAVE_UNISTD_H ) check_include_file ( memory.h HAVE_MEMORY_H ) -check_include_file ( sys/mman.h HAVE_SYS_MMAN_H ) -check_include_file ( sys/types.h HAVE_SYS_TYPES_H ) -check_include_file ( sys/time.h HAVE_SYS_TIME_H ) -check_include_file ( sys/stat.h HAVE_SYS_STAT_H ) +check_include_file ( sys/mman.h HAVE_SYS_MMAN_H ) +check_include_file ( sys/types.h HAVE_SYS_TYPES_H ) +check_include_file ( sys/time.h HAVE_SYS_TIME_H ) +check_include_file ( sys/stat.h HAVE_SYS_STAT_H ) check_include_file ( sys/ioctl.h HAVE_SYS_IOCTL_H ) -check_include_file ( fcntl.h HAVE_FCNTL_H ) -check_include_file ( sys/socket.h HAVE_SYS_SOCKET_H ) -check_include_file ( netinet/in.h HAVE_NETINET_IN_H ) -check_include_file ( netinet/tcp.h HAVE_NETINET_TCP_H ) -check_include_file ( arpa/inet.h HAVE_ARPA_INET_H ) +check_include_file ( fcntl.h HAVE_FCNTL_H ) +check_include_file ( sys/socket.h HAVE_SYS_SOCKET_H ) +check_include_file ( netinet/in.h HAVE_NETINET_IN_H ) +check_include_file ( netinet/tcp.h HAVE_NETINET_TCP_H ) +check_include_file ( arpa/inet.h HAVE_ARPA_INET_H ) check_include_file ( limits.h HAVE_LIMITS_H ) -check_include_file ( pthread.h HAVE_PTHREAD_H ) -check_include_file ( signal.h HAVE_SIGNAL_H ) +check_include_file ( pthread.h HAVE_PTHREAD_H ) +check_include_file ( signal.h HAVE_SIGNAL_H ) include ( TestInline ) include ( TestVLA ) include ( TestBigEndian ) @@ -134,9 +134,9 @@ unset ( FLUID_LIBS CACHE ) # Options for the GNU C compiler only if ( CMAKE_COMPILER_IS_GNUCC ) if ( NOT APPLE ) - set ( CMAKE_EXE_LINKER_FLAGS + set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed" ) - set ( CMAKE_SHARED_LINKER_FLAGS + set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) endif ( NOT APPLE ) set ( GNUCC_WARNING_FLAGS "-Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused-parameter -Wno-cast-qual") @@ -161,12 +161,12 @@ if ( WIN32 ) set ( FLUID_CPPFLAGS "-DFLUIDSYNTH_NOT_A_DLL" ) set ( CMAKE_DEBUG_POSTFIX "_debug" ) # MinGW compiler (a Windows GCC port) - if ( MINGW ) + if ( MINGW ) set ( MINGW32 1 ) add_definitions ( -mms-bitfields ) endif ( MINGW ) else ( WIN32 ) -# Check PThreads, but not in Windows +# Check PThreads, but not in Windows find_package ( Pthreads REQUIRED ) set ( HAVE_LIBPTHREAD ${PTHREADS_FOUND} ) set ( LIBFLUID_LIBS "m" ) @@ -174,7 +174,7 @@ endif ( WIN32 ) # IBM OS/2 unset ( DART_SUPPORT CACHE ) -unset ( DART_LIBS CACHE ) +unset ( DART_LIBS CACHE ) unset ( DART_INCLUDE_DIRS CACHE ) if ( ${CMAKE_SYSTEM} MATCHES "os2" ) set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Zbin-files" ) @@ -187,21 +187,21 @@ if ( ${CMAKE_SYSTEM} MATCHES "os2" ) endif ( ${CMAKE_SYSTEM} MATCHES "os2" ) # Solaris / SunOS -if ( ${CMAKE_SYSTEM} MATCHES "SunOS" ) - set ( FLUID_LIBS "${FLUID_LIBS};nsl;socket" ) - set ( LIBFLUID_LIBS "${LIBFLUID_LIBS};nsl;socket" ) +if ( ${CMAKE_SYSTEM} MATCHES "SunOS" ) + set ( FLUID_LIBS "${FLUID_LIBS};nsl;socket" ) + set ( LIBFLUID_LIBS "${LIBFLUID_LIBS};nsl;socket" ) endif ( ${CMAKE_SYSTEM} MATCHES "SunOS" ) # Apple Mac OSX unset ( COREAUDIO_SUPPORT CACHE ) -unset ( COREAUDIO_LIBS CACHE ) +unset ( COREAUDIO_LIBS CACHE ) unset ( COREMIDI_SUPPORT CACHE ) unset ( COREMIDI_LIBS CACHE ) -unset ( DARWIN CACHE ) +unset ( DARWIN CACHE ) unset ( MACOSX_FRAMEWORK CACHE ) if ( ${CMAKE_SYSTEM} MATCHES "Darwin" ) set ( DARWIN 1 ) - set ( CMAKE_INSTALL_NAME_DIR + set ( CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}${LIB_SUFFIX} ) if ( enable-coreaudio ) check_include_file ( CoreAudio/AudioHardware.h COREAUDIO_FOUND ) @@ -230,7 +230,7 @@ endif ( enable-floats ) unset ( WITH_PROFILING CACHE ) if ( enable-profiling ) set ( WITH_PROFILING 1 ) -endif ( enable-profiling ) +endif ( enable-profiling ) unset ( HAVE_LIBDL CACHE ) unset ( LADSPA_SUPPORT CACHE ) @@ -241,8 +241,8 @@ if ( enable-ladspa ) if ( CMAKE_DL_LIBS ) set ( HAVE_LIBDL 1 ) set ( LIBFLUID_LIBS "${LIBFLUID_LIBS};${CMAKE_DL_LIBS}" ) - endif ( CMAKE_DL_LIBS ) - endif ( LADSPA_SUPPORT ) + endif ( CMAKE_DL_LIBS ) + endif ( LADSPA_SUPPORT ) endif ( enable-ladspa ) unset ( ENABLE_TRAPONFPE CACHE ) @@ -253,13 +253,13 @@ if ( enable-trap-on-fpe AND NOT APPLE AND NOT WIN32 ) endif ( enable-trap-on-fpe AND NOT APPLE AND NOT WIN32 ) unset ( ENABLE_FPECHECK CACHE ) -unset ( FPE_CHECK CACHE ) +unset ( FPE_CHECK CACHE ) if ( enable-fpe-check ) set ( ENABLE_FPECHECK 1 ) set ( FPE_CHECK 1 ) endif ( enable-fpe-check ) - -if ( enable-debug ) + +if ( enable-debug ) set ( CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the build type, options: Debug Release RelWithDebInfo" FORCE ) endif ( enable-debug ) @@ -285,13 +285,13 @@ unset ( LIBSNDFILE_HASVORBIS CACHE ) if ( enable-libsndfile ) pkg_check_modules ( LIBSNDFILE sndfile>=1.0.0 ) set ( LIBSNDFILE_SUPPORT ${LIBSNDFILE_FOUND} ) - if ( LIBSNDFILE_SUPPORT ) + if ( LIBSNDFILE_SUPPORT ) pkg_check_modules ( LIBSNDFILE_VORBIS sndfile>=1.0.18 ) set ( LIBSNDFILE_HASVORBIS ${LIBSNDFILE_VORBIS_FOUND} ) endif ( LIBSNDFILE_SUPPORT ) else ( enable-libsndfile ) - unset_pkg_config ( LIBSNDFILE ) - unset_pkg_config ( LIBSNDFILE_VORBIS ) + unset_pkg_config ( LIBSNDFILE ) + unset_pkg_config ( LIBSNDFILE_VORBIS ) endif ( enable-libsndfile ) unset ( AUFILE_SUPPORT CACHE ) @@ -304,7 +304,7 @@ if ( enable-pulseaudio ) pkg_check_modules ( PULSE libpulse-simple>=0.9.8 ) set ( PULSE_SUPPORT ${PULSE_FOUND} ) else ( enable-pulseaudio ) - unset_pkg_config ( PULSE ) + unset_pkg_config ( PULSE ) endif ( enable-pulseaudio ) unset ( ALSA_SUPPORT CACHE ) @@ -312,7 +312,7 @@ if ( enable-alsa ) pkg_check_modules ( ALSA alsa>=0.9.1 ) set ( ALSA_SUPPORT ${ALSA_FOUND} ) else ( enable-alsa ) - unset_pkg_config ( ALSA ) + unset_pkg_config ( ALSA ) endif ( enable-alsa ) unset ( PORTAUDIO_SUPPORT CACHE ) @@ -320,7 +320,7 @@ if ( enable-portaudio ) pkg_check_modules ( PORTAUDIO portaudio-2.0>=19 ) set ( PORTAUDIO_SUPPORT ${PORTAUDIO_FOUND} ) else ( enable-portaudio ) - unset_pkg_config ( PORTAUDIO ) + unset_pkg_config ( PORTAUDIO ) endif ( enable-portaudio ) find_package ( OSS QUIET ) @@ -362,7 +362,7 @@ if ( enable-lash ) add_definitions ( -DHAVE_LASH ) endif ( LASH_FOUND ) else ( enable-lash ) - unset_pkg_config ( LASH ) + unset_pkg_config ( LASH ) remove_definitions( -DHAVE_LASH ) endif ( enable-lash ) @@ -371,7 +371,7 @@ if ( enable-ladcca ) pkg_check_modules ( LADCCA ladcca-1.0>=0.3 ) set ( LADCCA_SUPPORT ${LADCCA_FOUND} ) else ( enable-ladcca ) - unset_pkg_config ( LADCCA ) + unset_pkg_config ( LADCCA ) endif ( enable-ladcca ) unset ( DBUS_SUPPORT CACHE ) @@ -381,19 +381,19 @@ if ( enable-dbus ) else ( enable-dbus ) unset_pkg_config ( DBUS ) endif ( enable-dbus ) - + # General configuration file -configure_file ( ${CMAKE_SOURCE_DIR}/src/config.cmake +configure_file ( ${CMAKE_SOURCE_DIR}/src/config.cmake ${CMAKE_BINARY_DIR}/config.h ) add_definitions ( -DHAVE_CONFIG_H ) # Extra configuration file for MS VisualC compiler if ( MSVC ) - configure_file ( ${CMAKE_SOURCE_DIR}/src/config_win32.cmake + configure_file ( ${CMAKE_SOURCE_DIR}/src/config_win32.cmake ${CMAKE_BINARY_DIR}/config_win32.h ) endif ( MSVC ) -# Process subdirectories +# Process subdirectories add_subdirectory ( src ) add_subdirectory ( include ) add_subdirectory ( doc ) @@ -401,25 +401,25 @@ add_subdirectory ( doc ) # Extra targets for Unix build environments if ( UNIX ) # RPM spec - configure_file ( fluidsynth.spec.in - ${CMAKE_BINARY_DIR}/fluidsynth.spec IMMEDIATE @ONLY ) - + configure_file ( fluidsynth.spec.in + ${CMAKE_BINARY_DIR}/fluidsynth.spec IMMEDIATE @ONLY ) + # pkg-config support set ( prefix "${CMAKE_INSTALL_PREFIX}" ) set ( exec_prefix "\${prefix}" ) set ( libdir "\${exec_prefix}/${LIB_INSTALL_DIR}${LIB_SUFFIX}" ) set ( includedir "\${prefix}/${INCLUDE_INSTALL_DIR}" ) - configure_file ( fluidsynth.pc.in + configure_file ( fluidsynth.pc.in ${CMAKE_BINARY_DIR}/fluidsynth.pc IMMEDIATE @ONLY ) install ( FILES ${CMAKE_BINARY_DIR}/fluidsynth.pc DESTINATION ${LIB_INSTALL_DIR}${LIB_SUFFIX}/pkgconfig ) - + # uninstall custom target configure_file ( "${CMAKE_SOURCE_DIR}/cmake_admin/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) add_custom_target ( uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") - + # tarball custom target add_custom_target ( tarball COMMAND mkdir -p ${PACKAGE}-${VERSION} @@ -464,7 +464,7 @@ endif ( UNIX ) include ( report ) -# CPack support +# CPack support set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "FluidSynth real-time synthesizer" ) set ( CPACK_PACKAGE_VENDOR "fluidsynth.org" ) set ( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README" ) @@ -477,7 +477,7 @@ set ( CPACK_PACKAGE_EXECUTABLES "fluidsynth" "FluidSynth CLI" ) # source packages set ( CPACK_SOURCE_GENERATOR TGZ;TBZ2;ZIP ) set ( CPACK_SOURCE_IGNORE_FILES "/.svn/;/build/;~$;.cproject;.project;/.settings/;${CPACK_SOURCE_IGNORE_FILES}" ) -set ( CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE}-${VERSION}" ) +set ( CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE}-${VERSION}" ) set ( CPACK_SOURCE_STRIP_FILES OFF ) # binary packages diff --git a/fluidsynth/src/CMakeLists.txt b/fluidsynth/src/CMakeLists.txt index 4e2b238d..94464e4a 100644 --- a/fluidsynth/src/CMakeLists.txt +++ b/fluidsynth/src/CMakeLists.txt @@ -1,4 +1,4 @@ -# FluidSynth - A Software Synthesize +# FluidSynth - A Software Synthesizer # # Copyright (C) 2003-2010 Peter Hanappe and others. # @@ -21,7 +21,7 @@ include_directories ( ${CMAKE_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/src + ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/drivers ${CMAKE_SOURCE_DIR}/src/synth ${CMAKE_SOURCE_DIR}/src/rvoice @@ -29,11 +29,11 @@ include_directories ( ${CMAKE_SOURCE_DIR}/src/utils ${CMAKE_SOURCE_DIR}/src/sfloader ${CMAKE_SOURCE_DIR}/src/bindings - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_BINARY_DIR}/include + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_BINARY_DIR}/include ${PTHREADS_INCLUDE_DIR} - ${GLIB_INCLUDEDIR} - ${GLIB_INCLUDE_DIRS} + ${GLIB_INCLUDEDIR} + ${GLIB_INCLUDE_DIRS} ) # ************ library ************ @@ -41,8 +41,8 @@ include_directories ( if ( READLINE_SUPPORT ) include_directories ( ${READLINE_INCLUDE_DIR} ) endif ( READLINE_SUPPORT ) - -if ( PULSE_SUPPORT ) + +if ( PULSE_SUPPORT ) set ( fluid_pulse_SOURCES drivers/fluid_pulse.c ) include_directories ( ${PULSE_INCLUDEDIR} ${PULSE_INCLUDE_DIRS} ) endif ( PULSE_SUPPORT ) @@ -67,7 +67,7 @@ endif ( DBUS_SUPPORT ) if ( JACK_SUPPORT ) set ( fluid_jack_SOURCES drivers/fluid_jack.c ) - include_directories ( ${JACK_INCLUDEDIR} ${JACK_INCLUDE_DIRS} ) + include_directories ( ${JACK_INCLUDEDIR} ${JACK_INCLUDE_DIRS} ) endif ( JACK_SUPPORT ) if ( PORTAUDIO_SUPPORT ) @@ -85,13 +85,13 @@ endif ( OSS_SUPPORT ) if ( LASH_SUPPORT OR LADCCA_SUPPORT ) set ( fluid_lash_SOURCES bindings/fluid_lash.c bindings/fluid_lash.h ) - include_directories ( ${LASH_INCLUDEDIR} ${LADCCA_INCLUDEDIR} + include_directories ( ${LASH_INCLUDEDIR} ${LADCCA_INCLUDEDIR} ${LASH_INCLUDE_DIRS} ${LADCCA_INCLUDE_DIRS} ) endif ( LASH_SUPPORT OR LADCCA_SUPPORT ) if ( DART_SUPPORT ) set ( fluid_dart_SOURCES drivers/fluid_dart.c ) - include_directories ( ${DART_INCLUDE_DIRS} ) + include_directories ( ${DART_INCLUDE_DIRS} ) endif ( DART_SUPPORT ) if ( LIBSNDFILE_SUPPORT ) @@ -107,29 +107,36 @@ if ( MIDISHARE_SUPPORT ) include_directories ( ${MidiShare_INCLUDE_DIRS} ) endif ( MIDISHARE_SUPPORT ) -set ( libfluidsynth_SOURCES - utils/fluid_conv.c - utils/fluid_conv.h - utils/fluid_hash.c - utils/fluid_hash.h - utils/fluid_list.c - utils/fluid_list.h +set ( config_SOURCES ${CMAKE_BINARY_DIR}/config.h ) +if ( MSVC ) + set ( config_SOURCES + ${config_SOURCES} + ${CMAKE_BINARY_DIR}/config_win32.h ) +endif ( MSVC ) + +set ( libfluidsynth_SOURCES + utils/fluid_conv.c + utils/fluid_conv.h + utils/fluid_hash.c + utils/fluid_hash.h + utils/fluid_list.c + utils/fluid_list.h utils/fluid_ringbuffer.c utils/fluid_ringbuffer.h - utils/fluid_settings.c - utils/fluid_settings.h - utils/fluidsynth_priv.h - utils/fluid_sys.c - utils/fluid_sys.h - sfloader/fluid_defsfont.c - sfloader/fluid_defsfont.h - sfloader/fluid_ramsfont.c - sfloader/fluid_ramsfont.h - sfloader/fluid_sfont.h + utils/fluid_settings.c + utils/fluid_settings.h + utils/fluidsynth_priv.h + utils/fluid_sys.c + utils/fluid_sys.h + sfloader/fluid_defsfont.c + sfloader/fluid_defsfont.h + sfloader/fluid_ramsfont.c + sfloader/fluid_ramsfont.h + sfloader/fluid_sfont.h rvoice/fluid_adsr_env.c rvoice/fluid_adsr_env.h - rvoice/fluid_chorus.c - rvoice/fluid_chorus.h + rvoice/fluid_chorus.c + rvoice/fluid_chorus.h rvoice/fluid_iir_filter.c rvoice/fluid_iir_filter.h rvoice/fluid_lfo.c @@ -141,89 +148,90 @@ set ( libfluidsynth_SOURCES rvoice/fluid_rvoice_event.c rvoice/fluid_rvoice_mixer.h rvoice/fluid_rvoice_mixer.c - rvoice/fluid_phase.h - rvoice/fluid_rev.c - rvoice/fluid_rev.h - synth/fluid_chan.c - synth/fluid_chan.h - synth/fluid_event.c - synth/fluid_event_priv.h - synth/fluid_event_queue.h - synth/fluid_gen.c - synth/fluid_gen.h - synth/fluid_mod.c - synth/fluid_mod.h - synth/fluid_synth.c - synth/fluid_synth.h - synth/fluid_tuning.c - synth/fluid_tuning.h - synth/fluid_voice.c - synth/fluid_voice.h - midi/fluid_midi.c - midi/fluid_midi.h - midi/fluid_midi_router.c - midi/fluid_midi_router.h - midi/fluid_seqbind.c - midi/fluid_seq.c - drivers/fluid_adriver.c - drivers/fluid_adriver.h - drivers/fluid_mdriver.c - drivers/fluid_mdriver.h - drivers/fluid_aufile.c - bindings/fluid_cmd.c + rvoice/fluid_phase.h + rvoice/fluid_rev.c + rvoice/fluid_rev.h + synth/fluid_chan.c + synth/fluid_chan.h + synth/fluid_event.c + synth/fluid_event_priv.h + synth/fluid_event_queue.h + synth/fluid_gen.c + synth/fluid_gen.h + synth/fluid_mod.c + synth/fluid_mod.h + synth/fluid_synth.c + synth/fluid_synth.h + synth/fluid_tuning.c + synth/fluid_tuning.h + synth/fluid_voice.c + synth/fluid_voice.h + midi/fluid_midi.c + midi/fluid_midi.h + midi/fluid_midi_router.c + midi/fluid_midi_router.h + midi/fluid_seqbind.c + midi/fluid_seq.c + drivers/fluid_adriver.c + drivers/fluid_adriver.h + drivers/fluid_mdriver.c + drivers/fluid_mdriver.h + drivers/fluid_aufile.c + bindings/fluid_cmd.c bindings/fluid_cmd.h - bindings/fluid_filerenderer.c -) + bindings/fluid_filerenderer.c +) set ( public_HEADERS - ${CMAKE_SOURCE_DIR}/include/fluidsynth/audio.h - ${CMAKE_SOURCE_DIR}/include/fluidsynth/event.h - ${CMAKE_SOURCE_DIR}/include/fluidsynth/gen.h - ${CMAKE_SOURCE_DIR}/include/fluidsynth/log.h - ${CMAKE_SOURCE_DIR}/include/fluidsynth/midi.h - ${CMAKE_SOURCE_DIR}/include/fluidsynth/misc.h - ${CMAKE_SOURCE_DIR}/include/fluidsynth/mod.h - ${CMAKE_SOURCE_DIR}/include/fluidsynth/ramsfont.h - ${CMAKE_SOURCE_DIR}/include/fluidsynth/seq.h - ${CMAKE_SOURCE_DIR}/include/fluidsynth/seqbind.h - ${CMAKE_SOURCE_DIR}/include/fluidsynth/settings.h - ${CMAKE_SOURCE_DIR}/include/fluidsynth/sfont.h - ${CMAKE_SOURCE_DIR}/include/fluidsynth/shell.h - ${CMAKE_SOURCE_DIR}/include/fluidsynth/synth.h - ${CMAKE_SOURCE_DIR}/include/fluidsynth/types.h - ${CMAKE_SOURCE_DIR}/include/fluidsynth/voice.h - ${CMAKE_BINARY_DIR}/include/fluidsynth/version.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/audio.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/event.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/gen.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/log.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/midi.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/misc.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/mod.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/ramsfont.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/seq.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/seqbind.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/settings.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/sfont.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/shell.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/synth.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/types.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth/voice.h + ${CMAKE_BINARY_DIR}/include/fluidsynth/version.h ) set ( public_main_HEADER - ${CMAKE_SOURCE_DIR}/include/fluidsynth.h + ${CMAKE_SOURCE_DIR}/include/fluidsynth.h ) link_directories ( - ${GLIB_LIBDIR} - ${GLIB_LIBRARY_DIRS} - ${LASH_LIBDIR} - ${LASH_LIBRARY_DIRS} - ${LADCCA_LIBDIR} - ${LADCCA_LIBRARY_DIRS} - ${JACK_LIBDIR} - ${JACK_LIBRARY_DIRS} - ${ALSA_LIBDIR} - ${ALSA_LIBRARY_DIRS} - ${PULSE_LIBDIR} - ${PULSE_LIBRARY_DIRS} - ${PORTAUDIO_LIBDIR} - ${PORTAUDIO_LIBRARY_DIRS} + ${GLIB_LIBDIR} + ${GLIB_LIBRARY_DIRS} + ${LASH_LIBDIR} + ${LASH_LIBRARY_DIRS} + ${LADCCA_LIBDIR} + ${LADCCA_LIBRARY_DIRS} + ${JACK_LIBDIR} + ${JACK_LIBRARY_DIRS} + ${ALSA_LIBDIR} + ${ALSA_LIBRARY_DIRS} + ${PULSE_LIBDIR} + ${PULSE_LIBRARY_DIRS} + ${PORTAUDIO_LIBDIR} + ${PORTAUDIO_LIBRARY_DIRS} ${LIBSNDFILE_LIBDIR} ${LIBSNDFILE_LIBRARY_DIRS} - ${DBUS_LIBDIR} - ${DBUS_LIBRARY_DIRS} + ${DBUS_LIBDIR} + ${DBUS_LIBRARY_DIRS} ) -# note: by default this target creates a shared object (or dll). To build a +# note: by default this target creates a shared object (or dll). To build a # static library instead, set the option BUILD_SHARED_LIBS to FALSE. -add_library ( libfluidsynth +add_library ( libfluidsynth + ${config_SOURCES} ${fluid_alsa_SOURCES} ${fluid_coreaudio_SOURCES} ${fluid_coremidi_SOURCES} @@ -237,30 +245,30 @@ add_library ( libfluidsynth ${fluid_portaudio_SOURCES} ${fluid_pulse_SOURCES} ${fluid_windows_SOURCES} - ${libfluidsynth_SOURCES} + ${libfluidsynth_SOURCES} ${public_HEADERS} ${public_main_HEADER} ) if ( MACOSX_FRAMEWORK ) - set_property ( SOURCE ${public_HEADERS} - PROPERTY MACOSX_PACKAGE_LOCATION Headers/fluidsynth + set_property ( SOURCE ${public_HEADERS} + PROPERTY MACOSX_PACKAGE_LOCATION Headers/fluidsynth ) set_target_properties ( libfluidsynth - PROPERTIES - OUTPUT_NAME "FluidSynth" + PROPERTIES + OUTPUT_NAME "FluidSynth" FRAMEWORK TRUE - PUBLIC_HEADER "${public_main_HEADER}" + PUBLIC_HEADER "${public_main_HEADER}" FRAMEWORK_VERSION "${LIB_VERSION_CURRENT}" - INSTALL_NAME_DIR ${FRAMEWORK_INSTALL_DIR} + INSTALL_NAME_DIR "" VERSION ${LIB_VERSION_INFO} SOVERSION ${LIB_VERSION_CURRENT} ) else ( MACOSX_FRAMEWORK ) - set_target_properties ( libfluidsynth + set_target_properties ( libfluidsynth PROPERTIES PREFIX "lib" - OUTPUT_NAME "fluidsynth" + OUTPUT_NAME "fluidsynth" VERSION ${LIB_VERSION_INFO} SOVERSION ${LIB_VERSION_CURRENT} ) @@ -269,22 +277,22 @@ endif ( MACOSX_FRAMEWORK ) if ( LIBFLUID_CPPFLAGS ) set_target_properties ( libfluidsynth PROPERTIES COMPILE_FLAGS ${LIBFLUID_CPPFLAGS} ) -endif ( LIBFLUID_CPPFLAGS ) +endif ( LIBFLUID_CPPFLAGS ) target_link_libraries ( libfluidsynth - ${GLIB_LIBRARIES} - ${LASH_LIBRARIES} - ${LADCCA_LIBRARIES} - ${JACK_LIBRARIES} - ${ALSA_LIBRARIES} - ${PULSE_LIBRARIES} - ${PORTAUDIO_LIBRARIES} + ${GLIB_LIBRARIES} + ${LASH_LIBRARIES} + ${LADCCA_LIBRARIES} + ${JACK_LIBRARIES} + ${ALSA_LIBRARIES} + ${PULSE_LIBRARIES} + ${PORTAUDIO_LIBRARIES} ${LIBSNDFILE_LIBRARIES} ${DBUS_LIBRARIES} - ${READLINE_LIBS} - ${DART_LIBS} - ${COREAUDIO_LIBS} - ${COREMIDI_LIBS} + ${READLINE_LIBS} + ${DART_LIBS} + ${COREAUDIO_LIBS} + ${COREMIDI_LIBS} ${WINDOWS_LIBS} ${MidiShare_LIBS} ${LIBFLUID_LIBS} @@ -294,24 +302,30 @@ target_link_libraries ( libfluidsynth set ( fluidsynth_SOURCES fluidsynth.c ) -add_executable ( fluidsynth - ${fluidsynth_SOURCES} +add_executable ( fluidsynth + ${fluidsynth_SOURCES} ) if ( FLUID_CPPFLAGS ) - set_target_properties ( fluidsynth + set_target_properties ( fluidsynth PROPERTIES COMPILE_FLAGS ${FLUID_CPPFLAGS} ) -endif ( FLUID_CPPFLAGS ) +endif ( FLUID_CPPFLAGS ) -target_link_libraries ( fluidsynth - libfluidsynth +target_link_libraries ( fluidsynth + libfluidsynth ${FLUID_LIBS} ) -install ( TARGETS fluidsynth libfluidsynth - RUNTIME DESTINATION ${BIN_INSTALL_DIR} - LIBRARY DESTINATION ${LIB_INSTALL_DIR}${LIB_SUFFIX} - ARCHIVE DESTINATION ${LIB_INSTALL_DIR}${LIB_SUFFIX} - FRAMEWORK DESTINATION ${FRAMEWORK_INSTALL_DIR} - BUNDLE DESTINATION ${BUNDLE_INSTALL_DIR} +if ( MACOSX_FRAMEWORK ) + install ( TARGETS fluidsynth libfluidsynth + RUNTIME DESTINATION ${BIN_INSTALL_DIR} + FRAMEWORK DESTINATION ${FRAMEWORK_INSTALL_DIR} ) +else ( MACOSX_FRAMEWORK ) + install ( TARGETS fluidsynth libfluidsynth + RUNTIME DESTINATION ${BIN_INSTALL_DIR} + LIBRARY DESTINATION ${LIB_INSTALL_DIR}${LIB_SUFFIX} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR}${LIB_SUFFIX} +) +endif ( MACOSX_FRAMEWORK ) + diff --git a/fluidsynth/src/drivers/fluid_coreaudio.c b/fluidsynth/src/drivers/fluid_coreaudio.c index 533681f7..efb5a75a 100644 --- a/fluidsynth/src/drivers/fluid_coreaudio.c +++ b/fluidsynth/src/drivers/fluid_coreaudio.c @@ -109,8 +109,8 @@ fluid_core_audio_driver_settings(fluid_settings_t* settings) pa.mScope = kAudioObjectPropertyScopeWildcard; pa.mElement = kAudioObjectPropertyElementMaster; - fluid_settings_register_str(settings, "audio.coreaudio.device", "default", 0, NULL, NULL); - fluid_settings_add_option(settings, "audio.coreaudio.device", "default"); + fluid_settings_register_str (settings, "audio.coreaudio.device", "default", 0, NULL, NULL); + fluid_settings_add_option (settings, "audio.coreaudio.device", "default"); if (OK (AudioObjectGetPropertyDataSize (kAudioObjectSystemObject, &pa, 0, 0, &size))) { int num = size / (int) sizeof (AudioDeviceID); AudioDeviceID devs [num]; @@ -121,7 +121,7 @@ fluid_core_audio_driver_settings(fluid_settings_t* settings) pa.mSelector = kAudioDevicePropertyDeviceName; if (OK (AudioObjectGetPropertyData (devs[i], &pa, 0, 0, &size, name))) { if ( get_num_outputs (devs[i]) > 0) { - fluid_settings_add_option(settings, "audio.coreaudio.device", name); + fluid_settings_add_option (settings, "audio.coreaudio.device", name); } } } diff --git a/fluidsynth/src/drivers/fluid_coremidi.c b/fluidsynth/src/drivers/fluid_coremidi.c index 03e1472a..4e975bcb 100644 --- a/fluidsynth/src/drivers/fluid_coremidi.c +++ b/fluidsynth/src/drivers/fluid_coremidi.c @@ -34,7 +34,7 @@ /* Work around for OSX 10.4 */ -/* enum definition in OpenTransportProviders.h defines these tokens +/* enum definition in OpenTransportProviders.h defines these tokens which are #defined from */ #ifdef TCP_NODELAY #undef TCP_NODELAY @@ -78,6 +78,7 @@ new_fluid_coremidi_driver(fluid_settings_t* settings, handle_midi_event_func_t h fluid_coremidi_driver_t* dev; MIDIClientRef client; MIDIEndpointRef endpoint; + char clientid[32]; char * portname; char * id; CFStringRef str_portname; @@ -108,24 +109,26 @@ new_fluid_coremidi_driver(fluid_settings_t* settings, handle_midi_event_func_t h } fluid_settings_dupstr(settings, "midi.coremidi.id", &id); /* ++ alloc id string */ - if (!id || FLUID_STRCMP(id, "pid") == 0) - str_clientname = CFStringCreateWithFormat(NULL, NULL, - CFSTR("FluidSynth %qi"), - (long long) getpid()); - else - str_clientname = CFStringCreateWithFormat(NULL, NULL, - CFSTR("FluidSynth %s"), id); - - if (id) FLUID_FREE (id); /* -- free id string */ + bzero (clientid, sizeof(clientid)); + if (id != NULL) { + if (FLUID_STRCMP (id, "pid") == 0) { + snprintf (clientid, sizeof(clientid), " (%d)", getpid()); + } else { + snprintf (clientid, sizeof(clientid), " (%s)", id); + } + FLUID_FREE (id); /* -- free id string */ + } + str_clientname = CFStringCreateWithFormat (NULL, NULL, + CFSTR("FluidSynth%s"), clientid); fluid_settings_dupstr(settings, "midi.portname", &portname); /* ++ alloc port name */ if (!portname || strlen(portname) == 0) - str_portname = CFStringCreateWithFormat(NULL, NULL, - CFSTR("FluidSynth virtual port %qi"), - (long long) getpid()); + str_portname = CFStringCreateWithFormat (NULL, NULL, + CFSTR("FluidSynth virtual port%s"), + clientid); else - str_portname = CFStringCreateWithCString(NULL, portname, - kCFStringEncodingASCII); + str_portname = CFStringCreateWithCString (NULL, portname, + kCFStringEncodingASCII); if (portname) FLUID_FREE (portname); /* -- free port name */