diff --git a/CMakeLists.txt b/CMakeLists.txt index 920e1026..bf2c8e4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ set ( PACKAGE "fluidsynth" ) # FluidSynth package version set ( FLUIDSYNTH_VERSION_MAJOR 2 ) set ( FLUIDSYNTH_VERSION_MINOR 0 ) -set ( FLUIDSYNTH_VERSION_MICRO 2 ) +set ( FLUIDSYNTH_VERSION_MICRO 3 ) set ( VERSION "${FLUIDSYNTH_VERSION_MAJOR}.${FLUIDSYNTH_VERSION_MINOR}.${FLUIDSYNTH_VERSION_MICRO}" ) set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" ) @@ -43,8 +43,8 @@ set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" ) # if any interfaces have been removed/changed (compatibility broken): AGE=0 # This is not exactly the same algorithm as the libtool one, but the results are the same. set ( LIB_VERSION_CURRENT 2 ) -set ( LIB_VERSION_AGE 0 ) -set ( LIB_VERSION_REVISION 2 ) +set ( LIB_VERSION_AGE 1 ) +set ( LIB_VERSION_REVISION 0 ) set ( LIB_VERSION_INFO "${LIB_VERSION_CURRENT}.${LIB_VERSION_AGE}.${LIB_VERSION_REVISION}" ) diff --git a/doc/Doxyfile b/doc/Doxyfile index 7f3b2f46..4558d926 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -5,7 +5,7 @@ #--------------------------------------------------------------------------- DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = libfluidsynth -PROJECT_NUMBER = 2.0.2 +PROJECT_NUMBER = 2.0.3 OUTPUT_DIRECTORY = api CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English diff --git a/doc/fluidsynth-v20-devdoc.txt b/doc/fluidsynth-v20-devdoc.txt index 75428b85..f578a8fa 100644 --- a/doc/fluidsynth-v20-devdoc.txt +++ b/doc/fluidsynth-v20-devdoc.txt @@ -7,9 +7,9 @@ \author Josh Green \author David Henningsson \author Tom Moebert -\author Copyright © 2003-2018 Peter Hanappe, Conrad Berhörster, Antoine Schmitt, Pedro López-Cabanillas, Josh Green, David Henningsson, Tom Moebert -\version Revision 2.0.2 -\date 2018-11-18 +\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.3 +\date 2019-01-01 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. @@ -64,6 +64,7 @@ What is FluidSynth? \section NewIn2_0_3 Whats new in 2.0.3? +- fix incorrect behaviour of fluid_sample_set_sound_data() - add missing getters for midi events: - fluid_midi_event_get_text() - fluid_midi_event_get_lyrics() diff --git a/include/fluidsynth/sfont.h b/include/fluidsynth/sfont.h index 55413a9e..0df4d6d4 100644 --- a/include/fluidsynth/sfont.h +++ b/include/fluidsynth/sfont.h @@ -184,12 +184,10 @@ typedef void (*fluid_sfont_iteration_start_t)(fluid_sfont_t *sfont); /** * Virtual SoundFont preset iteration function. * @param sfont Virtual SoundFont - * @param preset Caller supplied uninitialized buffer to fill in with current preset information * @return NULL when no more presets are available, otherwise the a pointer to the current preset * - * Should store preset information to the caller supplied \a preset structure - * and advance the internal iteration state to the next preset for subsequent - * calls. + * Returns preset information to the caller. The returned buffer is only valid until a subsequent + * call to this function. */ typedef fluid_preset_t *(*fluid_sfont_iteration_next_t)(fluid_sfont_t *sfont); diff --git a/src/fluidsynth.c b/src/fluidsynth.c index 427c5541..bc0ed245 100644 --- a/src/fluidsynth.c +++ b/src/fluidsynth.c @@ -1034,7 +1034,7 @@ void print_welcome() { printf("FluidSynth runtime version %s\n" - "Copyright (C) 2000-2018 Peter Hanappe and others.\n" + "Copyright (C) 2000-2019 Peter Hanappe and others.\n" "Distributed under the LGPL license.\n" "SoundFont(R) is a registered trademark of E-mu Systems, Inc.\n\n", fluid_version_str()); diff --git a/src/midi/fluid_midi.c b/src/midi/fluid_midi.c index 59ad3173..1a394f81 100644 --- a/src/midi/fluid_midi.c +++ b/src/midi/fluid_midi.c @@ -94,13 +94,13 @@ int fluid_is_midifile(const char *filename) { FILE *fp = FLUID_FOPEN(filename, "rb"); uint32_t id; - int retcode = 0; + int retcode = FALSE; do { if(fp == NULL) { - break; + return retcode; } if(FLUID_FREAD(&id, sizeof(id), 1, fp) != 1) diff --git a/src/sfloader/fluid_sffile.c b/src/sfloader/fluid_sffile.c index 0725e1f3..302eea72 100644 --- a/src/sfloader/fluid_sffile.c +++ b/src/sfloader/fluid_sffile.c @@ -336,13 +336,13 @@ int fluid_is_soundfont(const char *filename) { FILE *fp = FLUID_FOPEN(filename, "rb"); uint32_t fcc; - int retcode = 0; + int retcode = FALSE; do { if(fp == NULL) { - break; + return retcode; } if(FLUID_FREAD(&fcc, sizeof(fcc), 1, fp) != 1) diff --git a/src/sfloader/fluid_sfont.c b/src/sfloader/fluid_sfont.c index 405bec6c..548a80ab 100644 --- a/src/sfloader/fluid_sfont.c +++ b/src/sfloader/fluid_sfont.c @@ -512,9 +512,13 @@ delete_fluid_sample(fluid_sample_t *sample) /** * Returns the size of the fluid_sample_t structure. * - * Useful in low latency scenarios e.g. to allocate a sample on the stack. + * Useful in low latency scenarios e.g. to allocate a pool of samples. * * @return Size of fluid_sample_t in bytes + * + * @note It is recommend to zero initialize the memory before using the object. + * + * @warning Do NOT allocate samples on the stack and assign them to a voice! */ size_t fluid_sample_sizeof() { @@ -563,16 +567,17 @@ fluid_sample_set_sound_data(fluid_sample_t *sample, fluid_return_val_if_fail(sample != NULL, FLUID_FAILED); fluid_return_val_if_fail(data != NULL, FLUID_FAILED); - fluid_return_val_if_fail(nbframes == 0, FLUID_FAILED); + fluid_return_val_if_fail(nbframes != 0, FLUID_FAILED); /* in case we already have some data */ if((sample->data != NULL || sample->data24 != NULL) && sample->auto_free) { FLUID_FREE(sample->data); FLUID_FREE(sample->data24); - sample->data = NULL; - sample->data24 = NULL; } + + sample->data = NULL; + sample->data24 = NULL; if(copy_data) { @@ -635,6 +640,8 @@ error_rec: FLUID_LOG(FLUID_ERR, "Out of memory"); FLUID_FREE(sample->data); FLUID_FREE(sample->data24); + sample->data = NULL; + sample->data24 = NULL; return FLUID_FAILED; #undef SAMPLE_LOOP_MARGIN diff --git a/src/sfloader/fluid_sfont.h b/src/sfloader/fluid_sfont.h index 24773353..28609e96 100644 --- a/src/sfloader/fluid_sfont.h +++ b/src/sfloader/fluid_sfont.h @@ -183,8 +183,6 @@ struct _fluid_sample_t * @return Should return #FLUID_OK */ int (*notify)(fluid_sample_t *sample, int reason); - - void *userdata; /**< User defined data */ }; diff --git a/src/utils/fluid_sys.c b/src/utils/fluid_sys.c index 4ac1344b..d686737f 100644 --- a/src/utils/fluid_sys.c +++ b/src/utils/fluid_sys.c @@ -1214,7 +1214,11 @@ fluid_istream_readline(fluid_istream_t in, fluid_ostream_t out, char *prompt, FLUID_SNPRINTF(buf, len, "%s", line); buf[len - 1] = 0; - add_history(buf); + + if(buf[0] != '\0') + { + add_history(buf); + } free(line); return 1;