remove deprecated LADCCA support

This commit is contained in:
derselbst 2017-09-15 11:11:09 +02:00
parent 3c17868ba3
commit 34f5a14df3
6 changed files with 6 additions and 165 deletions

View file

@ -71,7 +71,6 @@ option ( enable-ipv6 "enable ipv6 support " on )
# Platform specific options # 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-lash "compile LASH support (if it is available)" on )
option ( enable-alsa "compile ALSA 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" )
@ -379,14 +378,6 @@ else(NOT enable-pkgconfig)
remove_definitions( -DHAVE_LASH ) remove_definitions( -DHAVE_LASH )
endif ( enable-lash ) endif ( enable-lash )
unset ( LADCCA_SUPPORT CACHE )
if ( enable-ladcca )
pkg_check_modules ( LADCCA ladcca-1.0>=0.3 )
set ( LADCCA_SUPPORT ${LADCCA_FOUND} )
else ( enable-ladcca )
unset_pkg_config ( LADCCA )
endif ( enable-ladcca )
unset ( DBUS_SUPPORT CACHE ) unset ( DBUS_SUPPORT CACHE )
if ( enable-dbus ) if ( enable-dbus )
pkg_check_modules ( DBUS dbus-1>=1.0.0 ) pkg_check_modules ( DBUS dbus-1>=1.0.0 )

View file

@ -85,12 +85,6 @@ else ( LASH_SUPPORT )
message ( "LASH support: no" ) message ( "LASH support: no" )
endif ( LASH_SUPPORT ) endif ( LASH_SUPPORT )
if ( LADCCA_SUPPORT )
message ( "LADCCA support: yes (NOTE: GPL library)" )
else ( LADCCA_SUPPORT )
message ( "LADCCA support: no" )
endif ( LADCCA_SUPPORT )
if ( DART_SUPPORT ) if ( DART_SUPPORT )
message ( "OS/2 DART support: yes" ) message ( "OS/2 DART support: yes" )
else ( DART_SUPPORT ) else ( DART_SUPPORT )

View file

@ -83,11 +83,11 @@ if ( OSS_SUPPORT )
set ( fluid_oss_SOURCES drivers/fluid_oss.c ) set ( fluid_oss_SOURCES drivers/fluid_oss.c )
endif ( OSS_SUPPORT ) endif ( OSS_SUPPORT )
if ( LASH_SUPPORT OR LADCCA_SUPPORT ) if ( LASH_SUPPORT )
set ( fluid_lash_SOURCES bindings/fluid_lash.c bindings/fluid_lash.h ) set ( fluid_lash_SOURCES bindings/fluid_lash.c bindings/fluid_lash.h )
include_directories ( ${LASH_INCLUDEDIR} ${LADCCA_INCLUDEDIR} include_directories ( ${LASH_INCLUDEDIR}
${LASH_INCLUDE_DIRS} ${LADCCA_INCLUDE_DIRS} ) ${LASH_INCLUDE_DIRS})
endif ( LASH_SUPPORT OR LADCCA_SUPPORT ) endif ( LASH_SUPPORT )
if ( DART_SUPPORT ) if ( DART_SUPPORT )
set ( fluid_dart_SOURCES drivers/fluid_dart.c ) set ( fluid_dart_SOURCES drivers/fluid_dart.c )
@ -210,8 +210,6 @@ link_directories (
${GLIB_LIBRARY_DIRS} ${GLIB_LIBRARY_DIRS}
${LASH_LIBDIR} ${LASH_LIBDIR}
${LASH_LIBRARY_DIRS} ${LASH_LIBRARY_DIRS}
${LADCCA_LIBDIR}
${LADCCA_LIBRARY_DIRS}
${JACK_LIBDIR} ${JACK_LIBDIR}
${JACK_LIBRARY_DIRS} ${JACK_LIBRARY_DIRS}
${ALSA_LIBDIR} ${ALSA_LIBDIR}
@ -289,7 +287,6 @@ endif ( LIBFLUID_CPPFLAGS )
target_link_libraries ( libfluidsynth target_link_libraries ( libfluidsynth
${GLIB_LIBRARIES} ${GLIB_LIBRARIES}
${LASH_LIBRARIES} ${LASH_LIBRARIES}
${LADCCA_LIBRARIES}
${JACK_LIBRARIES} ${JACK_LIBRARIES}
${ALSA_LIBRARIES} ${ALSA_LIBRARIES}
${PULSE_LIBRARIES} ${PULSE_LIBRARIES}

View file

@ -37,8 +37,6 @@ static void *fluid_lash_run (void * data);
*/ */
#ifdef HAVE_LASH #ifdef HAVE_LASH
lash_client_t * fluid_lash_client; lash_client_t * fluid_lash_client;
#else
cca_client_t * fluid_lash_client;
#endif #endif
static pthread_t fluid_lash_thread; static pthread_t fluid_lash_thread;
@ -169,132 +167,4 @@ fluid_lash_run (void * data)
return NULL; return NULL;
} }
#else /* deprecated LADCCA support, will remove someday */
fluid_lash_args_t *
fluid_lash_extract_args (int * pargc, char *** pargv)
{
return cca_extract_args (pargc, pargv);
}
int
fluid_lash_connect (fluid_lash_args_t * args)
{
fluid_lash_client = cca_init (args, PACKAGE, CCA_Config_Data_Set | CCA_Terminal, CCA_PROTOCOL (2,0));
return fluid_lash_client && cca_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;
cca_config_t * config;
char num[32];
sfcount = fluid_synth_sfcount (synth);
config = cca_config_new ();
cca_config_set_key (config, "soundfont count");
cca_config_set_value_int (config, sfcount);
cca_send_config (fluid_lash_client, config);
for (i = sfcount - 1; i >= 0; i--)
{
sfont = fluid_synth_get_sfont (synth, i);
config = cca_config_new ();
sprintf (num, "%d", i);
cca_config_set_key (config, num);
cca_config_set_value_string (config, sfont->get_name (sfont));
cca_send_config (fluid_lash_client, config);
}
}
static void
fluid_lash_load (fluid_synth_t * synth, const char * filename)
{
fluid_synth_sfload (synth, filename, 1);
}
/* LADCCA thread */
static void *
fluid_lash_run (void * data)
{
cca_event_t * event;
cca_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 = cca_get_event (fluid_lash_client)) )
{
switch (cca_event_get_type (event))
{
case CCA_Save_Data_Set:
fluid_lash_save (synth);
cca_send_event (fluid_lash_client, event);
break;
case CCA_Restore_Data_Set:
cca_event_destroy (event);
break;
case CCA_Quit:
err = kill (getpid(), SIGQUIT);
if (err)
fprintf (stderr, "%s: error sending signal: %s",
__FUNCTION__, strerror (errno));
cca_event_destroy (event);
done = 1;
break;
case CCA_Server_Lost:
cca_event_destroy (event);
done = 1;
break;
default:
fprintf (stderr, "Received unknown LADCCA event of type %d\n", cca_event_get_type (event));
cca_event_destroy (event);
break;
}
}
while ( (config = cca_get_config (fluid_lash_client)) )
{
if (strcmp (cca_config_get_key (config), "soundfont count") == 0)
pending_restores = cca_config_get_value_int (config);
else
{
fluid_lash_load (synth, cca_config_get_value_string (config));
pending_restores--;
}
cca_config_destroy (config);
if (!pending_restores)
{
event = cca_event_new_with_type (CCA_Restore_Data_Set);
cca_send_event (fluid_lash_client, event);
}
}
usleep (10000);
}
return NULL;
}
#endif /* #if HAVE_LASH #else */ #endif /* #if HAVE_LASH #else */

