Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Mark Hämmerling 2017-07-21 10:27:18 +02:00
commit 6064f30976
10 changed files with 48 additions and 23 deletions

View file

@ -101,6 +101,7 @@ include ( DefaultDirs )
# Basic C library checks
include ( CheckSTDC )
include ( CheckIncludeFile )
include ( CheckFunctionExists )
check_include_file ( string.h HAVE_STRING_H )
check_include_file ( stdlib.h HAVE_STDLIB_H )
check_include_file ( stdio.h HAVE_STDIO_H )
@ -224,6 +225,16 @@ if ( ${CMAKE_SYSTEM} MATCHES "Darwin" )
endif ( enable-framework )
endif ( ${CMAKE_SYSTEM} MATCHES "Darwin" )
unset ( HAVE_INETNTOP CACHE )
unset ( IPV6_SUPPORT CACHE )
CHECK_FUNCTION_EXISTS ( "inet_ntop" HAVE_INETNTOP )
if ( enable-ipv6 )
if ( HAVE_INETNTOP )
set ( IPV6_SUPPORT 1 )
endif ( HAVE_INETNTOP )
endif ( enable-ipv6 )
unset ( WITH_FLOAT CACHE )
if ( enable-floats )
set ( WITH_FLOAT 1 )
@ -389,12 +400,6 @@ else ( enable-dbus )
unset_pkg_config ( DBUS )
endif ( enable-dbus )
unset ( IPV6_SUPPORT CACHE )
if ( enable-ipv6 )
set ( IPV6 1 )
set ( IPV6_SUPPORT 1 )
endif ( enable-ipv6 )
# General configuration file
configure_file ( ${CMAKE_SOURCE_DIR}/src/config.cmake
${CMAKE_BINARY_DIR}/config.h )

View file

@ -481,7 +481,8 @@ The following table provides details on all the settings used by the synthesizer
<li>gs: (default) CC0 becomes the bank number, CC32 is ignored.</li>
<li>xg: CC32 becomes the bank number, CC0 is ignored.</li>
<li>mma: bank is calculated as CC0*128+CC32.</li>
</ul>
</ul>
Note: Drum channels are initialized to \c DRUM_INST_BANK (==128). Since 1.1.7 mma mode also allows the bank of drum channels to be changed the same way as for melodic channels.
</td>
</tr>

View file

@ -133,6 +133,9 @@
/* Define to 1 if you have the <getopt.h> header file. */
#cmakedefine HAVE_GETOPT_H @HAVE_GETOPT_H@
/* Define to 1 if you have the inet_ntop() function. */
#cmakedefine HAVE_INETNTOP @HAVE_INETNTOP@
/* Define to enable JACK driver */
#cmakedefine JACK_SUPPORT @JACK_SUPPORT@
@ -140,7 +143,7 @@
#cmakedefine LADSPA @LADSPA_SUPPORT@
/* Define to enable IPV6 support */
#cmakedefine IPV6 @IPV6_SUPPORT@
#cmakedefine IPV6_SUPPORT @IPV6_SUPPORT@
/* libsndfile has ogg vorbis support */
#cmakedefine LIBSNDFILE_HASVORBIS @LIBSNDFILE_HASVORBIS@

View file

@ -45,7 +45,7 @@
#define BUFFER_LENGTH 512
// Build issue on some systems (OSS 4.0)?
#ifdef SNDCTL_DSP_CHANNELS
#if !defined(SOUND_PCM_WRITE_CHANNELS) && defined(SNDCTL_DSP_CHANNELS)
#define SOUND_PCM_WRITE_CHANNELS SNDCTL_DSP_CHANNELS
#endif

View file

@ -264,7 +264,7 @@ fluid_channel_set_bank_msb(fluid_channel_t* chan, int bankmsb)
}
if (style == FLUID_BANK_STYLE_GM ||
chan->channel_type == CHANNEL_TYPE_DRUM)
(chan->channel_type == CHANNEL_TYPE_DRUM && style != FLUID_BANK_STYLE_MMA))
return; /* ignored */
oldval = chan->sfont_bank_prog;

View file

