Merge branch '2.0.x' into master

This commit is contained in:
derselbst 2019-04-18 20:21:01 +02:00
commit c9a670d26c
8 changed files with 53 additions and 37 deletions

View file

@ -9,7 +9,7 @@
\author Tom Moebert
\author Copyright © 2003-2019 Peter Hanappe, Conrad Berhörster, Antoine Schmitt, Pedro López-Cabanillas, Josh Green, David Henningsson, Tom Moebert
\version Revision 2.0.5
\date 2019-04-13
\date 2019-04-17
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,7 @@ All the source code examples in this document are in the public domain; you can
- \ref Disclaimer
- \ref Introduction
- \ref NewIn2_0_5
- \ref NewIn2_0_3
- \ref NewIn2_0_2
- \ref NewIn2_0_0
@ -62,6 +63,11 @@ What is FluidSynth?
- FluidSynth is open source, in active development. For more details, take a look at http://www.fluidsynth.org
\section NewIn2_0_5 Whats new in 2.0.5?
- fluid_synth_process() omitted audio samples when called with arbitrary sample counts that were not a multiple of fluid_synth_get_internal_bufsize()
- fluid_synth_sfunload() was not releasing sample buffers of SoundFont3 files if <a href="fluidsettings.xml#synth.dynamic-sample-loading">"synth.dynamic-sample-loading"</a> was set to FALSE
\section NewIn2_0_3 Whats new in 2.0.3?
- fix incorrect behaviour of fluid_sample_set_sound_data()
@ -141,7 +147,7 @@ FluidSynths major version was bumped. The API was reworked, deprecated functions
- remove deprecated fluid_synth_select_tuning(), use fluid_synth_activate_tuning(synth, chan, bank, prog, FALSE) instead
- remove deprecated fluid_synth_reset_tuning(), use fluid_synth_deactivate_tuning(synth, chan, FALSE) instead
- remove deprecated FLUID_HINT_INTEGER
- remove deprecated fluid_synth_set_gen2() as there doesnt seem to be a use case for absolute generator values
- remove deprecated fluid_synth_set_gen2() as there doesn't seem to be a use case for absolute generator values
- remove deprecated "synth.parallel-render" setting
- remove obsolete "audio.[out|in]put-channels" settings
- remove unimplemented "synth.dump" setting

View file

@ -99,13 +99,7 @@ int fluid_is_midifile(const char *filename)
do
{
if(!fluid_file_test(filename, G_FILE_TEST_IS_REGULAR))
{
return retcode;
}
// file seems to exist and is a regular file or a symlink to such
if((fp = FLUID_FOPEN(filename, "rb")) == NULL)
if((fp = fluid_file_open(filename, NULL)) == NULL)
{
return retcode;
}

View file

@ -436,7 +436,7 @@ int fluid_defsfont_load(fluid_defsfont_t *defsfont, const fluid_file_callbacks_t
if(sfdata == NULL)
{
FLUID_LOG(FLUID_ERR, "Couldn't load soundfont file");
/* error message already printed */
return FLUID_FAILED;
}

View file

@ -340,13 +340,7 @@ int fluid_is_soundfont(const char *filename)
do
{
if(!fluid_file_test(filename, G_FILE_TEST_IS_REGULAR))
{
return retcode;
}
// file seems to exist and is a regular file or a symlink to such
if((fp = FLUID_FOPEN(filename, "rb")) == NULL)
if((fp = fluid_file_open(filename, NULL)) == NULL)
{
return retcode;
}

View file

@ -24,26 +24,14 @@
void *default_fopen(const char *path)
{
FILE* handle;
const char* msg;
FILE* handle = fluid_file_open(path, &msg);
if(!fluid_file_test(path, G_FILE_TEST_EXISTS))
if(handle == NULL)
{
FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Unable to load non-existent file. ('%s')", path);
return NULL;
FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Failed to open '%s': %s", path, msg);
}
if(!fluid_file_test(path, G_FILE_TEST_IS_REGULAR))
{
FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Refusing to load non-regular file! ('%s')", path);
return NULL;
}
if((handle = FLUID_FOPEN(path, "rb")) == NULL)
{
FLUID_LOG(FLUID_ERR, "fluid_sfloader_load(): Specified file does not exists or insufficient permissions to open it! ('%s')", path);
return NULL;
}
return handle;
}

View file

@ -1598,3 +1598,36 @@ void delete_fluid_server_socket(fluid_server_socket_t *server_socket)
}
#endif // NETWORK_SUPPORT
FILE* fluid_file_open(const char* path, const char** errMsg)
{
static const char ErrExist[] = "File does not exist.";
static const char ErrRegular[] = "File is not regular, refusing to open it.";
static const char ErrNull[] = "File does not exists or insufficient permissions to open it.";
FILE* handle = NULL;
if(!g_file_test(path, G_FILE_TEST_EXISTS))
{
if(errMsg != NULL)
{
*errMsg = ErrExist;
}
}
else if(!g_file_test(path, G_FILE_TEST_IS_REGULAR))
{
if(errMsg != NULL)
{
*errMsg = ErrRegular;
}
}
else if((handle = FLUID_FOPEN(path, "rb")) == NULL)
{
if(errMsg != NULL)
{
*errMsg = ErrNull;
}
}
return handle;
}

View file

@ -485,7 +485,7 @@ fluid_ostream_t fluid_socket_get_ostream(fluid_socket_t sock);
typedef GStatBuf fluid_stat_buf_t;
#endif
#define fluid_file_test g_file_test
FILE* fluid_file_open(const char* filename, const char** errMsg);
/* Profiling */
#if WITH_PROFILING

View file

@ -5,12 +5,13 @@
#include "fluid_synth.h"
#include <string.h>
static int smpl;
// static const int CHANNELS=16;
static const int SAMPLES=1024;
enum { SAMPLES=1024 };
int render_one_mock(fluid_synth_t *synth, int blocks)
{
static int smpl;
fluid_real_t *left_in, *fx_left_in;
fluid_real_t *right_in, *fx_right_in;