diff --git a/CMakeLists.txt b/CMakeLists.txt index 606bf8e57..584f2e2ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,7 +102,6 @@ option ( enable-openmp "enable OpenMP support (parallelization of soundfont deco # Platform specific options if ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" ) - option ( enable-lash "compile LASH support (if it is available)" off ) option ( enable-alsa "compile ALSA support (if it is available)" on ) endif ( CMAKE_SYSTEM MATCHES "Linux|FreeBSD|DragonFly" ) @@ -507,7 +506,6 @@ endif(ASTYLE) set ( ALSA_MINIMUM_VERSION 0.9.1 ) set ( DBUS_MINIMUM_VERSION 1.11.12 ) set ( GLIB2_MINUMUM_VERSION 2.6.5 ) -set ( LASH_MINIMUM_VERSION 0.3 ) set ( LIBINSTPATCH_MINIMUM_VERSION 1.1.0 ) set ( LIBSNDFILE_MINIMUM_VERSION 1.0.0 ) set ( PIPEWIRE_MINIMUM_VERSION 0.3 ) @@ -596,17 +594,6 @@ if ( enable-pipewire ) endif() endif ( enable-pipewire ) -unset ( LASH_SUPPORT CACHE ) -if ( enable-lash ) - find_package ( LASH ${LASH_MINIMUM_VERSION} ) - if ( LASH_FOUND ) - message ( WARNING "LASH support has been deprecated and will be removed in fluidsynth 2.4.0" ) - set ( LASH_SUPPORT 1 ) - add_definitions ( -DHAVE_LASH ) - list( APPEND PC_REQUIRES_PRIV "lash-1.0") - endif ( LASH_FOUND ) -endif ( enable-lash ) - unset ( SYSTEMD_SUPPORT CACHE ) if ( enable-systemd ) find_package ( Systemd ) diff --git a/FluidSynthConfig.cmake.in b/FluidSynthConfig.cmake.in index 498846f10..0d251d957 100644 --- a/FluidSynthConfig.cmake.in +++ b/FluidSynthConfig.cmake.in @@ -28,7 +28,6 @@ set(FLUIDSYNTH_SUPPORT_DBUS @DBUS_SUPPORT@) set(FLUIDSYNTH_SUPPORT_GETOPT @HAVE_GETOPT_H@) set(FLUIDSYNTH_SUPPORT_IPV6 @IPV6_SUPPORT@) set(FLUIDSYNTH_SUPPORT_LADSPA @LADSPA_SUPPORT@) -set(FLUIDSYNTH_SUPPORT_LASH @LASH_SUPPORT@) set(FLUIDSYNTH_SUPPORT_NETWORK @NETWORK_SUPPORT@) set(FLUIDSYNTH_SUPPORT_READLINE @READLINE_SUPPORT@) set(FLUIDSYNTH_SUPPORT_SYSTEMD @SYSTEMD_SUPPORT@) @@ -92,10 +91,6 @@ if(NOT FLUIDSYNTH_IS_SHARED) message(WARN "LADSPA support was built in but gmodule could not be found.") endif() - if(FLUIDSYNTH_SUPPORT_LASH AND NOT TARGET LASH::LASH) - find_dependency(LASH @LASH_MINIMUM_VERSION@) - endif() - if(FLUIDSYNTH_SUPPORT_LIBINSTPATCH AND NOT TARGET InstPatch::libinstpatch) find_dependency(InstPatch @LIBINSTPATCH_MINIMUM_VERSION@) endif() diff --git a/cmake_admin/FindLASH.cmake b/cmake_admin/FindLASH.cmake deleted file mode 100644 index 7cbcbaa3d..000000000 --- a/cmake_admin/FindLASH.cmake +++ /dev/null @@ -1,84 +0,0 @@ -#[=======================================================================[.rst: -FindLASH -------- - -Finds the LASH library. - -Imported Targets -^^^^^^^^^^^^^^^^ - -This module provides the following imported targets, if found: - -``LASH::LASH`` - The LASH library - -Result Variables -^^^^^^^^^^^^^^^^ - -This will define the following variables: - -``LASH_FOUND`` - True if the system has the LASH library. -``LASH_VERSION`` - The version of the LASH library which was found. - -#]=======================================================================] - -# Use pkg-config if available -find_package(PkgConfig QUIET) -pkg_check_modules(PC_LASH QUIET lash-1.0) - -# Find the headers and library -find_path( - LASH_INCLUDE_DIR - NAMES "lash/lash.h" - HINTS "${PC_LASH_INCLUDEDIR}" - PATH_SUFFIXES "lash-1.0") - -find_library( - LASH_LIBRARY - NAMES "lash" - HINTS "${PC_LASH_LIBDIR}") - -# Get version from pkg-config or read the config header -if(PC_LASH_VERSION) - set(LASH_VERSION "${PC_LASH_VERSION}") -else() - if(NOT LASH_FIND_VERSION) - set(_assumed_version "0.5.0") - else() - set(_assumed_version "${LASH_FIND_VERSION}") - endif() - message( - NOTICE - "LASH does not expose its version outside of pkg-config. Assuming version ${_assumed_version}, expect failure if your version is lower." - ) - set(LASH_VERSION ${_assumed_version}) -endif() - -# Handle transitive dependencies -if(PC_LASH_FOUND) - get_target_properties_from_pkg_config("${LASH_LIBRARY}" "PC_LASH" "_lash") -else() - set(_lash_link_libraries "Jack::Jack" "Threads::Threads" "ALSA::ALSA" "uuid") -endif() - -# Forward the result to CMake -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args( - LASH - REQUIRED_VARS "LASH_LIBRARY" "LASH_INCLUDE_DIR" - VERSION_VAR "LASH_VERSION") - -if(LASH_FOUND AND NOT TARGET LASH::LASH) - add_library(LASH::LASH UNKNOWN IMPORTED) - set_target_properties( - LASH::LASH - PROPERTIES IMPORTED_LOCATION "${LASH_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${_lash_compile_options}" - INTERFACE_INCLUDE_DIRECTORIES "${LASH_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${_lash_link_libraries}" - INTERFACE_LINK_DIRECTORIES "${_lash_link_directories}") -endif() - -mark_as_advanced(LASH_INCLUDE_DIR LASH_LIBRARY) diff --git a/cmake_admin/report.cmake b/cmake_admin/report.cmake index 882b8d6d6..85b375454 100644 --- a/cmake_admin/report.cmake +++ b/cmake_admin/report.cmake @@ -153,12 +153,6 @@ else ( LADSPA_SUPPORT ) set ( MISC_REPORT "${MISC_REPORT} LADSPA support: no\n" ) endif ( LADSPA_SUPPORT ) -if ( LASH_SUPPORT ) - set ( MISC_REPORT "${MISC_REPORT} LASH support: yes (NOTE: GPL library)\n" ) -else ( LASH_SUPPORT ) - set ( MISC_REPORT "${MISC_REPORT} LASH support: no\n" ) -endif ( LASH_SUPPORT ) - if ( NETWORK_SUPPORT ) set ( MISC_REPORT "${MISC_REPORT} NETWORK Support: yes\n" ) else ( NETWORK_SUPPORT ) diff --git a/contrib/fluidsynth.spec b/contrib/fluidsynth.spec index e5fb75e04..b34da6742 100644 --- a/contrib/fluidsynth.spec +++ b/contrib/fluidsynth.spec @@ -79,8 +79,7 @@ This package contains the shared library for Fluidsynth. %build %cmake \ - -DFLUID_DAEMON_ENV_FILE=%{_fillupdir}/sysconfig.%{name} \ - -Denable-lash=0 + -DFLUID_DAEMON_ENV_FILE=%{_fillupdir}/sysconfig.%{name} %cmake_build %check diff --git a/doc/fluidsynth.1 b/doc/fluidsynth.1 index 5140312d1..9debe59db 100644 --- a/doc/fluidsynth.1 +++ b/doc/fluidsynth.1 @@ -98,9 +98,6 @@ Attempt to connect the jack outputs to the physical ports .B \-K, \-\-midi\-channels=[num] The number of midi channels [default = 16] .TP -.B \-l, \-\-disable\-lash -Don't connect to LASH server -.TP .B \-L, \-\-audio\-channels=[num] The number of stereo audio channels [default = 1] .TP diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 808b8b8f8..771075adf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -77,10 +77,6 @@ if ( OSS_SUPPORT ) set ( fluid_oss_SOURCES drivers/fluid_oss.c ) endif ( OSS_SUPPORT ) -if ( LASH_SUPPORT ) - set ( fluid_lash_SOURCES bindings/fluid_lash.c bindings/fluid_lash.h ) -endif ( LASH_SUPPORT ) - if ( DART_SUPPORT ) set ( fluid_dart_SOURCES drivers/fluid_dart.c ) endif ( DART_SUPPORT ) @@ -237,7 +233,6 @@ add_library ( libfluidsynth-OBJ OBJECT ${fluid_dbus_SOURCES} ${fluid_jack_SOURCES} ${fluid_pipewire_SOURCES} - ${fluid_lash_SOURCES} ${fluid_midishare_SOURCES} ${fluid_opensles_SOURCES} ${fluid_oboe_SOURCES} @@ -390,10 +385,6 @@ if ( TARGET PipeWire::PipeWire AND PIPEWIRE_SUPPORT ) target_link_libraries ( libfluidsynth-OBJ PUBLIC PipeWire::PipeWire ) endif() -if ( TARGET LASH::LASH AND LASH_SUPPORT ) - target_link_libraries ( libfluidsynth-OBJ PUBLIC LASH::LASH ) -endif() - if ( TARGET dbus-1 AND DBUS_SUPPORT ) target_link_libraries ( libfluidsynth-OBJ PUBLIC dbus-1 ) endif() @@ -499,10 +490,6 @@ if ( TARGET PipeWire::PipeWire AND PIPEWIRE_SUPPORT ) # because pw_init() etc. target_link_libraries ( fluidsynth PRIVATE PipeWire::PipeWire ) endif() -if ( TARGET LASH::LASH AND LASH_SUPPORT ) - target_link_libraries ( fluidsynth PRIVATE LASH::LASH ) -endif() - if ( MACOSX_FRAMEWORK ) install ( TARGETS fluidsynth libfluidsynth EXPORT FluidSynthTargets diff --git a/src/bindings/fluid_lash.c b/src/bindings/fluid_lash.c deleted file mode 100644 index 652ccb268..000000000 --- a/src/bindings/fluid_lash.c +++ /dev/null @@ -1,170 +0,0 @@ -/* FluidSynth - A Software Synthesizer - * - * Copyright (C) 2003 Peter Hanappe and others. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA - */ -#include "fluid_lash.h" - -#ifdef HAVE_LASH - -static void fluid_lash_save(fluid_synth_t *synth); -static void fluid_lash_load(fluid_synth_t *synth, const char *filename); -static void *fluid_lash_run(void *data); - -/* - * lash client - this symbol needs to be in the library else - * all clients would need a fluid_lash_client symbol. - */ -lash_client_t *fluid_lash_client; - -static pthread_t fluid_lash_thread; - - -fluid_lash_args_t * -fluid_lash_extract_args(int *pargc, char ***pargv) -{ - return lash_extract_args(pargc, pargv); -} - -int -fluid_lash_connect(fluid_lash_args_t *args) -{ - fluid_lash_client = lash_init(args, PACKAGE, LASH_Config_Data_Set | LASH_Terminal, LASH_PROTOCOL(2, 0)); - return fluid_lash_client && lash_enabled(fluid_lash_client); -} - -void -fluid_lash_create_thread(fluid_synth_t *synth) -{ - pthread_create(&fluid_lash_thread, NULL, fluid_lash_run, synth); -} - -static void -fluid_lash_save(fluid_synth_t *synth) -{ - int i; - int sfcount; - fluid_sfont_t *sfont; - lash_config_t *config; - char num[32]; - - sfcount = fluid_synth_sfcount(synth); - - config = lash_config_new(); - lash_config_set_key(config, "soundfont count"); - lash_config_set_value_int(config, sfcount); - lash_send_config(fluid_lash_client, config); - - for(i = sfcount - 1; i >= 0; i--) - { - sfont = fluid_synth_get_sfont(synth, i); - config = lash_config_new(); - - sprintf(num, "%d", i); - - lash_config_set_key(config, num); - lash_config_set_value_string(config, sfont->get_name(sfont)); - - lash_send_config(fluid_lash_client, config); - } -} - -static void -fluid_lash_load(fluid_synth_t *synth, const char *filename) -{ - fluid_synth_sfload(synth, filename, 1); -} - -static void * -fluid_lash_run(void *data) -{ - lash_event_t *event; - lash_config_t *config; - fluid_synth_t *synth; - int done = 0; - int err; - int pending_restores = 0; - - synth = (fluid_synth_t *) data; - - while(!done) - { - while((event = lash_get_event(fluid_lash_client))) - { - switch(lash_event_get_type(event)) - { - case LASH_Save_Data_Set: - fluid_lash_save(synth); - lash_send_event(fluid_lash_client, event); - break; - - case LASH_Restore_Data_Set: - lash_event_destroy(event); - break; - - case LASH_Quit: - err = kill(getpid(), SIGQUIT); - - if(err) - { - fprintf(stderr, "%s: error sending signal: %s", __FUNCTION__, strerror(errno)); - } - - lash_event_destroy(event); - done = 1; - break; - - case LASH_Server_Lost: - lash_event_destroy(event); - done = 1; - break; - - default: - fprintf(stderr, "Received unknown LASH event of type %d\n", lash_event_get_type(event)); - lash_event_destroy(event); - break; - } - } - - while((config = lash_get_config(fluid_lash_client))) - { - if(FLUID_STRCMP(lash_config_get_key(config), "soundfont count") == 0) - { - pending_restores = lash_config_get_value_int(config); - } - else - { - fluid_lash_load(synth, lash_config_get_value_string(config)); - pending_restores--; - } - - lash_config_destroy(config); - - if(!pending_restores) - { - event = lash_event_new_with_type(LASH_Restore_Data_Set); - lash_send_event(fluid_lash_client, event); - } - } - - usleep(10000); - } - - return NULL; -} - -#endif /* #if HAVE_LASH #else */ diff --git a/src/bindings/fluid_lash.h b/src/bindings/fluid_lash.h deleted file mode 100644 index 787683906..000000000 --- a/src/bindings/fluid_lash.h +++ /dev/null @@ -1,41 +0,0 @@ -/* FluidSynth - A Software Synthesizer - * - * Copyright (C) 2003 Peter Hanappe and others. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA - */ -#ifndef _FLUID_LASH_H -#define _FLUID_LASH_H - -#include "config.h" - -#ifdef HAVE_LASH - -#include "fluid_synth.h" - -#include -extern lash_client_t *fluid_lash_client; -#define fluid_lash_args_t lash_args_t -#define fluid_lash_alsa_client_id lash_alsa_client_id -#define fluid_lash_jack_client_name lash_jack_client_name - - -FLUIDSYNTH_API fluid_lash_args_t *fluid_lash_extract_args(int *pargc, char ***pargv); -FLUIDSYNTH_API int fluid_lash_connect(fluid_lash_args_t *args); -FLUIDSYNTH_API void fluid_lash_create_thread(fluid_synth_t *synth); - -#endif /* defined(HAVE_LASH) */ -#endif /* _FLUID_LASH_H */ diff --git a/src/config.cmake b/src/config.cmake index 436add7f2..94324e815 100644 --- a/src/config.cmake +++ b/src/config.cmake @@ -43,9 +43,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_IO_H @HAVE_IO_H@ -/* whether or not we are supporting lash */ -#cmakedefine HAVE_LASH @HAVE_LASH@ - /* Define if systemd support is enabled */ #cmakedefine SYSTEMD_SUPPORT @SYSTEMD_SUPPORT@ diff --git a/src/drivers/fluid_alsa.c b/src/drivers/fluid_alsa.c index 98ae8f2c0..52d051fcd 100644 --- a/src/drivers/fluid_alsa.c +++ b/src/drivers/fluid_alsa.c @@ -37,8 +37,6 @@ #include #include -#include "fluid_lash.h" - #define FLUID_ALSA_DEFAULT_MIDI_DEVICE "default" #define FLUID_ALSA_DEFAULT_SEQ_DEVICE "default" @@ -1241,19 +1239,6 @@ new_fluid_alsa_seq_driver(fluid_settings_t *settings, fluid_alsa_seq_autoconnect(dev); } - /* tell the lash server our client id */ -#ifdef HAVE_LASH - { - int enable_lash = 0; - fluid_settings_getint(settings, "lash.enable", &enable_lash); - - if(enable_lash) - { - fluid_lash_alsa_client_id(fluid_lash_client, snd_seq_client_id(dev->seq_handle)); - } - } -#endif /* HAVE_LASH */ - fluid_atomic_int_set(&dev->should_quit, 0); /* create the MIDI thread */ diff --git a/src/drivers/fluid_jack.c b/src/drivers/fluid_jack.c index 2b0084804..6ee2a4f7d 100644 --- a/src/drivers/fluid_jack.c +++ b/src/drivers/fluid_jack.c @@ -38,8 +38,6 @@ #include #include -#include "fluid_lash.h" - typedef struct _fluid_jack_audio_driver_t fluid_jack_audio_driver_t; typedef struct _fluid_jack_midi_driver_t fluid_jack_midi_driver_t; @@ -265,19 +263,6 @@ new_fluid_jack_client(fluid_settings_t *settings, int isaudio, void *driver) goto error_recovery; } - /* tell the lash server our client name */ -#ifdef HAVE_LASH - { - int enable_lash = 0; - fluid_settings_getint(settings, "lash.enable", &enable_lash); - - if(enable_lash) - { - fluid_lash_jack_client_name(fluid_lash_client, name); - } - } -#endif /* HAVE_LASH */ - client_ref->server = server; /* !! takes over allocation */ server = NULL; /* Set to NULL so it doesn't get freed below */ diff --git a/src/fluidsynth.c b/src/fluidsynth.c index 81de1a8d8..11c917dfe 100644 --- a/src/fluidsynth.c +++ b/src/fluidsynth.c @@ -29,8 +29,6 @@ #define GETOPT_SUPPORT 1 #endif -#include "fluid_lash.h" - #ifdef SYSTEMD_SUPPORT #include #endif @@ -392,13 +390,6 @@ int main(int argc, char **argv) int dump = 0; int fast_render = 0; static const char optchars[] = "a:C:c:dE:f:F:G:g:hijK:L:lm:nO:o:p:QqR:r:sT:Vvz:"; -#ifdef HAVE_LASH - int connect_lash = 1; - int enabled_lash = 0; /* set to TRUE if lash gets enabled */ - fluid_lash_args_t *lash_args; - - lash_args = fluid_lash_extract_args(&argc, &argv); -#endif #if SDL2_SUPPORT // Tell SDL that it shouldn't intercept signals, otherwise SIGINT and SIGTERM won't quit fluidsynth @@ -653,9 +644,7 @@ int main(int argc, char **argv) break; case 'l': /* disable LASH */ -#ifdef HAVE_LASH - connect_lash = 0; -#endif + // lash support removed in 2.4.0, NOOP break; case 'm': @@ -853,17 +842,6 @@ int main(int argc, char **argv) SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS); #endif -#ifdef HAVE_LASH - - /* connect to the lash server */ - if(connect_lash) - { - enabled_lash = fluid_lash_connect(lash_args); - fluid_settings_setint(settings, "lash.enable", enabled_lash ? 1 : 0); - } - -#endif - /* 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 @@ -1095,15 +1073,6 @@ int main(int argc, char **argv) #endif } -#endif - -#ifdef HAVE_LASH - - if(enabled_lash) - { - fluid_lash_create_thread(synth); - } - #endif /* fast rendering audio file, if requested */ @@ -1284,10 +1253,6 @@ print_help(fluid_settings_t *settings) " Attempt to connect the jack outputs to the physical ports\n"); printf(" -K, --midi-channels=[num]\n" " The number of midi channels [default = 16]\n"); -#ifdef HAVE_LASH - printf(" -l, --disable-lash\n" - " Don't connect to LASH server\n"); -#endif printf(" -L, --audio-channels=[num]\n" " The number of stereo audio channels [default = 1]\n"); printf(" -m, --midi-driver=[label]\n"