summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cowgill <jcowgill@debian.org>2018-09-24 09:16:30 +0100
committerJames Cowgill <jcowgill@debian.org>2018-09-24 09:16:30 +0100
commit40a44b2820c7a9e974459e11092f2ff2d351743d (patch)
treeccac9cc137b7fb5328b481f1f358e63165c6fef3
parentb307520e10780536a1d4be5b81fc67d99b6815cd (diff)
New upstream version 0.3.12
-rw-r--r--README.md7
-rw-r--r--common/CompilerDetect.h6
-rw-r--r--common/Endianness.h10
-rw-r--r--common/versionNumber.h2
-rwxr-xr-xconfigure38
-rw-r--r--configure.ac15
-rw-r--r--libopenmpt/dox/changelog.md23
-rw-r--r--libopenmpt/libopenmpt.h18
-rw-r--r--libopenmpt/libopenmpt.hpp14
-rw-r--r--libopenmpt/libopenmpt_ext_impl.cpp10
-rw-r--r--libopenmpt/libopenmpt_modplug.c6
-rw-r--r--libopenmpt/libopenmpt_modplug_cpp.cpp4
-rw-r--r--libopenmpt/libopenmpt_version.h2
-rw-r--r--libopenmpt/libopenmpt_version.mk4
-rw-r--r--man/openmpt123.12
-rw-r--r--openmpt123/openmpt123.hpp2
-rw-r--r--openmpt123/openmpt123_config.hpp4
-rw-r--r--soundlib/InstrumentExtensions.cpp2
-rw-r--r--soundlib/Load_dbm.cpp3
-rw-r--r--soundlib/Load_it.cpp6
-rw-r--r--soundlib/Load_itp.cpp2
-rw-r--r--soundlib/Load_mo3.cpp2
-rw-r--r--soundlib/Load_xm.cpp2
-rw-r--r--soundlib/MIDIMacros.h4
-rw-r--r--soundlib/SampleFormatFLAC.cpp1
-rw-r--r--soundlib/SampleFormatMP3.cpp15
-rw-r--r--soundlib/SampleFormatMediaFoundation.cpp4
-rw-r--r--soundlib/SampleFormatOpus.cpp4
-rw-r--r--soundlib/SampleFormatVorbis.cpp8
-rw-r--r--soundlib/Snd_fx.cpp50
-rw-r--r--soundlib/Sndfile.h2
-rw-r--r--soundlib/Tables.cpp1
-rw-r--r--soundlib/plugins/DigiBoosterEcho.cpp1
-rw-r--r--soundlib/plugins/DigiBoosterEcho.h19
34 files changed, 200 insertions, 93 deletions
diff --git a/README.md b/README.md
index 2ded2f9..9dd48da 100644
--- a/README.md
+++ b/README.md
@@ -181,13 +181,16 @@ For detailed requirements, see `libopenmpt/dox/quickstart.md`.
Run:
- make CONFIG=emscripten
+ make CONFIG=emscripten # for emscripten >= 1.38.1
+
+ make CONFIG=emscripten-old # for emscripten < 1.38.0
Running the test suite on the command line is also supported by using
node.js. Version 0.10.25 or greater has been tested. Earlier versions
might or might not work. Depending on how your distribution calls the
`node.js` binary, you might have to edit
- `build/make/config-emscripten.mk`.
+ `build/make/config-emscripten.mk` or
+ `build/make/config-emscripten-old.mk`.
- Haiku:
diff --git a/common/CompilerDetect.h b/common/CompilerDetect.h
index 2d858bb..efcdea0 100644
--- a/common/CompilerDetect.h
+++ b/common/CompilerDetect.h
@@ -61,7 +61,11 @@
#elif defined(_MSC_VER)
#define MPT_COMPILER_MSVC 1
-#if (_MSC_VER >= 1913)
+#if (_MSC_VER >= 1915)
+#define MPT_COMPILER_MSVC_VERSION MPT_COMPILER_MAKE_VERSION2(2017,8)
+#elif (_MSC_VER >= 1914)
+#define MPT_COMPILER_MSVC_VERSION MPT_COMPILER_MAKE_VERSION2(2017,7)
+#elif (_MSC_VER >= 1913)
#define MPT_COMPILER_MSVC_VERSION MPT_COMPILER_MAKE_VERSION2(2017,6)
#elif (_MSC_VER >= 1912)
#define MPT_COMPILER_MSVC_VERSION MPT_COMPILER_MAKE_VERSION2(2017,5)
diff --git a/common/Endianness.h b/common/Endianness.h
index 52ef2df..7599908 100644
--- a/common/Endianness.h
+++ b/common/Endianness.h
@@ -508,7 +508,7 @@ static MPT_FORCEINLINE float64 DecodeIEEE754binary64(uint64 i)
template<std::size_t hihi, std::size_t hilo, std::size_t lohi, std::size_t lolo>
struct IEEE754binary32Emulated
{
-private:
+public:
typedef IEEE754binary32Emulated<hihi,hilo,lohi,lolo> self_t;
mpt::byte bytes[4];
public:
@@ -569,7 +569,7 @@ public:
template<std::size_t hihihi, std::size_t hihilo, std::size_t hilohi, std::size_t hilolo, std::size_t lohihi, std::size_t lohilo, std::size_t lolohi, std::size_t lololo>
struct IEEE754binary64Emulated
{
-private:
+public:
typedef IEEE754binary64Emulated<hihihi,hihilo,hilohi,hilolo,lohihi,lohilo,lolohi,lololo> self_t;
mpt::byte bytes[8];
public:
@@ -655,7 +655,7 @@ MPT_BINARY_STRUCT(IEEE754binary64EmulatedLE, 8)
struct IEEE754binary32Native
{
-private:
+public:
float32 value;
public:
MPT_FORCEINLINE mpt::byte GetByte(std::size_t i) const
@@ -721,7 +721,7 @@ public:
struct IEEE754binary64Native
{
-private:
+public:
float64 value;
public:
MPT_FORCEINLINE mpt::byte GetByte(std::size_t i) const
@@ -848,7 +848,7 @@ struct packed
public:
typedef T base_type;
typedef Tendian endian_type;
-private:
+public:
#if MPT_PLATFORM_ENDIAN_KNOWN
mpt::byte data[sizeof(base_type)];
#else // !MPT_PLATFORM_ENDIAN_KNOWN
diff --git a/common/versionNumber.h b/common/versionNumber.h
index 62bb61e..173b604 100644
--- a/common/versionNumber.h
+++ b/common/versionNumber.h
@@ -18,7 +18,7 @@ OPENMPT_NAMESPACE_BEGIN
//Version definitions. The only thing that needs to be changed when changing version number.
#define VER_MAJORMAJOR 1
#define VER_MAJOR 27
-#define VER_MINOR 09
+#define VER_MINOR 10
#define VER_MINORMINOR 00
//Version string. For example "1.17.02.28"
diff --git a/configure b/configure
index e973d98..1eae9e4 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libopenmpt 0.3.11+release.autotools.
+# Generated by GNU Autoconf 2.69 for libopenmpt 0.3.12+release.autotools.
#
# Report bugs to <https://bugs.openmpt.org/>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libopenmpt'
PACKAGE_TARNAME='libopenmpt'
-PACKAGE_VERSION='0.3.11+release.autotools'
-PACKAGE_STRING='libopenmpt 0.3.11+release.autotools'
+PACKAGE_VERSION='0.3.12+release.autotools'
+PACKAGE_STRING='libopenmpt 0.3.12+release.autotools'
PACKAGE_BUGREPORT='https://bugs.openmpt.org/'
PACKAGE_URL='https://lib.openmpt.org/'
@@ -1482,7 +1482,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libopenmpt 0.3.11+release.autotools to adapt to many kinds of systems.
+\`configure' configures libopenmpt 0.3.12+release.autotools to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1553,7 +1553,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libopenmpt 0.3.11+release.autotools:";;
+ short | recursive ) echo "Configuration of libopenmpt 0.3.12+release.autotools:";;
esac
cat <<\_ACEOF
@@ -1618,7 +1618,8 @@ Optional Packages:
by default on Linux).
--without-portaudio Disable use of libportaudio.
--without-portaudiocpp Disable use of libportaudiocpp.
- --with-sdl2 Enable use of libsdl2.
+ --with-sdl2 Enable use of libsdl2. Enabling libsdl2
+ automatically disables libsdl.
--with-sdl Enable use of libsdl.
--without-sndfile Disable use of libsndfile.
--without-flac Disable use of libflac.
@@ -1752,7 +1753,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libopenmpt configure 0.3.11+release.autotools
+libopenmpt configure 0.3.12+release.autotools
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2151,7 +2152,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libopenmpt $as_me 0.3.11+release.autotools, which was
+It was created by libopenmpt $as_me 0.3.12+release.autotools, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3022,7 +3023,7 @@ fi
# Define the identity of the package.
PACKAGE='libopenmpt'
- VERSION='0.3.11+release.autotools'
+ VERSION='0.3.12+release.autotools'
cat >>confdefs.h <<_ACEOF
@@ -17186,13 +17187,13 @@ LIBOPENMPT_LTVER_AGE=1
-$as_echo "#define MPT_SVNURL \"https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.3.11\"" >>confdefs.h
+$as_echo "#define MPT_SVNURL \"https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.3.12\"" >>confdefs.h
-$as_echo "#define MPT_SVNVERSION \"10633\"" >>confdefs.h
+$as_echo "#define MPT_SVNVERSION \"10856\"" >>confdefs.h
-$as_echo "#define MPT_SVNDATE \"2018-07-28T11:50:00.062292Z\"" >>confdefs.h
+$as_echo "#define MPT_SVNDATE \"2018-09-24T06:42:52.921590Z\"" >>confdefs.h
$as_echo "#define MPT_PACKAGE true" >>confdefs.h
@@ -18268,6 +18269,8 @@ fi
if test "x$enable_openmpt123" != "xno"; then :
+if test "x$with_sdl2" != "xno"; then :
+
if test "x$with_sdl" = "xyes"; then :
@@ -18346,6 +18349,13 @@ fi
fi
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Skipping libsdl because libsdl2 is enabled." >&5
+$as_echo "$as_me: WARNING: Skipping libsdl because libsdl2 is enabled." >&2;}
+
+
+fi
fi
@@ -22366,7 +22376,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libopenmpt $as_me 0.3.11+release.autotools, which was
+This file was extended by libopenmpt $as_me 0.3.12+release.autotools, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -22433,7 +22443,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libopenmpt config.status 0.3.11+release.autotools
+libopenmpt config.status 0.3.12+release.autotools
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index a811854..2d2c332 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([libopenmpt], [0.3.11+release.autotools], [https://bugs.openmpt.org/], [libopenmpt], [https://lib.openmpt.org/])
+AC_INIT([libopenmpt], [0.3.12+release.autotools], [https://bugs.openmpt.org/], [libopenmpt], [https://lib.openmpt.org/])
AC_PREREQ([2.68])
AC_CONFIG_MACRO_DIR([m4])
@@ -27,9 +27,9 @@ AC_SUBST([LIBOPENMPT_LTVER_CURRENT])
AC_SUBST([LIBOPENMPT_LTVER_REVISION])
AC_SUBST([LIBOPENMPT_LTVER_AGE])
-AC_DEFINE([MPT_SVNURL], ["https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.3.11"], [svn version])
-AC_DEFINE([MPT_SVNVERSION], ["10633"], [svn version])
-AC_DEFINE([MPT_SVNDATE], ["2018-07-28T11:50:00.062292Z"], [svn date])
+AC_DEFINE([MPT_SVNURL], ["https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.3.12"], [svn version])
+AC_DEFINE([MPT_SVNVERSION], ["10856"], [svn version])
+AC_DEFINE([MPT_SVNDATE], ["2018-09-24T06:42:52.921590Z"], [svn date])
AC_DEFINE([MPT_PACKAGE], [true], [is package])
@@ -241,7 +241,7 @@ AS_IF([test "x$with_portaudiocpp" != "xno"],
AM_CONDITIONAL([HAVE_PORTAUDIOCPP], [test x$have_portaudio = x1])
# Optional disabled openmpt123 dependency: libsdl2
-AC_ARG_WITH([sdl2], AS_HELP_STRING([--with-sdl2], [Enable use of libsdl2.]))
+AC_ARG_WITH([sdl2], AS_HELP_STRING([--with-sdl2], [Enable use of libsdl2. Enabling libsdl2 automatically disables libsdl.]))
AS_IF([test "x$enable_openmpt123" != "xno"],[
AS_IF([test "x$with_sdl2" = "xyes"],
[
@@ -253,10 +253,15 @@ AS_IF([test "x$with_sdl2" = "xyes"],
# Optional disabled openmpt123 dependency: libsdl
AC_ARG_WITH([sdl], AS_HELP_STRING([--with-sdl], [Enable use of libsdl.]))
AS_IF([test "x$enable_openmpt123" != "xno"],[
+AS_IF([test "x$with_sdl2" != "xno"],[
AS_IF([test "x$with_sdl" = "xyes"],
[
PKG_CHECK_MODULES([SDL], [sdl], [AC_DEFINE([MPT_WITH_SDL], [], [with libsdl])], [AC_MSG_ERROR([Unable to find libsdl.])])
]
+)],
+ [
+ AC_MSG_WARN([Skipping libsdl because libsdl2 is enabled.])
+ ]
)
])
diff --git a/libopenmpt/dox/changelog.md b/libopenmpt/dox/changelog.md
index b682144..939b4fd 100644
--- a/libopenmpt/dox/changelog.md
+++ b/libopenmpt/dox/changelog.md
@@ -5,6 +5,29 @@ Changelog {#changelog}
For fully detailed change log, please see the source repository directly. This
is just a high-level summary.
+### libopenmpt 0.3.12 (2018-09-24)
+
+ * [**Bug**] openmpt123: Prevent libsdl2 and libsdl from being enabled at the
+ same time because they conflict with each other.
+ * [**Bug**] Make building the JavaScript package work with Emscripten version
+ 1.38.1 or later by disabling WebAssembly generation which generates a
+ different set of output files. Emscripten 1.38.1 changed the default to
+ WebAssembly.
+ * [**Bug**] libmodplug: Setting `SNDMIX_NORESAMPLING` in the C++ API always
+ resulted in linear interpolation instead of nearest neighbour.
+
+ * [**Change**] The old Emscripten configuration which is compatible with
+ Emscripten before 1.38.0 has been renamed to `CONFIG=emscripten-old`.
+
+ * libopenmpt now compiles without warnings with GCC 8.
+
+ * Jump commands on the same row as the end of a pattern loop covering the
+ restart position of the module could cause the module to loop even when
+ looping was disabled.
+ * MO3: Reject overly long MP3 and Vorbis samples.
+ * `play_note` from the libopenmpt_ext interface sometimes silenced the start
+ of a triggered sample.
+
### libopenmpt 0.3.11 (2018-07-28)
* [**Sec**] Crash with some malformed custom tunings in MPTM files (r10615).
diff --git a/libopenmpt/libopenmpt.h b/libopenmpt/libopenmpt.h
index b55a41b..f219b01 100644
--- a/libopenmpt/libopenmpt.h
+++ b/libopenmpt/libopenmpt.h
@@ -189,19 +189,19 @@ LIBOPENMPT_API uint32_t openmpt_get_library_version(void);
*/
LIBOPENMPT_API uint32_t openmpt_get_core_version(void);
-/*! Return a verbose library version string from openmpt_get_string(). \deprecated Please use \code "library_version" \endcode directly. */
+/*! Return a verbose library version string from openmpt_get_string(). \deprecated Please use `"library_version"` directly. */
#define OPENMPT_STRING_LIBRARY_VERSION LIBOPENMPT_DEPRECATED_STRING( "library_version" )
-/*! Return a verbose library features string from openmpt_get_string(). \deprecated Please use \code "library_features" \endcode directly. */
+/*! Return a verbose library features string from openmpt_get_string(). \deprecated Please use `"library_features"` directly. */
#define OPENMPT_STRING_LIBRARY_FEATURES LIBOPENMPT_DEPRECATED_STRING( "library_features" )
-/*! Return a verbose OpenMPT core version string from openmpt_get_string(). \deprecated Please use \code "core_version" \endcode directly. */
+/*! Return a verbose OpenMPT core version string from openmpt_get_string(). \deprecated Please use `"core_version"` directly. */
#define OPENMPT_STRING_CORE_VERSION LIBOPENMPT_DEPRECATED_STRING( "core_version" )
-/*! Return information about the current build (e.g. the build date or compiler used) from openmpt_get_string(). \deprecated Please use \code "build" \endcode directly. */
+/*! Return information about the current build (e.g. the build date or compiler used) from openmpt_get_string(). \deprecated Please use `"build"` directly. */
#define OPENMPT_STRING_BUILD LIBOPENMPT_DEPRECATED_STRING( "build" )
-/*! Return all contributors from openmpt_get_string(). \deprecated Please use \code "credits" \endcode directly. */
+/*! Return all contributors from openmpt_get_string(). \deprecated Please use `"credits"` directly. */
#define OPENMPT_STRING_CREDITS LIBOPENMPT_DEPRECATED_STRING( "credits" )
-/*! Return contact information about libopenmpt from openmpt_get_string(). \deprecated Please use \code "contact" \endcode directly. */
+/*! Return contact information about libopenmpt from openmpt_get_string(). \deprecated Please use `"contact"` directly. */
#define OPENMPT_STRING_CONTACT LIBOPENMPT_DEPRECATED_STRING( "contact" )
-/*! Return the libopenmpt license from openmpt_get_string(). \deprecated Please use \code "license" \endcode directly. */
+/*! Return the libopenmpt license from openmpt_get_string(). \deprecated Please use `"license"` directly. */
#define OPENMPT_STRING_LICENSE LIBOPENMPT_DEPRECATED_STRING( "license" )
/*! \brief Free a string returned by libopenmpt
@@ -503,7 +503,7 @@ LIBOPENMPT_API void * openmpt_error_func_errno_userdata( int * error );
* \remarks openmpt_could_open_probability() expects the complete file data to be eventually available to it, even if it is asked to just parse the header. Verification will be unreliable (both false positives and false negatives), if you pretend that the file is just some few bytes of initial data threshold in size. In order to really just access the first bytes of a file, check in your callback functions whether data or seeking is requested beyond your initial data threshold, and in that case, return an error. openmpt_could_open_probability() will treat this as any other I/O error and return 0.0. You must not expect the correct result in this case. You instead must remember that it asked for more data than you currently want to provide to it and treat this situation as if openmpt_could_open_probability() returned 0.5.
* \sa \ref libopenmpt_c_fileio
* \sa openmpt_stream_callbacks
- * \deprecated Please use openmpt_module_could_open_probability2().
+ * \deprecated Please use openmpt_could_open_probability2().
* \since 0.3.0
*/
LIBOPENMPT_API LIBOPENMPT_DEPRECATED double openmpt_could_open_probability( openmpt_stream_callbacks stream_callbacks, void * stream, double effort, openmpt_log_func logfunc, void * user );
@@ -520,7 +520,7 @@ LIBOPENMPT_API LIBOPENMPT_DEPRECATED double openmpt_could_open_probability( open
* \remarks openmpt_could_open_probability() expects the complete file data to be eventually available to it, even if it is asked to just parse the header. Verification will be unreliable (both false positives and false negatives), if you pretend that the file is just some few bytes of initial data threshold in size. In order to really just access the first bytes of a file, check in your callback functions whether data or seeking is requested beyond your initial data threshold, and in that case, return an error. openmpt_could_open_probability() will treat this as any other I/O error and return 0.0. You must not expect the correct result in this case. You instead must remember that it asked for more data than you currently want to provide to it and treat this situation as if openmpt_could_open_probability() returned 0.5.
* \sa \ref libopenmpt_c_fileio
* \sa openmpt_stream_callbacks
- * \deprecated Please use openmpt_module_could_open_probability2().
+ * \deprecated Please use openmpt_could_open_probability2().
*/
LIBOPENMPT_API LIBOPENMPT_DEPRECATED double openmpt_could_open_propability( openmpt_stream_callbacks stream_callbacks, void * stream, double effort, openmpt_log_func logfunc, void * user );
diff --git a/libopenmpt/libopenmpt.hpp b/libopenmpt/libopenmpt.hpp
index dec7dc8..d6c6926 100644
--- a/libopenmpt/libopenmpt.hpp
+++ b/libopenmpt/libopenmpt.hpp
@@ -173,19 +173,19 @@ LIBOPENMPT_CXX_API std::uint32_t get_core_version();
namespace string {
-//! Return a verbose library version string from openmpt::string::get(). \deprecated Please use \code "library_version" \endcode directly.
+//! Return a verbose library version string from openmpt::string::get(). \deprecated Please use `"library_version"` directly.
LIBOPENMPT_DEPRECATED static const char library_version LIBOPENMPT_ATTR_DEPRECATED [] = "library_version";
-//! Return a verbose library features string from openmpt::string::get(). \deprecated Please use \code "library_features" \endcode directly.
+//! Return a verbose library features string from openmpt::string::get(). \deprecated Please use `"library_features"` directly.
LIBOPENMPT_DEPRECATED static const char library_features LIBOPENMPT_ATTR_DEPRECATED [] = "library_features";
-//! Return a verbose OpenMPT core version string from openmpt::string::get(). \deprecated Please use \code "core_version" \endcode directly.
+//! Return a verbose OpenMPT core version string from openmpt::string::get(). \deprecated Please use `"core_version"` directly.
LIBOPENMPT_DEPRECATED static const char core_version LIBOPENMPT_ATTR_DEPRECATED [] = "core_version";
-//! Return information about the current build (e.g. the build date or compiler used) from openmpt::string::get(). \deprecated Please use \code "build" \endcode directly.
+//! Return information about the current build (e.g. the build date or compiler used) from openmpt::string::get(). \deprecated Please use `"build"` directly.
LIBOPENMPT_DEPRECATED static const char build LIBOPENMPT_ATTR_DEPRECATED [] = "build";
-//! Return all contributors from openmpt::string::get(). \deprecated Please use \code "credits" \endcode directly.
+//! Return all contributors from openmpt::string::get(). \deprecated Please use `"credits"` directly.
LIBOPENMPT_DEPRECATED static const char credits LIBOPENMPT_ATTR_DEPRECATED [] = "credits";
-//! Return contact information about libopenmpt from openmpt::string::get(). \deprecated Please use \code "contact" \endcode directly.
+//! Return contact information about libopenmpt from openmpt::string::get(). \deprecated Please use `"contact"` directly.
LIBOPENMPT_DEPRECATED static const char contact LIBOPENMPT_ATTR_DEPRECATED [] = "contact";
-//! Return the libopenmpt license from openmpt::string::get(). \deprecated Please use \code "license" \endcode directly.
+//! Return the libopenmpt license from openmpt::string::get(). \deprecated Please use `"license"` directly.
LIBOPENMPT_DEPRECATED static const char license LIBOPENMPT_ATTR_DEPRECATED [] = "license";
//! Get library related metadata.
diff --git a/libopenmpt/libopenmpt_ext_impl.cpp b/libopenmpt/libopenmpt_ext_impl.cpp
index 30e4d24..6051266 100644
--- a/libopenmpt/libopenmpt_ext_impl.cpp
+++ b/libopenmpt/libopenmpt_ext_impl.cpp
@@ -275,6 +275,16 @@ namespace openmpt {
chn.nPan = Util::Round<int32_t>( Clamp( panning * 128.0, -128.0, 128.0 ) + 128.0 );
chn.nVolume = Util::Round<int32_t>( Clamp( volume * 256.0, 0.0, 256.0 ) );
+ // Remove channel from list of mixed channels to fix https://bugs.openmpt.org/view.php?id=209
+ // This is required because a previous note on the same channel might have just stopped playing,
+ // but the channel is still in the mix list.
+ // Since the channel volume / etc is only updated every tick in CSoundFile::ReadNote, and we
+ // do not want to duplicate mixmode-dependant logic here, CSoundFile::CreateStereoMix may already
+ // try to mix our newly set up channel at volume 0 if we don't remove it from the list.
+ auto mix_begin = std::begin( m_sndFile->m_PlayState.ChnMix );
+ auto mix_end = std::remove( mix_begin, mix_begin + m_sndFile->m_nMixChannels, free_channel );
+ m_sndFile->m_nMixChannels = static_cast<CHANNELINDEX>( std::distance( mix_begin, mix_end ) );
+
return free_channel;
}
diff --git a/libopenmpt/libopenmpt_modplug.c b/libopenmpt/libopenmpt_modplug.c
index e427b79..0255ee1 100644
--- a/libopenmpt/libopenmpt_modplug.c
+++ b/libopenmpt/libopenmpt_modplug.c
@@ -497,7 +497,8 @@ LIBOPENMPT_MODPLUG_API unsigned int ModPlug_SampleName(ModPlugFile* file, unsign
}
retval = (int)tmpretval;
if(buff){
- strncpy(buff,str,retval+1);
+ memcpy(buff,str,retval+1);
+ buff[retval] = '\0';
}
openmpt_free_string(str);
return retval;
@@ -522,7 +523,8 @@ LIBOPENMPT_MODPLUG_API unsigned int ModPlug_InstrumentName(ModPlugFile* file, un
}
retval = (int)tmpretval;
if(buff){
- strncpy(buff,str,retval+1);
+ memcpy(buff,str,retval+1);
+ buff[retval] = '\0';
}
openmpt_free_string(str);
return retval;
diff --git a/libopenmpt/libopenmpt_modplug_cpp.cpp b/libopenmpt/libopenmpt_modplug_cpp.cpp
index 48878b7..f703e61 100644
--- a/libopenmpt/libopenmpt_modplug_cpp.cpp
+++ b/libopenmpt/libopenmpt_modplug_cpp.cpp
@@ -189,7 +189,7 @@ BOOL CSoundFile::Create( LPCBYTE lpStream, DWORD dwMemLength ) {
try {
openmpt::module * m = new openmpt::module( lpStream, dwMemLength );
set_self( this, m );
- std::strncpy( m_szNames[0], mod->get_metadata("title").c_str(), sizeof( m_szNames[0] ) );
+ std::strncpy( m_szNames[0], mod->get_metadata("title").c_str(), sizeof( m_szNames[0] ) - 1 );
m_szNames[0][ sizeof( m_szNames[0] ) - 1 ] = '\0';
std::string type = mod->get_metadata("type");
m_nType = MOD_TYPE_NONE;
@@ -678,7 +678,7 @@ static int get_filter_length() {
return 8;
} else if ( ( CSoundFile::gdwSoundSetup & SNDMIX_HQRESAMPLER ) == SNDMIX_HQRESAMPLER ) {
return 4;
- } else if ( ( CSoundFile::gdwSoundSetup & SNDMIX_HQRESAMPLER ) == SNDMIX_NORESAMPLING ) {
+ } else if ( ( CSoundFile::gdwSoundSetup & SNDMIX_NORESAMPLING ) == SNDMIX_NORESAMPLING ) {
return 1;
} else {
return 2;
diff --git a/libopenmpt/libopenmpt_version.h b/libopenmpt/libopenmpt_version.h
index 662fe8c..9d697e0 100644
--- a/libopenmpt/libopenmpt_version.h
+++ b/libopenmpt/libopenmpt_version.h
@@ -19,7 +19,7 @@
/*! \brief libopenmpt minor version number */
#define OPENMPT_API_VERSION_MINOR 3
/*! \brief libopenmpt patch version number */
-#define OPENMPT_API_VERSION_PATCH 11
+#define OPENMPT_API_VERSION_PATCH 12
/*! \brief libopenmpt pre-release tag */
#define OPENMPT_API_VERSION_PREREL ""
/*! \brief libopenmpt pre-release flag */
diff --git a/libopenmpt/libopenmpt_version.mk b/libopenmpt/libopenmpt_version.mk
index aa89562..5ffb8a1 100644
--- a/libopenmpt/libopenmpt_version.mk
+++ b/libopenmpt/libopenmpt_version.mk
@@ -1,8 +1,8 @@
LIBOPENMPT_VERSION_MAJOR=0
LIBOPENMPT_VERSION_MINOR=3
-LIBOPENMPT_VERSION_PATCH=11
+LIBOPENMPT_VERSION_PATCH=12
LIBOPENMPT_VERSION_PREREL=
LIBOPENMPT_LTVER_CURRENT=1
-LIBOPENMPT_LTVER_REVISION=11
+LIBOPENMPT_LTVER_REVISION=12
LIBOPENMPT_LTVER_AGE=1
diff --git a/man/openmpt123.1 b/man/openmpt123.1
index d169e1c..20d9d36 100644
--- a/man/openmpt123.1
+++ b/man/openmpt123.1
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4.
-.TH OPENMPT123 "1" "July 2018" "openmpt123 v0.3.11" "User Commands"
+.TH OPENMPT123 "1" "September 2018" "openmpt123 v0.3.12" "User Commands"
.SH NAME
openmpt123 - command line module music player based on libopenmpt
.SH SYNOPSIS
diff --git a/openmpt123/openmpt123.hpp b/openmpt123/openmpt123.hpp
index 8606398..4665685 100644
--- a/openmpt123/openmpt123.hpp
+++ b/openmpt123/openmpt123.hpp
@@ -565,7 +565,7 @@ protected:
sampleQueueMaxFrames = frames;
}
template < typename Tsample >
- float pop_queue() {
+ Tsample pop_queue() {
float val = 0.0f;
if ( !sampleQueue.empty() ) {
val = sampleQueue.front();
diff --git a/openmpt123/openmpt123_config.hpp b/openmpt123/openmpt123_config.hpp
index fc76f0f..9558215 100644
--- a/openmpt123/openmpt123_config.hpp
+++ b/openmpt123/openmpt123_config.hpp
@@ -57,6 +57,10 @@
#endif // MPT_BUILD_MSVC
+#if defined(MPT_WITH_SDL) && defined(MPT_WITH_SDL2)
+#error "MPT_WITH_SDL2 and MPT_WITH_SDL are mutually exclusive."
+#endif
+
#if defined(MPT_WITH_SDL)
#ifndef MPT_NEEDS_THREADS
#define MPT_NEEDS_THREADS
diff --git a/soundlib/InstrumentExtensions.cpp b/soundlib/InstrumentExtensions.cpp
index 1fde039..1f82ba7 100644
--- a/soundlib/InstrumentExtensions.cpp
+++ b/soundlib/InstrumentExtensions.cpp
@@ -444,7 +444,7 @@ void CSoundFile::WriteInstrumentPropertyForAllInstruments(uint32 code, uint16 si
type tmp; \
tmp = file.ReadTruncatedIntLE<type>(fsize); \
STATIC_ASSERT(sizeof(tmp) == sizeof(input-> name )); \
- memcpy(&(input-> name ), &tmp, sizeof(type)); \
+ input-> name = decltype(input-> name )(tmp); \
result = true; \
} \
} \
diff --git a/soundlib/Load_dbm.cpp b/soundlib/Load_dbm.cpp
index 1b86cb1..e17ec3f 100644
--- a/soundlib/Load_dbm.cpp
+++ b/soundlib/Load_dbm.cpp
@@ -610,7 +610,8 @@ bool CSoundFile::ReadDBM(FileReader &file, ModLoadingFlags loadFlags)
mpt::String::Write<mpt::String::nullTerminated>(plugin.Info.szLibraryName, "DigiBooster Pro Echo");
plugin.pluginData.resize(sizeof(DigiBoosterEcho::PluginChunk));
- new (plugin.pluginData.data()) DigiBoosterEcho::PluginChunk(settings[1], settings[3], settings[5], settings[7]);
+ DigiBoosterEcho::PluginChunk chunk = DigiBoosterEcho::PluginChunk::Create(settings[1], settings[3], settings[5], settings[7]);
+ new (plugin.pluginData.data()) DigiBoosterEcho::PluginChunk(chunk);
}
}
diff --git a/soundlib/Load_it.cpp b/soundlib/Load_it.cpp
index da8e1d8..fa6fc2a 100644
--- a/soundlib/Load_it.cpp
+++ b/soundlib/Load_it.cpp
@@ -973,7 +973,7 @@ bool CSoundFile::ReadIT(FileReader &file, ModLoadingFlags loadFlags)
m_nMixLevels = mixLevelsOriginal;
}
// Need to do this before reading the patterns because m_nChannels might be modified by LoadExtendedSongProperties. *sigh*
- LoadExtendedSongProperties(file, &interpretModPlugMade);
+ LoadExtendedSongProperties(file, false, &interpretModPlugMade);
// Reading Patterns
Patterns.ResizeArray(numPats);
@@ -2324,7 +2324,7 @@ void ReadFieldCast(FileReader &chunk, std::size_t size, T &field)
}
-void CSoundFile::LoadExtendedSongProperties(FileReader &file, bool *pInterpretMptMade)
+void CSoundFile::LoadExtendedSongProperties(FileReader &file, bool ignoreChannelCount, bool *pInterpretMptMade)
{
if(!file.ReadMagic("STPM")) // 'MPTS'
{
@@ -2362,7 +2362,7 @@ void CSoundFile::LoadExtendedSongProperties(FileReader &file, bool *pInterpretMp
case MAGIC4BE('R','P','B','.'): ReadField(chunk, size, m_nDefaultRowsPerBeat); break;
case MAGIC4BE('R','P','M','.'): ReadField(chunk, size, m_nDefaultRowsPerMeasure); break;
// FIXME: If there are only PC events on the last few channels in an MPTM MO3, they won't be imported!
- case MAGIC4BE('C','.','.','.'): if(GetType() != MOD_TYPE_XM && m_ContainerType != MOD_CONTAINERTYPE_MO3) { CHANNELINDEX chn = 0; ReadField(chunk, size, chn); m_nChannels = Clamp(chn, m_nChannels, MAX_BASECHANNELS); } break;
+ case MAGIC4BE('C','.','.','.'): if(!ignoreChannelCount) { CHANNELINDEX chn = 0; ReadField(chunk, size, chn); m_nChannels = Clamp(chn, m_nChannels, MAX_BASECHANNELS); } break;
case MAGIC4BE('T','M','.','.'): ReadFieldCast(chunk, size, m_nTempoMode); break;
case MAGIC4BE('P','M','M','.'): ReadFieldCast(chunk, size, m_nMixLevels); break;
case MAGIC4BE('C','W','V','.'): ReadField(chunk, size, m_dwCreatedWithVersion); break;
diff --git a/soundlib/Load_itp.cpp b/soundlib/Load_itp.cpp
index 3930d73..5c4dafa 100644
--- a/soundlib/Load_itp.cpp
+++ b/soundlib/Load_itp.cpp
@@ -377,7 +377,7 @@ bool CSoundFile::ReadITProject(FileReader &file, ModLoadingFlags loadFlags)
if(code == MAGIC4BE('M', 'P', 'T', 'S'))
{
file.SkipBack(4);
- LoadExtendedSongProperties(file);
+ LoadExtendedSongProperties(file, true);
}
m_nMaxPeriod = 0xF000;
diff --git a/soundlib/Load_mo3.cpp b/soundlib/Load_mo3.cpp
index 915e871..c896ea5 100644
--- a/soundlib/Load_mo3.cpp
+++ b/soundlib/Load_mo3.cpp
@@ -1812,7 +1812,7 @@ bool CSoundFile::ReadMO3(FileReader &file, ModLoadingFlags loadFlags)
}
LoadExtendedInstrumentProperties(chunk);
- LoadExtendedSongProperties(chunk);
+ LoadExtendedSongProperties(chunk, true);
if(cwtv > 0x0889 && cwtv <= 0x8FF)
{
m_nType = MOD_TYPE_MPT;
diff --git a/soundlib/Load_xm.cpp b/soundlib/Load_xm.cpp
index 006c17a..b657d5a 100644
--- a/soundlib/Load_xm.cpp
+++ b/soundlib/Load_xm.cpp
@@ -712,7 +712,7 @@ bool CSoundFile::ReadXM(FileReader &file, ModLoadingFlags loadFlags)
LoadExtendedInstrumentProperties(file, &interpretOpenMPTMade);
}
- LoadExtendedSongProperties(file, &interpretOpenMPTMade);
+ LoadExtendedSongProperties(file, true, &interpretOpenMPTMade);
if(interpretOpenMPTMade && m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 17, 00, 00))
{
diff --git a/soundlib/MIDIMacros.h b/soundlib/MIDIMacros.h
index 005736b..6af3c4c 100644
--- a/soundlib/MIDIMacros.h
+++ b/soundlib/MIDIMacros.h
@@ -10,12 +10,16 @@
#pragma once
+OPENMPT_NAMESPACE_BEGIN
+
enum
{
NUM_MACROS = 16, // number of parametered macros
MACRO_LENGTH = 32, // max number of chars per macro
};
+OPENMPT_NAMESPACE_END
+
#ifdef MODPLUG_TRACKER
#include "plugins/PluginStructs.h"
#endif // MODPLUG_TRACKER
diff --git a/soundlib/SampleFormatFLAC.cpp b/soundlib/SampleFormatFLAC.cpp
index 10c0df9..b52bcec 100644
--- a/soundlib/SampleFormatFLAC.cpp
+++ b/soundlib/SampleFormatFLAC.cpp
@@ -171,6 +171,7 @@ struct FLACDecoder
sample.uFlags.set(CHN_16BIT, metadata->data.stream_info.bits_per_sample > 8);
sample.uFlags.set(CHN_STEREO, metadata->data.stream_info.channels > 1);
sample.nLength = mpt::saturate_cast<SmpLength>(metadata->data.stream_info.total_samples);
+ LimitMax(sample.nLength, MAX_SAMPLE_LENGTH);
sample.nC5Speed = metadata->data.stream_info.sample_rate;
client.ready = (sample.AllocateSample() != 0);
} else if(metadata->type == FLAC__METADATA_TYPE_APPLICATION && !memcmp(metadata->data.application.id, "riff", 4) && client.ready)
diff --git a/soundlib/SampleFormatMP3.cpp b/soundlib/SampleFormatMP3.cpp
index caae379..a48ea48 100644
--- a/soundlib/SampleFormatMP3.cpp
+++ b/soundlib/SampleFormatMP3.cpp
@@ -237,6 +237,12 @@ bool CSoundFile::ReadMP3Sample(SAMPLEINDEX sample, FileReader &file, bool mo3Dec
return false;
}
+ if(length > MAX_SAMPLE_LENGTH)
+ {
+ mpg123_delete(mh);
+ return false;
+ }
+
DestroySampleThreadsafe(sample);
if(!mo3Decode)
{
@@ -303,6 +309,10 @@ bool CSoundFile::ReadMP3Sample(SAMPLEINDEX sample, FileReader &file, bool mo3Dec
break;
}
}
+ if((raw_sample_data.size() / channels) > MAX_SAMPLE_LENGTH)
+ {
+ break;
+ }
} while((bytes_left >= 0) && (frame_size > 0));
mp3_free(mp3);
@@ -312,6 +322,11 @@ bool CSoundFile::ReadMP3Sample(SAMPLEINDEX sample, FileReader &file, bool mo3Dec
return false;
}
+ if((raw_sample_data.size() / channels) > MAX_SAMPLE_LENGTH)
+ {
+ return false;
+ }
+
DestroySampleThreadsafe(sample);
if(!mo3Decode)
{
diff --git a/soundlib/SampleFormatMediaFoundation.cpp b/soundlib/SampleFormatMediaFoundation.cpp
index b97d053..eafa359 100644
--- a/soundlib/SampleFormatMediaFoundation.cpp
+++ b/soundlib/SampleFormatMediaFoundation.cpp
@@ -392,6 +392,10 @@ bool CSoundFile::ReadMediaFoundationSample(SAMPLEINDEX sample, FileReader &file,
MPT_MF_CHECKED(buffer->Lock(&data, NULL, &dataSize));
rawData.insert(rawData.end(), mpt::byte_cast<char*>(data), mpt::byte_cast<char*>(data + dataSize));
MPT_MF_CHECKED(buffer->Unlock());
+ if(rawData.size() / numChannels / (bitsPerSample / 8) > MAX_SAMPLE_LENGTH)
+ {
+ break;
+ }
}
mptMFSafeRelease(&buffer);
mptMFSafeRelease(&mfSample);
diff --git a/soundlib/SampleFormatOpus.cpp b/soundlib/SampleFormatOpus.cpp
index 5c92849..6f66adf 100644
--- a/soundlib/SampleFormatOpus.cpp
+++ b/soundlib/SampleFormatOpus.cpp
@@ -132,6 +132,10 @@ bool CSoundFile::ReadOpusSample(SAMPLEINDEX sample, FileReader &file)
// other errors are fatal, stop decoding
eof = true;
}
+ if((raw_sample_data.size() / channels) > MAX_SAMPLE_LENGTH)
+ {
+ break;
+ }
}
op_free(of);
diff --git a/soundlib/SampleFormatVorbis.cpp b/soundlib/SampleFormatVorbis.cpp
index f97c25d..78ccf7d 100644
--- a/soundlib/SampleFormatVorbis.cpp
+++ b/soundlib/SampleFormatVorbis.cpp
@@ -212,6 +212,10 @@ bool CSoundFile::ReadVorbisSample(SAMPLEINDEX sample, FileReader &file)
CopyChannelToInterleaved<SC::Convert<int16, float> >(&(raw_sample_data[0]) + offset * channels, output[chn], channels, decodedSamples, chn);
}
offset += decodedSamples;
+ if((raw_sample_data.size() / channels) > MAX_SAMPLE_LENGTH)
+ {
+ break;
+ }
}
}
}
@@ -281,6 +285,10 @@ bool CSoundFile::ReadVorbisSample(SAMPLEINDEX sample, FileReader &file)
CopyChannelToInterleaved<SC::Convert<int16, float> >(&(raw_sample_data[0]) + offset * channels, output[chn], channels, decodedSamples, chn);
}
offset += decodedSamples;
+ if((raw_sample_data.size() / channels) > MAX_SAMPLE_LENGTH)
+ {
+ break;
+ }
}
error = stb_vorbis_get_error(vorb);
}
diff --git a/soundlib/Snd_fx.cpp b/soundlib/Snd_fx.cpp
index 16e52a6..c00b92e 100644
--- a/soundlib/Snd_fx.cpp
+++ b/soundlib/Snd_fx.cpp
@@ -3394,29 +3394,6 @@ bool CSoundFile::ProcessEffects()
const bool doBreakRow = (nBreakRow != ROWINDEX_INVALID);
const bool doPosJump = (nPosJump != ORDERINDEX_INVALID);
- // Pattern Loop
- if(doPatternLoop)
- {
- m_PlayState.m_nNextOrder = m_PlayState.m_nCurrentOrder;
- m_PlayState.m_nNextRow = nPatLoopRow;
- if(m_PlayState.m_nPatternDelay)
- {
- m_PlayState.m_nNextRow++;
- }
-
- // IT Compatibility: If the restart row is past the end of the current pattern
- // (e.g. when continued from a previous pattern without explicit SB0 effect), continue the next pattern.
- // Test case: LoopStartAfterPatternEnd.it
- if(nPatLoopRow >= Patterns[m_PlayState.m_nPattern].GetNumRows())
- {
- m_PlayState.m_nNextOrder++;
- m_PlayState.m_nNextRow = 0;
- }
-
- // As long as the pattern loop is running, mark the looped rows as not visited yet
- visitedSongRows.ResetPatternLoop(m_PlayState.m_nCurrentOrder, nPatLoopRow);
- }
-
// Pattern Break / Position Jump only if no loop running
// Exception: FastTracker 2 in all cases, Impulse Tracker in case of position jump
// Test case for FT2 exception: PatLoop-Jumps.xm, PatLoop-Various.xm
@@ -3447,8 +3424,28 @@ bool CSoundFile::ProcessEffects()
m_PlayState.m_nNextRow = nBreakRow;
if(!m_SongFlags[SONG_PATTERNLOOP])
m_PlayState.m_nNextOrder = nPosJump;
- }
+ } else if(doPatternLoop)
+ {
+ // Pattern Loop
+ m_PlayState.m_nNextOrder = m_PlayState.m_nCurrentOrder;
+ m_PlayState.m_nNextRow = nPatLoopRow;
+ if(m_PlayState.m_nPatternDelay)
+ {
+ m_PlayState.m_nNextRow++;
+ }
+ // IT Compatibility: If the restart row is past the end of the current pattern
+ // (e.g. when continued from a previous pattern without explicit SB0 effect), continue the next pattern.
+ // Test case: LoopStartAfterPatternEnd.it
+ if(nPatLoopRow >= Patterns[m_PlayState.m_nPattern].GetNumRows())
+ {
+ m_PlayState.m_nNextOrder++;
+ m_PlayState.m_nNextRow = 0;
+ }
+
+ // As long as the pattern loop is running, mark the looped rows as not visited yet
+ visitedSongRows.ResetPatternLoop(m_PlayState.m_nCurrentOrder, nPatLoopRow);
+ }
}
return true;
}
@@ -5463,7 +5460,12 @@ void CSoundFile::SetTempo(TEMPO param, bool setFromUI)
// ProTracker sets the tempo after the first tick.
// Note: The case of one tick per row is handled in ProcessRow() instead.
// Test case: TempoChange.mod
+#if MPT_MSVC_AT_LEAST(2017,8)
+ // Work-around MSVC getting confused about deduced const input type in noexcept operator inside noexcept condition.
+ m_PlayState.m_nMusicTempo.SetRaw(std::min(param.GetRaw(), specs.GetTempoMax().GetRaw()));
+#else
m_PlayState.m_nMusicTempo = std::min(param, specs.GetTempoMax());
+#endif
} else if(param < minTempo && !m_SongFlags[SONG_FIRSTTICK])
{
// Tempo Slide
diff --git a/soundlib/Sndfile.h b/soundlib/Sndfile.h
index 9142e96..176fa56 100644
--- a/soundlib/Sndfile.h
+++ b/soundlib/Sndfile.h
@@ -779,7 +779,7 @@ public:
void SaveExtendedInstrumentProperties(INSTRUMENTINDEX nInstruments, FILE* f) const;
void SaveExtendedSongProperties(FILE* f) const;
#endif // MODPLUG_NO_FILESAVE
- void LoadExtendedSongProperties(FileReader &file, bool* pInterpretMptMade = nullptr);
+ void LoadExtendedSongProperties(FileReader &file, bool ignoreChannelCount, bool* pInterpretMptMade = nullptr);
void LoadMPTMProperties(FileReader &file, uint16 cwtv);
mpt::ustring GetSchismTrackerVersion(uint16 cwtv);
diff --git a/soundlib/Tables.cpp b/soundlib/Tables.cpp
index d4beaab..7a1606a 100644
--- a/soundlib/Tables.cpp
+++ b/soundlib/Tables.cpp
@@ -179,6 +179,7 @@ static constexpr ModCharsetInfo ModCharsetInfos[] =
{ MOD_TYPE_AMS , mpt::CharsetCP437 },
{ MOD_TYPE_AMS2, mpt::CharsetCP437 },
{ MOD_TYPE_DSM , mpt::CharsetCP437 },
+ { MOD_TYPE_PLM , mpt::CharsetCP437 },
// Windows
{ MOD_TYPE_MT2 , mpt::CharsetWindows1252},
{ MOD_TYPE_MPT , mpt::CharsetWindows1252},
diff --git a/soundlib/plugins/DigiBoosterEcho.cpp b/soundlib/plugins/DigiBoosterEcho.cpp
index 1cd2c94..dee5c78 100644
--- a/soundlib/plugins/DigiBoosterEcho.cpp
+++ b/soundlib/plugins/DigiBoosterEcho.cpp
@@ -27,6 +27,7 @@ DigiBoosterEcho::DigiBoosterEcho(VSTPluginLib &factory, CSoundFile &sndFile, SND
, m_bufferSize(0)
, m_writePos(0)
, m_sampleRate(sndFile.GetSampleRate())
+ , m_chunk(PluginChunk::Default())
{
m_mixBuffer.Initialize(2, 2);
InsertIntoFactoryList();
diff --git a/soundlib/plugins/DigiBoosterEcho.h b/soundlib/plugins/DigiBoosterEcho.h
index 0a8e529..61e9e9c 100644
--- a/soundlib/plugins/DigiBoosterEcho.h
+++ b/soundlib/plugins/DigiBoosterEcho.h
@@ -32,15 +32,20 @@ public:
char id[4];
uint8 param[kEchoNumParameters];
- PluginChunk(uint8 delay = 80, uint8 feedback = 150, uint8 mix = 80, uint8 cross = 255)
+ static PluginChunk Create(uint8 delay, uint8 feedback, uint8 mix, uint8 cross)
{
- memcpy(id, "Echo", 4);
- param[kEchoDelay] = delay;
- param[kEchoFeedback] = feedback;
- param[kEchoMix] = mix;
- param[kEchoCross] = cross;
-
STATIC_ASSERT(sizeof(PluginChunk) == 8);
+ PluginChunk result;
+ memcpy(result.id, "Echo", 4);
+ result.param[kEchoDelay] = delay;
+ result.param[kEchoFeedback] = feedback;
+ result.param[kEchoMix] = mix;
+ result.param[kEchoCross] = cross;
+ return result;
+ }
+ static PluginChunk Default()
+ {
+ return Create(80, 150, 80, 255);
}
};