@ -1945,7 +1945,8 @@ fluid_synth_program_change(fluid_synth_t* synth, int chan, int prognum)
FLUID_API_ENTRY_CHAN(FLUID_FAILED);
channel = synth->channel[chan];
if (channel->channel_type == CHANNEL_TYPE_DRUM)
if (channel->channel_type == CHANNEL_TYPE_DRUM &&
synth->bank_select != FLUID_BANK_STYLE_MMA)
banknum = DRUM_INST_BANK;
else
fluid_channel_get_sfont_bank_prog(channel, NULL, &banknum, NULL);
@ -1969,8 +1970,9 @@ fluid_synth_program_change(fluid_synth_t* synth, int chan, int prognum)
/* Fallback to another preset if not found */
if (!preset) {
/* Percussion: Fallback to preset 0 in percussion bank */
if (subst_bank == DRUM_INST_BANK) {
if (channel->channel_type == CHANNEL_TYPE_DRUM) {
subst_prog = 0;
subst_bank = DRUM_INST_BANK;
preset = fluid_synth_find_preset(synth, subst_bank, subst_prog);
}
/* Melodic instrument */

View file

@ -25,7 +25,6 @@
fluid_real_t fluid_ct2hz_tab[FLUID_CENTS_HZ_SIZE];
fluid_real_t fluid_cb2amp_tab[FLUID_CB_AMP_SIZE];
fluid_real_t fluid_atten2amp_tab[FLUID_ATTEN_AMP_SIZE];
fluid_real_t fluid_posbp_tab[128];
fluid_real_t fluid_concave_tab[128];
fluid_real_t fluid_convex_tab[128];
fluid_real_t fluid_pan_tab[FLUID_PAN_SIZE];

View file

@ -54,7 +54,6 @@ fluid_real_t fluid_convex(fluid_real_t val);
extern fluid_real_t fluid_ct2hz_tab[FLUID_CENTS_HZ_SIZE];
extern fluid_real_t fluid_vel2cb_tab[FLUID_VEL_CB_SIZE];
extern fluid_real_t fluid_cb2amp_tab[FLUID_CB_AMP_SIZE];
extern fluid_real_t fluid_posbp_tab[128];
extern fluid_real_t fluid_concave_tab[128];
extern fluid_real_t fluid_convex_tab[128];
extern fluid_real_t fluid_pan_tab[FLUID_PAN_SIZE];

View file

@ -981,7 +981,7 @@ fluid_server_socket_run (void *data)
{
fluid_server_socket_t *server_socket = (fluid_server_socket_t *)data;
fluid_socket_t client_socket;
#ifdef IPV6
#ifdef IPV6_SUPPORT
struct sockaddr_in6 addr;
char straddr[INET6_ADDRSTRLEN];
#else
@ -1008,13 +1008,20 @@ fluid_server_socket_run (void *data)
server_socket->cont = 0;
return;
} else {
#ifdef IPV6
#ifdef HAVE_INETNTOP
#ifdef IPV6_SUPPORT
inet_ntop(AF_INET6, &addr.sin6_addr, straddr, sizeof(straddr));
#else
inet_ntop(AF_INET, &addr.sin_addr, straddr, sizeof(straddr));
#endif
#endif
#ifdef HAVE_INETNTOP
retval = server_socket->func (server_socket->data, client_socket,
straddr);
#else
retval = server_socket->func (server_socket->data, client_socket,
inet_ntoa (addr.sin_addr));
#endif
if (retval != 0)
fluid_socket_close(client_socket);
@ -1028,7 +1035,7 @@ fluid_server_socket_t*
new_fluid_server_socket(int port, fluid_server_func_t func, void* data)
{
fluid_server_socket_t* server_socket;
#ifdef IPV6
#ifdef IPV6_SUPPORT
struct sockaddr_in6 addr;
#else
struct sockaddr_in addr;
@ -1036,7 +1043,7 @@ new_fluid_server_socket(int port, fluid_server_func_t func, void* data)
fluid_socket_t sock;
g_return_val_if_fail (func != NULL, NULL);
#ifdef IPV6
#ifdef IPV6_SUPPORT
sock = socket(AF_INET6, SOCK_STREAM, 0);
if (sock == INVALID_SOCKET) {
FLUID_LOG(FLUID_ERR, "Failed to create server socket");
@ -1136,12 +1143,14 @@ static void fluid_server_socket_run (void *data)
{
fluid_server_socket_t *server_socket = (fluid_server_socket_t *)data;
fluid_socket_t client_socket;
#ifdef IPV6
#ifdef IPV6_SUPPORT
struct sockaddr_in6 addr;
char straddr[INET6_ADDRSTRLEN];
#else
struct sockaddr_in addr;
#ifdef HAVE_INETNTOP
char straddr[INET_ADDRSTRLEN];
#endif
#endif
socklen_t addrlen = sizeof (addr);
int r;
@ -1165,13 +1174,20 @@ static void fluid_server_socket_run (void *data)
}
else
{
#ifdef IPV6
#ifdef HAVE_INETNTOP
#ifdef IPV6_SUPPORT
inet_ntop(AF_INET6, &addr.sin6_addr, straddr, sizeof(straddr));
#else
inet_ntop(AF_INET, &addr.sin_addr, straddr, sizeof(straddr));
#endif
#endif
#ifdef HAVE_INETNTOP
r = server_socket->func (server_socket->data, client_socket,
straddr);
#else
r = server_socket->func (server_socket->data, client_socket,
inet_ntoa (addr.sin_addr));
#endif
if (r != 0)
fluid_socket_close (client_socket);
}
@ -1184,7 +1200,7 @@ fluid_server_socket_t*
new_fluid_server_socket(int port, fluid_server_func_t func, void* data)
{
fluid_server_socket_t* server_socket;
#ifdef IPV6
#ifdef IPV6_SUPPORT
struct sockaddr_in6 addr;
#else
struct sockaddr_in addr;
@ -1204,7 +1220,7 @@ new_fluid_server_socket(int port, fluid_server_func_t func, void* data)
FLUID_LOG(FLUID_ERR, "Server socket creation error: WSAStartup failed: %d", retval);
return NULL;
}
#ifdef IPV6
#ifdef IPV6_SUPPORT
sock = socket (AF_INET6, SOCK_STREAM, 0);
if (sock == INVALID_SOCKET)
{

View file

@ -112,7 +112,7 @@
#include <io.h>
#endif
#if HAVE_WINDOWS_H
#if defined(WIN32) && HAVE_WINDOWS_H
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>