View file

@ -21,7 +21,7 @@
#include "config.h" #include "config.h"
#endif #endif
#if defined(HAVE_LASH) || defined(HAVE_LADCCA) #if defined(HAVE_LASH)
#include "fluid_synth.h" #include "fluid_synth.h"
@ -35,14 +35,6 @@ extern lash_client_t * fluid_lash_client;
#define fluid_lash_alsa_client_id lash_alsa_client_id #define fluid_lash_alsa_client_id lash_alsa_client_id
#define fluid_lash_jack_client_name lash_jack_client_name #define fluid_lash_jack_client_name lash_jack_client_name
#else /* old deprecated LADCCA support which will be removed someday */
#include <ladcca/ladcca.h>
extern cca_client_t * fluid_lash_client;
#define fluid_lash_args_t cca_args_t
#define fluid_lash_alsa_client_id cca_alsa_client_id
#define fluid_lash_jack_client_name cca_jack_client_name
#endif #endif
@ -50,4 +42,4 @@ FLUIDSYNTH_API fluid_lash_args_t *fluid_lash_extract_args (int * pargc, char ***
FLUIDSYNTH_API int fluid_lash_connect (fluid_lash_args_t * args); FLUIDSYNTH_API int fluid_lash_connect (fluid_lash_args_t * args);
FLUIDSYNTH_API void fluid_lash_create_thread (fluid_synth_t * synth); FLUIDSYNTH_API void fluid_lash_create_thread (fluid_synth_t * synth);
#endif /* defined(HAVE_LASH) || defined(HAVE_LADCCA) */ #endif /* defined(HAVE_LASH) */

View file

@ -43,9 +43,6 @@
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H @HAVE_INTTYPES_H@ #cmakedefine HAVE_INTTYPES_H @HAVE_INTTYPES_H@
/* whether or not we are supporting ladcca */
#cmakedefine HAVE_LADCCA @HAVE_LADCCA@
/* whether or not we are supporting lash */ /* whether or not we are supporting lash */
#cmakedefine HAVE_LASH @HAVE_LASH@ #cmakedefine HAVE_LASH @HAVE_LASH@