You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(10) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(2) |
May
(10) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2008 |
Jan
(6) |
Feb
(4) |
Mar
(5) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(4) |
Aug
(6) |
Sep
(2) |
Oct
(9) |
Nov
(1) |
Dec
(4) |
2009 |
Jan
(9) |
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
(6) |
Jun
(18) |
Jul
(33) |
Aug
(39) |
Sep
(33) |
Oct
(24) |
Nov
(23) |
Dec
(22) |
2010 |
Jan
(29) |
Feb
(32) |
Mar
(51) |
Apr
(17) |
May
(31) |
Jun
(21) |
Jul
(32) |
Aug
(28) |
Sep
(35) |
Oct
(27) |
Nov
(11) |
Dec
(13) |
2011 |
Jan
(14) |
Feb
(13) |
Mar
(27) |
Apr
(27) |
May
(28) |
Jun
(20) |
Jul
(43) |
Aug
(52) |
Sep
(66) |
Oct
(61) |
Nov
(11) |
Dec
(8) |
2012 |
Jan
(20) |
Feb
(30) |
Mar
(38) |
Apr
(21) |
May
(33) |
Jun
(21) |
Jul
(25) |
Aug
(9) |
Sep
(24) |
Oct
(42) |
Nov
(27) |
Dec
(41) |
2013 |
Jan
(20) |
Feb
(35) |
Mar
(156) |
Apr
(298) |
May
(258) |
Jun
(201) |
Jul
(105) |
Aug
(60) |
Sep
(193) |
Oct
(245) |
Nov
(280) |
Dec
(194) |
2014 |
Jan
(63) |
Feb
(202) |
Mar
(200) |
Apr
(23) |
May
(53) |
Jun
(105) |
Jul
(18) |
Aug
(26) |
Sep
(110) |
Oct
(187) |
Nov
(97) |
Dec
(74) |
2015 |
Jan
(45) |
Feb
(55) |
Mar
(116) |
Apr
(116) |
May
(193) |
Jun
(164) |
Jul
(50) |
Aug
(111) |
Sep
(98) |
Oct
(71) |
Nov
(103) |
Dec
(63) |
2016 |
Jan
(33) |
Feb
(101) |
Mar
(182) |
Apr
(139) |
May
(140) |
Jun
(103) |
Jul
(165) |
Aug
(286) |
Sep
(208) |
Oct
(127) |
Nov
(97) |
Dec
(54) |
2017 |
Jan
(64) |
Feb
(335) |
Mar
(202) |
Apr
(212) |
May
(139) |
Jun
(127) |
Jul
(294) |
Aug
(154) |
Sep
(170) |
Oct
(152) |
Nov
(156) |
Dec
(62) |
2018 |
Jan
(168) |
Feb
(237) |
Mar
(196) |
Apr
(174) |
May
(174) |
Jun
(161) |
Jul
(127) |
Aug
(88) |
Sep
(149) |
Oct
(66) |
Nov
(52) |
Dec
(135) |
2019 |
Jan
(146) |
Feb
(126) |
Mar
(104) |
Apr
(58) |
May
(60) |
Jun
(28) |
Jul
(197) |
Aug
(129) |
Sep
(141) |
Oct
(148) |
Nov
(63) |
Dec
(100) |
2020 |
Jan
(74) |
Feb
(37) |
Mar
(59) |
Apr
(154) |
May
(194) |
Jun
(133) |
Jul
(313) |
Aug
(197) |
Sep
(49) |
Oct
(162) |
Nov
(143) |
Dec
(57) |
2021 |
Jan
(120) |
Feb
(107) |
Mar
(314) |
Apr
(157) |
May
(524) |
Jun
(169) |
Jul
(72) |
Aug
(133) |
Sep
(135) |
Oct
(146) |
Nov
(198) |
Dec
(325) |
2022 |
Jan
(409) |
Feb
(249) |
Mar
(138) |
Apr
(95) |
May
(102) |
Jun
(221) |
Jul
(66) |
Aug
(120) |
Sep
(192) |
Oct
(131) |
Nov
(53) |
Dec
(171) |
2023 |
Jan
(357) |
Feb
(82) |
Mar
(168) |
Apr
(218) |
May
(196) |
Jun
(86) |
Jul
(115) |
Aug
(49) |
Sep
(190) |
Oct
(102) |
Nov
(45) |
Dec
(76) |
2024 |
Jan
(86) |
Feb
(50) |
Mar
(324) |
Apr
(209) |
May
(197) |
Jun
(232) |
Jul
(194) |
Aug
(247) |
Sep
(219) |
Oct
(266) |
Nov
(328) |
Dec
(304) |
2025 |
Jan
(191) |
Feb
(115) |
Mar
(137) |
Apr
(32) |
May
(126) |
Jun
(403) |
Jul
(213) |
Aug
(189) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <sv...@op...> - 2024-03-16 22:00:27
|
Author: sagamusix Date: Sat Mar 16 23:00:16 2024 New Revision: 20384 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20384 Log: [Doc] libopenmpt: Update changelog. Modified: branches/OpenMPT-1.28/libopenmpt/dox/changelog.md Modified: branches/OpenMPT-1.28/libopenmpt/dox/changelog.md ============================================================================== --- branches/OpenMPT-1.28/libopenmpt/dox/changelog.md Sat Mar 16 22:59:42 2024 (r20383) +++ branches/OpenMPT-1.28/libopenmpt/dox/changelog.md Sat Mar 16 23:00:16 2024 (r20384) @@ -16,6 +16,11 @@ allocation (64bit platforms) when reading malformed data from unseekable files (r20353). + * IT: In the previous version, Zxx macros in IT files made with older MPT + versions were no longer working. + * An older bugfix for undefined behaviour in the Distortion DMO plugin was + incorrect, causing the distorted sound to be different in some situations. + ### libopenmpt 0.4.39 (2024-03-03) * Setting all possible `load_skip` flags resulted in nothing being loaded at |
From: <sv...@op...> - 2024-03-16 21:59:59
|
Author: sagamusix Date: Sat Mar 16 22:59:42 2024 New Revision: 20383 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20383 Log: [Doc] libopenmpt: Update changelog. Modified: branches/OpenMPT-1.29/libopenmpt/dox/changelog.md Modified: branches/OpenMPT-1.29/libopenmpt/dox/changelog.md ============================================================================== --- branches/OpenMPT-1.29/libopenmpt/dox/changelog.md Sat Mar 16 22:58:11 2024 (r20382) +++ branches/OpenMPT-1.29/libopenmpt/dox/changelog.md Sat Mar 16 22:59:42 2024 (r20383) @@ -18,6 +18,11 @@ * [**Sec**] DMF: Possible null-pointer write or excessive memory allocation when reading DMF files (r20325). + * IT: In the previous version, Zxx macros in IT files made with older MPT + versions were no longer working. + * An older bugfix for undefined behaviour in the Distortion DMO plugin was + incorrect, causing the distorted sound to be different in some situations. + * xmp-openmpt: Metadata retrievel for playlist items was broken. ### libopenmpt 0.5.27 (2024-03-03) |
From: <sv...@op...> - 2024-03-16 21:58:27
|
Author: sagamusix Date: Sat Mar 16 22:58:11 2024 New Revision: 20382 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20382 Log: [Doc] libopenmpt: Update changelog. Modified: branches/OpenMPT-1.30/libopenmpt/dox/changelog.md Modified: branches/OpenMPT-1.30/libopenmpt/dox/changelog.md ============================================================================== --- branches/OpenMPT-1.30/libopenmpt/dox/changelog.md Sat Mar 16 22:57:25 2024 (r20381) +++ branches/OpenMPT-1.30/libopenmpt/dox/changelog.md Sat Mar 16 22:58:11 2024 (r20382) @@ -18,6 +18,13 @@ * [**Sec**] DMF: Possible null-pointer write or excessive memory allocation when reading DMF files (r20324). + * IT: In the previous version, Zxx macros in IT files made with older MPT + versions were no longer working. + * There was a periodic click when playing a module using the Chorus or Flanger + DMO plugin at a mix rate exceeding ~136.5 kHz. + * An older bugfix for undefined behaviour in the Distortion DMO plugin was + incorrect, causing the distorted sound to be different in some situations. + * xmp-openmpt: Metadata retrievel for playlist items was broken. ### libopenmpt 0.6.13 (2024-03-03) |
From: <sv...@op...> - 2024-03-16 21:57:36
|
Author: sagamusix Date: Sat Mar 16 22:57:25 2024 New Revision: 20381 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20381 Log: [Doc] libopenmpt: Update changelog. Modified: branches/OpenMPT-1.31/doc/libopenmpt/changelog.md Modified: branches/OpenMPT-1.31/doc/libopenmpt/changelog.md ============================================================================== --- branches/OpenMPT-1.31/doc/libopenmpt/changelog.md Sat Mar 16 22:06:39 2024 (r20380) +++ branches/OpenMPT-1.31/doc/libopenmpt/changelog.md Sat Mar 16 22:57:25 2024 (r20381) @@ -18,6 +18,13 @@ * [**Sec**] DMF: Possible null-pointer write or excessive memory allocation when reading DMF files (r20323). + * IT: In the previous version, Zxx macros in IT files made with older MPT + versions were no longer working. + * There was a periodic click when playing a module using the Chorus or Flanger + DMO plugin at a mix rate exceeding ~136.5 kHz. + * An older bugfix for undefined behaviour in the Distortion DMO plugin was + incorrect, causing the distorted sound to be different in some situations. + * xmp-openmpt: Metadata retrievel for playlist items was broken. ### libopenmpt 0.7.4 (2024-03-03) |
From: <sv...@op...> - 2024-03-16 21:06:56
|
Author: sagamusix Date: Sat Mar 16 22:06:39 2024 New Revision: 20380 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20380 Log: Merged revision(s) 20376 from trunk/OpenMPT: [Fix] Distortion DMO: The UB fix in r15730 did not correspond to the actually observed behaviour, thus causing the Distortion plugin to sound different in some situations. ........ Modified: branches/OpenMPT-1.28/ (props changed) branches/OpenMPT-1.28/soundlib/plugins/dmo/Distortion.cpp Modified: branches/OpenMPT-1.28/soundlib/plugins/dmo/Distortion.cpp ============================================================================== --- branches/OpenMPT-1.28/soundlib/plugins/dmo/Distortion.cpp Sat Mar 16 22:05:58 2024 (r20379) +++ branches/OpenMPT-1.28/soundlib/plugins/dmo/Distortion.cpp Sat Mar 16 22:06:39 2024 (r20380) @@ -27,7 +27,12 @@ // Computes (log2(x) + 1) * 2 ^ (shiftL - shiftR) (x = -2^31...2^31) float logGain(float x, int32 shiftL, int32 shiftR) { - uint32 intSample = static_cast<uint32>(static_cast<int64>(x)); + uint32 intSample; + if(x <= static_cast<float>(int32_min) || x > static_cast<float>(int32_max)) + intSample = static_cast<uint32>(int32_min); + else + intSample = static_cast<uint32>(static_cast<int32>(x)); + const uint32 sign = intSample & 0x80000000; if(sign) intSample = (~intSample) + 1; |
From: <sv...@op...> - 2024-03-16 21:06:10
|
Author: sagamusix Date: Sat Mar 16 22:05:58 2024 New Revision: 20379 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20379 Log: Merged revision(s) 20376 from trunk/OpenMPT: [Fix] Distortion DMO: The UB fix in r15730 did not correspond to the actually observed behaviour, thus causing the Distortion plugin to sound different in some situations. ........ Modified: branches/OpenMPT-1.29/ (props changed) branches/OpenMPT-1.29/soundlib/plugins/dmo/Distortion.cpp Modified: branches/OpenMPT-1.29/soundlib/plugins/dmo/Distortion.cpp ============================================================================== --- branches/OpenMPT-1.29/soundlib/plugins/dmo/Distortion.cpp Sat Mar 16 21:57:51 2024 (r20378) +++ branches/OpenMPT-1.29/soundlib/plugins/dmo/Distortion.cpp Sat Mar 16 22:05:58 2024 (r20379) @@ -27,7 +27,12 @@ // Computes (log2(x) + 1) * 2 ^ (shiftL - shiftR) (x = -2^31...2^31) float logGain(float x, int32 shiftL, int32 shiftR) { - uint32 intSample = static_cast<uint32>(static_cast<int64>(x)); + uint32 intSample; + if(x <= static_cast<float>(int32_min) || x > static_cast<float>(int32_max)) + intSample = static_cast<uint32>(int32_min); + else + intSample = static_cast<uint32>(static_cast<int32>(x)); + const uint32 sign = intSample & 0x80000000; if(sign) intSample = (~intSample) + 1; |
From: <sv...@op...> - 2024-03-16 20:58:01
|
Author: sagamusix Date: Sat Mar 16 21:57:51 2024 New Revision: 20378 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20378 Log: Merged revision(s) 20376 from trunk/OpenMPT: [Fix] Distortion DMO: The UB fix in r15730 did not correspond to the actually observed behaviour, thus causing the Distortion plugin to sound different in some situations. ........ Modified: branches/OpenMPT-1.30/ (props changed) branches/OpenMPT-1.30/soundlib/plugins/dmo/DMOUtils.cpp Modified: branches/OpenMPT-1.30/soundlib/plugins/dmo/DMOUtils.cpp ============================================================================== --- branches/OpenMPT-1.30/soundlib/plugins/dmo/DMOUtils.cpp Sat Mar 16 21:57:34 2024 (r20377) +++ branches/OpenMPT-1.30/soundlib/plugins/dmo/DMOUtils.cpp Sat Mar 16 21:57:51 2024 (r20378) @@ -26,7 +26,12 @@ // Computes (log2(x) + 1) * 2 ^ (shiftL - shiftR) (x = -2^31...2^31) float logGain(float x, int32 shiftL, int32 shiftR) { - uint32 intSample = static_cast<uint32>(static_cast<int64>(x)); + uint32 intSample; + if(x <= static_cast<float>(int32_min) || x > static_cast<float>(int32_max)) + intSample = static_cast<uint32>(int32_min); + else + intSample = static_cast<uint32>(static_cast<int32>(x)); + const uint32 sign = intSample & 0x80000000; if(sign) intSample = (~intSample) + 1; |
From: <sv...@op...> - 2024-03-16 20:57:50
|
Author: sagamusix Date: Sat Mar 16 21:57:34 2024 New Revision: 20377 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20377 Log: Merged revision(s) 20376 from trunk/OpenMPT: [Fix] Distortion DMO: The UB fix in r15730 did not correspond to the actually observed behaviour, thus causing the Distortion plugin to sound different in some situations. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/plugins/dmo/DMOUtils.cpp Modified: branches/OpenMPT-1.31/soundlib/plugins/dmo/DMOUtils.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/plugins/dmo/DMOUtils.cpp Sat Mar 16 21:56:54 2024 (r20376) +++ branches/OpenMPT-1.31/soundlib/plugins/dmo/DMOUtils.cpp Sat Mar 16 21:57:34 2024 (r20377) @@ -26,7 +26,12 @@ // Computes (log2(x) + 1) * 2 ^ (shiftL - shiftR) (x = -2^31...2^31) float logGain(float x, int32 shiftL, int32 shiftR) { - uint32 intSample = static_cast<uint32>(static_cast<int64>(x)); + uint32 intSample; + if(x <= static_cast<float>(int32_min) || x > static_cast<float>(int32_max)) + intSample = static_cast<uint32>(int32_min); + else + intSample = static_cast<uint32>(static_cast<int32>(x)); + const uint32 sign = intSample & 0x80000000; if(sign) intSample = (~intSample) + 1; |
From: <sv...@op...> - 2024-03-16 20:57:07
|
Author: sagamusix Date: Sat Mar 16 21:56:54 2024 New Revision: 20376 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20376 Log: [Fix] Distortion DMO: The UB fix in r15730 did not correspond to the actually observed behaviour, thus causing the Distortion plugin to sound different in some situations. Modified: trunk/OpenMPT/soundlib/plugins/dmo/DMOUtils.cpp Modified: trunk/OpenMPT/soundlib/plugins/dmo/DMOUtils.cpp ============================================================================== --- trunk/OpenMPT/soundlib/plugins/dmo/DMOUtils.cpp Sat Mar 16 08:21:34 2024 (r20375) +++ trunk/OpenMPT/soundlib/plugins/dmo/DMOUtils.cpp Sat Mar 16 21:56:54 2024 (r20376) @@ -26,7 +26,12 @@ // Computes (log2(x) + 1) * 2 ^ (shiftL - shiftR) (x = -2^31...2^31) float logGain(float x, int32 shiftL, int32 shiftR) { - uint32 intSample = static_cast<uint32>(static_cast<int64>(x)); + uint32 intSample; + if(x <= static_cast<float>(int32_min) || x > static_cast<float>(int32_max)) + intSample = static_cast<uint32>(int32_min); + else + intSample = static_cast<uint32>(static_cast<int32>(x)); + const uint32 sign = intSample & 0x80000000; if(sign) intSample = (~intSample) + 1; |
From: <sv...@op...> - 2024-03-16 07:21:46
|
Author: manx Date: Sat Mar 16 08:21:34 2024 New Revision: 20375 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20375 Log: [Doc] libopenmpt: Update changelog. Modified: trunk/OpenMPT/doc/libopenmpt/changelog.md Modified: trunk/OpenMPT/doc/libopenmpt/changelog.md ============================================================================== --- trunk/OpenMPT/doc/libopenmpt/changelog.md Sat Mar 16 08:19:37 2024 (r20374) +++ trunk/OpenMPT/doc/libopenmpt/changelog.md Sat Mar 16 08:21:34 2024 (r20375) @@ -21,6 +21,8 @@ * [**Regression**] Using `EMSCRIPTEN_PORTS=1` with Emscripten older than 3.1.54 now requires additionally specifying `ANCIENT=1`. + * xmp-openmpt: Memory consumption during file loading has been reduced. + ### libopenmpt 0.7.0 (2023-04-30) * [**New**] `667` files from Composer 667 are now supported. |
From: <sv...@op...> - 2024-03-16 07:19:48
|
Author: manx Date: Sat Mar 16 08:19:37 2024 New Revision: 20374 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20374 Log: [Mod] libopenmpt: Bump prerel version. Modified: trunk/OpenMPT/libopenmpt/libopenmpt_version.h trunk/OpenMPT/libopenmpt/libopenmpt_version.mk Modified: trunk/OpenMPT/libopenmpt/libopenmpt_version.h ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_version.h Sat Mar 16 08:18:54 2024 (r20373) +++ trunk/OpenMPT/libopenmpt/libopenmpt_version.h Sat Mar 16 08:19:37 2024 (r20374) @@ -23,7 +23,7 @@ /*! \brief libopenmpt patch version number */ #define OPENMPT_API_VERSION_PATCH 0 /*! \brief libopenmpt pre-release tag */ -#define OPENMPT_API_VERSION_PREREL "-pre.4" +#define OPENMPT_API_VERSION_PREREL "-pre.5" /*! \brief libopenmpt pre-release flag */ #define OPENMPT_API_VERSION_IS_PREREL 1 Modified: trunk/OpenMPT/libopenmpt/libopenmpt_version.mk ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_version.mk Sat Mar 16 08:18:54 2024 (r20373) +++ trunk/OpenMPT/libopenmpt/libopenmpt_version.mk Sat Mar 16 08:19:37 2024 (r20374) @@ -1,7 +1,7 @@ LIBOPENMPT_VERSION_MAJOR=0 LIBOPENMPT_VERSION_MINOR=8 LIBOPENMPT_VERSION_PATCH=0 -LIBOPENMPT_VERSION_PREREL=-pre.4 +LIBOPENMPT_VERSION_PREREL=-pre.5 LIBOPENMPT_LTVER_CURRENT=5 LIBOPENMPT_LTVER_REVISION=0 |
From: <sv...@op...> - 2024-03-16 07:19:10
|
Author: manx Date: Sat Mar 16 08:18:54 2024 New Revision: 20373 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20373 Log: [Imp] xmp-openmpt: Implement a seekable std::streambuf for local and network files. Reduces memory consumption while module loading. The implementation requires XMPlay 3.8.2, but falls back to the old less efficient implementation for older XMPlay versions. Modified: trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Modified: trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Sat Mar 16 07:57:16 2024 (r20372) +++ trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Sat Mar 16 08:18:54 2024 (r20373) @@ -539,6 +539,75 @@ return traits_type::to_int_type( *gptr() ); } +#include <fstream> +class xmplay_streambuf_seekable : public xmplay_streambuf { +public: + explicit xmplay_streambuf_seekable( XMPFILE & file ); +private: + xmplay_streambuf_seekable( const xmplay_streambuf_seekable & ) = delete; + xmplay_streambuf_seekable & operator = ( const xmplay_streambuf_seekable & ) = delete; +private: + pos_type seekoff( off_type off, std::ios::seekdir dir, std::ios::openmode which ) override; + pos_type seekpos( pos_type pos, std::ios::openmode which ) override; +}; // class xmplay_streambuf_seekable + +xmplay_streambuf_seekable::xmplay_streambuf_seekable( XMPFILE & file ) + : xmplay_streambuf(file) +{ + return; +} + +std::streambuf::pos_type xmplay_streambuf_seekable::seekoff( off_type off, std::ios::seekdir dir, std::ios::openmode which ) { + if ( !(which & std::ios::in) ) { + return pos_type(off_type(-1)); + } + if ( (dir == std::ios::cur) && (off == 0) ) { + // shortcut without invalidating buffer + return xmpffile->Tell64( file ) - (egptr() - gptr()); + } + if ( (dir == std::ios::beg) && (off == static_cast<std::int64_t>( xmpffile->Tell64( file ) ) - (egptr() - gptr())) ) { + // shortcut without invalidating buffer + return off; + } + switch ( dir ) { + case std::ios::beg: + if ( !xmpffile->Seek64( file, off ) ) { + return pos_type(off_type(-1)); + } + break; + case std::ios::cur: + if ( !xmpffile->Seek64( file, xmpffile->Tell64( file ) - (egptr() - gptr()) + off ) ) { + return pos_type(off_type(-1)); + } + break; + case std::ios::end: + if ( !xmpffile->Seek64( file, xmpffile->GetSize64( file ) + off ) ) { + return pos_type(off_type(-1)); + } + break; + default: + return pos_type(off_type(-1)); + break; + } + setg( buffer.data(), buffer.data() + buffer.size(), buffer.data() + buffer.size() ); + return xmpffile->Tell64( file ); +} + +std::streambuf::pos_type xmplay_streambuf_seekable::seekpos( pos_type pos, std::ios::openmode which ) { + if ( !(which & std::ios::in) ) { + return pos_type(off_type(-1)); + } + if ( pos == static_cast<std::int64_t>( xmpffile->Tell64( file ) - (egptr() - gptr()) ) ) { + // shortcut without invalidating buffer + return pos; + } + if ( !xmpffile->Seek64( file, pos ) ) { + return pos_type(off_type(-1)); + } + setg( buffer.data(), buffer.data() + buffer.size(), buffer.data() + buffer.size() ); + return xmpffile->Tell64( file ); +} + class xmplay_istream : public std::istream { private: xmplay_streambuf buf; @@ -551,6 +620,19 @@ } }; // class xmplay_istream +class xmplay_istream_seekable : public std::istream { +private: + xmplay_streambuf_seekable buf; +private: + xmplay_istream_seekable( const xmplay_istream_seekable & ) = delete; + xmplay_istream_seekable & operator = ( const xmplay_istream_seekable & ) = delete; +public: + xmplay_istream_seekable( XMPFILE & file ) : std::istream(&buf), buf(file) { + return; + } +}; // class xmplay_istream_seekable + + // Stream for memory-based files (required for could_open_probability) struct xmplay_membuf : std::streambuf { xmplay_membuf( const char * base, size_t size ) { @@ -795,6 +877,16 @@ break; case XMPFILE_TYPE_FILE: case XMPFILE_TYPE_NETFILE: + { + if ( xmpfmisc->GetVersion() >= 0x03080200 ) { + xmplay_istream_seekable s( file ); + return ( openmpt::probe_file_header( openmpt::probe_file_header_flags_default2, s ) == openmpt::probe_file_header_result_success ) ? TRUE : FALSE; + } else { + xmplay_istream s( file ); + return ( openmpt::probe_file_header( openmpt::probe_file_header_flags_default2, s ) == openmpt::probe_file_header_result_success ) ? TRUE : FALSE; + } + } + break; case XMPFILE_TYPE_NETSTREAM: default: { @@ -827,6 +919,18 @@ break; case XMPFILE_TYPE_FILE: case XMPFILE_TYPE_NETFILE: + { + if ( xmpfmisc->GetVersion() >= 0x03080200 ) { + xmplay_istream_seekable s( file ); + openmpt::module mod( s, std::clog, ctls ); + subsongs = build_xmplay_file_info( mod, length, tags ); + } else { + xmplay_istream s( file ); + openmpt::module mod( s, std::clog, ctls ); + subsongs = build_xmplay_file_info( mod, length, tags ); + } + } + break; case XMPFILE_TYPE_NETSTREAM: default: { @@ -862,6 +966,16 @@ break; case XMPFILE_TYPE_FILE: case XMPFILE_TYPE_NETFILE: + { + if ( xmpfmisc->GetVersion() >= 0x03080200 ) { + xmplay_istream_seekable s( file ); + self->mod = new openmpt::module_ext( s, std::clog, ctls ); + } else { + xmplay_istream s( file ); + self->mod = new openmpt::module_ext( s, std::clog, ctls ); + } + } + break; case XMPFILE_TYPE_NETSTREAM: default: { |
From: <sv...@op...> - 2024-03-16 06:57:35
|
Author: manx Date: Sat Mar 16 07:57:16 2024 New Revision: 20372 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20372 Log: [Ref] xmp-openmpt: Simplify xmplay_streambuf::underflow(). Modified: trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Modified: trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Sat Mar 16 07:52:17 2024 (r20371) +++ trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Sat Mar 16 07:57:16 2024 (r20372) @@ -510,10 +510,11 @@ public: explicit xmplay_streambuf( XMPFILE & file ); private: - int_type underflow() override; xmplay_streambuf( const xmplay_streambuf & ) = delete; xmplay_streambuf & operator = ( const xmplay_streambuf & ) = delete; -private: +protected: + int_type underflow() override; +protected: XMPFILE & file; static inline constexpr std::size_t put_back = 4096; static inline constexpr std::size_t buf_size = 65536; @@ -521,24 +522,18 @@ }; // class xmplay_streambuf xmplay_streambuf::xmplay_streambuf( XMPFILE & file_ ) : file(file_), buffer(buf_size) { - char * end = &buffer.front() + buffer.size(); - setg( end, end, end ); + setg( buffer.data(), buffer.data() + buffer.size(), buffer.data() + buffer.size() ); } std::streambuf::int_type xmplay_streambuf::underflow() { if ( gptr() < egptr() ) { return traits_type::to_int_type( *gptr() ); } - char * base = &buffer.front(); - char * start = base; - if ( eback() == base ) { - std::size_t put_back_count = std::min( put_back, static_cast<std::size_t>( egptr() - base ) ); - std::memmove( base, egptr() - put_back_count, put_back_count ); - start += put_back_count; - } - std::size_t n = xmpffile->Read( file, start, buffer.size() - ( start - base ) ); - setg( base, start, start + n ); - if ( n == 0 ) { + std::size_t put_back_count = std::min( put_back, static_cast<std::size_t>( egptr() - buffer.data() ) ); + std::memmove( buffer.data(), egptr() - put_back_count, put_back_count ); + std::size_t readcount = xmpffile->Read( file, buffer.data() + put_back_count, buffer.size() - put_back_count ); + setg( buffer.data(), buffer.data() + put_back_count, buffer.data() + put_back_count + readcount ); + if ( readcount == 0 ) { return traits_type::eof(); } return traits_type::to_int_type( *gptr() ); |
From: <sv...@op...> - 2024-03-16 06:52:33
|
Author: manx Date: Sat Mar 16 07:52:17 2024 New Revision: 20371 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20371 Log: Merged revision(s) 20370 from branches/OpenMPT-1.29: [Ref] Small cleanup. ........ Modified: branches/OpenMPT-1.28/ (props changed) branches/OpenMPT-1.28/common/mptBaseUtils.h Modified: branches/OpenMPT-1.28/common/mptBaseUtils.h ============================================================================== --- branches/OpenMPT-1.28/common/mptBaseUtils.h Sat Mar 16 07:51:52 2024 (r20370) +++ branches/OpenMPT-1.28/common/mptBaseUtils.h Sat Mar 16 07:52:17 2024 (r20371) @@ -709,8 +709,7 @@ { return std::numeric_limits<T>::max(); } - T result = ((x + (target - 1)) / target) * target; - return result; + return ((x + (target - 1)) / target) * target; } } // namespace Util |
From: <sv...@op...> - 2024-03-16 06:52:09
|
Author: manx Date: Sat Mar 16 07:51:52 2024 New Revision: 20370 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20370 Log: [Ref] Small cleanup. Modified: branches/OpenMPT-1.29/common/mptBaseUtils.h Modified: branches/OpenMPT-1.29/common/mptBaseUtils.h ============================================================================== --- branches/OpenMPT-1.29/common/mptBaseUtils.h Fri Mar 15 21:43:31 2024 (r20369) +++ branches/OpenMPT-1.29/common/mptBaseUtils.h Sat Mar 16 07:51:52 2024 (r20370) @@ -705,8 +705,7 @@ { return std::numeric_limits<T>::max(); } - T result = ((x + (target - 1)) / target) * target; - return result; + return ((x + (target - 1)) / target) * target; } } // namespace Util |
From: <sv...@op...> - 2024-03-15 20:43:49
|
Author: manx Date: Fri Mar 15 21:43:31 2024 New Revision: 20369 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20369 Log: Merged revision(s) 20367 from branches/OpenMPT-1.30: Merged revision(s) 20366 from branches/OpenMPT-1.31/libopenmpt/xmp-openmpt: Merged revision(s) 20365 from trunk/OpenMPT: [Fix] xmp-openmpt: Fix xmplay_streambuf::underflow(). When returning eof, we also need to set the get area to empty according to the standard. ........ ........ ........ Modified: branches/OpenMPT-1.28/ (props changed) branches/OpenMPT-1.28/libopenmpt/ (props changed) branches/OpenMPT-1.28/libopenmpt/xmp-openmpt.cpp Modified: branches/OpenMPT-1.28/libopenmpt/xmp-openmpt.cpp ============================================================================== --- branches/OpenMPT-1.28/libopenmpt/xmp-openmpt.cpp Fri Mar 15 21:43:07 2024 (r20368) +++ branches/OpenMPT-1.28/libopenmpt/xmp-openmpt.cpp Fri Mar 15 21:43:31 2024 (r20369) @@ -510,10 +510,10 @@ start += put_back_count; } std::size_t n = xmpffile->Read( file, start, buffer.size() - ( start - base ) ); + setg( base, start, start + n ); if ( n == 0 ) { return traits_type::eof(); } - setg( base, start, start + n ); return traits_type::to_int_type( *gptr() ); } |
From: <sv...@op...> - 2024-03-15 20:43:23
|
Author: manx Date: Fri Mar 15 21:43:07 2024 New Revision: 20368 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20368 Log: Merged revision(s) 20367 from branches/OpenMPT-1.30: Merged revision(s) 20366 from branches/OpenMPT-1.31/libopenmpt/xmp-openmpt: Merged revision(s) 20365 from trunk/OpenMPT: [Fix] xmp-openmpt: Fix xmplay_streambuf::underflow(). When returning eof, we also need to set the get area to empty according to the standard. ........ ........ ........ Modified: branches/OpenMPT-1.29/ (props changed) branches/OpenMPT-1.29/libopenmpt/ (props changed) branches/OpenMPT-1.29/libopenmpt/xmp-openmpt.cpp Modified: branches/OpenMPT-1.29/libopenmpt/xmp-openmpt.cpp ============================================================================== --- branches/OpenMPT-1.29/libopenmpt/xmp-openmpt.cpp Fri Mar 15 21:42:32 2024 (r20367) +++ branches/OpenMPT-1.29/libopenmpt/xmp-openmpt.cpp Fri Mar 15 21:43:07 2024 (r20368) @@ -526,10 +526,10 @@ start += put_back_count; } std::size_t n = xmpffile->Read( file, start, buffer.size() - ( start - base ) ); + setg( base, start, start + n ); if ( n == 0 ) { return traits_type::eof(); } - setg( base, start, start + n ); return traits_type::to_int_type( *gptr() ); } |
From: <sv...@op...> - 2024-03-15 20:42:48
|
Author: manx Date: Fri Mar 15 21:42:32 2024 New Revision: 20367 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20367 Log: Merged revision(s) 20366 from branches/OpenMPT-1.31/libopenmpt/xmp-openmpt: Merged revision(s) 20365 from trunk/OpenMPT: [Fix] xmp-openmpt: Fix xmplay_streambuf::underflow(). When returning eof, we also need to set the get area to empty according to the standard. ........ ........ Modified: branches/OpenMPT-1.30/libopenmpt/ (props changed) branches/OpenMPT-1.30/libopenmpt/xmp-openmpt.cpp (contents, props changed) Modified: branches/OpenMPT-1.30/libopenmpt/xmp-openmpt.cpp ============================================================================== --- branches/OpenMPT-1.30/libopenmpt/xmp-openmpt.cpp Fri Mar 15 21:41:11 2024 (r20366) +++ branches/OpenMPT-1.30/libopenmpt/xmp-openmpt.cpp Fri Mar 15 21:42:32 2024 (r20367) @@ -585,10 +585,10 @@ start += put_back_count; } std::size_t n = xmpffile->Read( file, start, buffer.size() - ( start - base ) ); + setg( base, start, start + n ); if ( n == 0 ) { return traits_type::eof(); } - setg( base, start, start + n ); return traits_type::to_int_type( *gptr() ); } |
From: <sv...@op...> - 2024-03-15 20:41:26
|
Author: manx Date: Fri Mar 15 21:41:11 2024 New Revision: 20366 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20366 Log: Merged revision(s) 20365 from trunk/OpenMPT: [Fix] xmp-openmpt: Fix xmplay_streambuf::underflow(). When returning eof, we also need to set the get area to empty according to the standard. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Modified: branches/OpenMPT-1.31/libopenmpt/xmp-openmpt/xmp-openmpt.cpp ============================================================================== --- branches/OpenMPT-1.31/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Fri Mar 15 21:40:36 2024 (r20365) +++ branches/OpenMPT-1.31/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Fri Mar 15 21:41:11 2024 (r20366) @@ -551,10 +551,10 @@ start += put_back_count; } std::size_t n = xmpffile->Read( file, start, buffer.size() - ( start - base ) ); + setg( base, start, start + n ); if ( n == 0 ) { return traits_type::eof(); } - setg( base, start, start + n ); return traits_type::to_int_type( *gptr() ); } |
From: <sv...@op...> - 2024-03-15 20:40:53
|
Author: manx Date: Fri Mar 15 21:40:36 2024 New Revision: 20365 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20365 Log: [Fix] xmp-openmpt: Fix xmplay_streambuf::underflow(). When returning eof, we also need to set the get area to empty according to the standard. Modified: trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Modified: trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Fri Mar 15 18:40:00 2024 (r20364) +++ trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Fri Mar 15 21:40:36 2024 (r20365) @@ -537,10 +537,10 @@ start += put_back_count; } std::size_t n = xmpffile->Read( file, start, buffer.size() - ( start - base ) ); + setg( base, start, start + n ); if ( n == 0 ) { return traits_type::eof(); } - setg( base, start, start + n ); return traits_type::to_int_type( *gptr() ); } |
From: <sv...@op...> - 2024-03-15 17:40:16
|
Author: sagamusix Date: Fri Mar 15 18:40:00 2024 New Revision: 20364 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20364 Log: Merged revision(s) 20363 from trunk/OpenMPT: [Fix] Add missing newline to key config parser error reporting. [Fix] File sizes in the instrument browser and comments tab were displayed incorrectly if a file size < 1KB ended in 0s. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/mptrack/CommandSet.cpp branches/OpenMPT-1.31/mptrack/Mptrack.cpp Modified: branches/OpenMPT-1.31/mptrack/CommandSet.cpp ============================================================================== --- branches/OpenMPT-1.31/mptrack/CommandSet.cpp Fri Mar 15 18:39:38 2024 (r20363) +++ branches/OpenMPT-1.31/mptrack/CommandSet.cpp Fri Mar 15 18:40:00 2024 (r20364) @@ -2101,7 +2101,7 @@ keymapVersion = Version::Parse(mpt::ToUnicode(mpt::Charset::ASCII, tokens[1])); if(keymapVersion > Version::Current()) { - errText += MPT_CFORMAT("Keymap was saved with OpenMPT {}, but you are running OpenMPT {}.")(keymapVersion, Version::Current()); + errText += MPT_CFORMAT("Keymap was saved with OpenMPT {}, but you are running OpenMPT {}.\n")(keymapVersion, Version::Current()); } continue; } Modified: branches/OpenMPT-1.31/mptrack/Mptrack.cpp ============================================================================== --- branches/OpenMPT-1.31/mptrack/Mptrack.cpp Fri Mar 15 18:39:38 2024 (r20363) +++ branches/OpenMPT-1.31/mptrack/Mptrack.cpp Fri Mar 15 18:40:00 2024 (r20364) @@ -2091,7 +2091,10 @@ // Variable-length formatting may decide on a whim to switch to scientific formatting, so used a fixed width and trim manually... CString s = mpt::cfmt::fix(size, 2); if(i == 0) - s.TrimRight(_T("0.")); + { + if(int pos = s.ReverseFind(_T('.')); pos >= 0) + s.Delete(pos, s.GetLength() - pos); + } return s + Unit[i]; } size /= 1024.0; |
From: <sv...@op...> - 2024-03-15 17:39:56
|
Author: sagamusix Date: Fri Mar 15 18:39:38 2024 New Revision: 20363 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20363 Log: [Fix] Add missing newline to key config parser error reporting. [Fix] File sizes in the instrument browser and comments tab were displayed incorrectly if a file size < 1KB ended in 0s. Modified: trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/Mptrack.cpp Modified: trunk/OpenMPT/mptrack/CommandSet.cpp ============================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp Fri Mar 15 15:47:00 2024 (r20362) +++ trunk/OpenMPT/mptrack/CommandSet.cpp Fri Mar 15 18:39:38 2024 (r20363) @@ -2225,7 +2225,7 @@ keymapVersion = Version::Parse(mpt::ToUnicode(mpt::Charset::ASCII, tokens[1])); if(keymapVersion > Version::Current()) { - errText += MPT_CFORMAT("Keymap was saved with OpenMPT {}, but you are running OpenMPT {}.")(keymapVersion, Version::Current()); + errText += MPT_CFORMAT("Keymap was saved with OpenMPT {}, but you are running OpenMPT {}.\n")(keymapVersion, Version::Current()); } continue; } Modified: trunk/OpenMPT/mptrack/Mptrack.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp Fri Mar 15 15:47:00 2024 (r20362) +++ trunk/OpenMPT/mptrack/Mptrack.cpp Fri Mar 15 18:39:38 2024 (r20363) @@ -2109,7 +2109,10 @@ // Variable-length formatting may decide on a whim to switch to scientific formatting, so used a fixed width and trim manually... CString s = mpt::cfmt::fix(size, 2); if(i == 0) - s.TrimRight(_T("0.")); + { + if(int pos = s.ReverseFind(_T('.')); pos >= 0) + s.Delete(pos, s.GetLength() - pos); + } return s + Unit[i]; } size /= 1024.0; |
From: <sv...@op...> - 2024-03-15 14:47:19
|
Author: manx Date: Fri Mar 15 15:47:00 2024 New Revision: 20362 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20362 Log: [Ref] xmp-openmpt: Tiny cleanups. Modified: trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Modified: trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Fri Mar 15 14:49:01 2024 (r20361) +++ trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Fri Mar 15 15:47:00 2024 (r20362) @@ -135,10 +135,7 @@ { return; } - virtual ~xmp_openmpt_settings() - { - return; - } + virtual ~xmp_openmpt_settings() = default; }; struct self_xmplay_t { @@ -167,9 +164,6 @@ mod = 0; } } - ~self_xmplay_t() { - return; - } }; static std::string convert_to_native( const std::string & str ) { @@ -517,8 +511,8 @@ explicit xmplay_streambuf( XMPFILE & file ); private: int_type underflow() override; - xmplay_streambuf( const xmplay_streambuf & ); - xmplay_streambuf & operator = ( const xmplay_streambuf & ); + xmplay_streambuf( const xmplay_streambuf & ) = delete; + xmplay_streambuf & operator = ( const xmplay_streambuf & ) = delete; private: XMPFILE & file; static inline constexpr std::size_t put_back = 4096; @@ -554,15 +548,12 @@ private: xmplay_streambuf buf; private: - xmplay_istream( const xmplay_istream & ); - xmplay_istream & operator = ( const xmplay_istream & ); + xmplay_istream( const xmplay_istream & ) = delete; + xmplay_istream & operator = ( const xmplay_istream & ) = delete; public: xmplay_istream( XMPFILE & file ) : std::istream(&buf), buf(file) { return; } - ~xmplay_istream() { - return; - } }; // class xmplay_istream // Stream for memory-based files (required for could_open_probability) |
From: <sv...@op...> - 2024-03-15 13:49:17
|
Author: manx Date: Fri Mar 15 14:49:01 2024 New Revision: 20361 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20361 Log: [Ref] xmp-openmpt: Remove the non-XMPlay IO backends. Modified: trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Modified: trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Fri Mar 15 13:57:29 2024 (r20360) +++ trunk/OpenMPT/libopenmpt/xmp-openmpt/xmp-openmpt.cpp Fri Mar 15 14:49:01 2024 (r20361) @@ -41,10 +41,6 @@ static const char * xmp_openmpt_string = "OpenMPT (" OPENMPT_API_VERSION_STRING ")"; #endif -#define USE_XMPLAY_FILE_IO - -#define USE_XMPLAY_ISTREAM - #include "xmplay/xmpin.h" // Shortcut block assigned to the OpenMPT plugin by un4seen. @@ -516,10 +512,6 @@ apply_and_save_options(); } -#ifdef USE_XMPLAY_FILE_IO - -#ifdef USE_XMPLAY_ISTREAM - class xmplay_streambuf : public std::streambuf { public: explicit xmplay_streambuf( XMPFILE & file ); @@ -589,25 +581,6 @@ } }; -#else // !USE_XMPLAY_ISTREAM - -static std::vector<char> read_XMPFILE_vector( XMPFILE & file ) { - std::vector<char> data( xmpffile->GetSize( file ) ); - if ( data.size() != xmpffile->Read( file, data.data(), data.size() ) ) { - return std::vector<char>(); - } - return data; -} - -static std::string read_XMPFILE_string( XMPFILE & file ) { - std::vector<char> data = read_XMPFILE_vector( file ); - return std::string( data.begin(), data.end() ); -} - -#endif // USE_XMPLAY_ISTREAM - -#endif // USE_XMPLAY_FILE_IO - static std::string string_replace( std::string str, const std::string & oldStr, const std::string & newStr ) { std::size_t pos = 0; while((pos = str.find(oldStr, pos)) != std::string::npos) @@ -827,40 +800,23 @@ static BOOL WINAPI openmpt_CheckFile( const char * filename, XMPFILE file ) { static_cast<void>( filename ); try { - #ifdef USE_XMPLAY_FILE_IO - #ifdef USE_XMPLAY_ISTREAM - switch ( xmpffile->GetType( file ) ) { - case XMPFILE_TYPE_MEMORY: - { - xmplay_imemstream s( reinterpret_cast<const char *>( xmpffile->GetMemory( file ) ), xmpffile->GetSize( file ) ); - return ( openmpt::probe_file_header( openmpt::probe_file_header_flags_default2, s ) == openmpt::probe_file_header_result_success ) ? TRUE : FALSE; - } - break; - case XMPFILE_TYPE_FILE: - case XMPFILE_TYPE_NETFILE: - case XMPFILE_TYPE_NETSTREAM: - default: - { - xmplay_istream s( file ); - return ( openmpt::probe_file_header( openmpt::probe_file_header_flags_default2, s ) == openmpt::probe_file_header_result_success ) ? TRUE : FALSE; - } - break; - } - #else - if ( xmpffile->GetType( file ) == XMPFILE_TYPE_MEMORY ) { - std::string data( reinterpret_cast<const char*>( xmpffile->GetMemory( file ) ), xmpffile->GetSize( file ) ); - std::istringstream s( data ); + switch ( xmpffile->GetType( file ) ) { + case XMPFILE_TYPE_MEMORY: + { + xmplay_imemstream s( reinterpret_cast<const char *>( xmpffile->GetMemory( file ) ), xmpffile->GetSize( file ) ); return ( openmpt::probe_file_header( openmpt::probe_file_header_flags_default2, s ) == openmpt::probe_file_header_result_success ) ? TRUE : FALSE; - } else { - std::string data = read_XMPFILE_string( file ); - std::istringstream s(data); + } + break; + case XMPFILE_TYPE_FILE: + case XMPFILE_TYPE_NETFILE: + case XMPFILE_TYPE_NETSTREAM: + default: + { + xmplay_istream s( file ); return ( openmpt::probe_file_header( openmpt::probe_file_header_flags_default2, s ) == openmpt::probe_file_header_result_success ) ? TRUE : FALSE; } - #endif - #else - std::ifstream s( filename, std::ios_base::binary ); - return ( openmpt::probe_file_header( openmpt::probe_file_header_flags_default2, s ) == openmpt::probe_file_header_result_success ) ? TRUE : FALSE; - #endif + break; + } } catch ( ... ) { return FALSE; } @@ -876,40 +832,24 @@ { "load.skip_plugins", "1" }, { "load.skip_samples", "1" }, }; - #ifdef USE_XMPLAY_FILE_IO - #ifdef USE_XMPLAY_ISTREAM - switch ( xmpffile->GetType( file ) ) { - case XMPFILE_TYPE_MEMORY: - { - openmpt::module mod( xmpffile->GetMemory( file ), xmpffile->GetSize( file ), std::clog, ctls ); - subsongs = build_xmplay_file_info( mod, length, tags ); - } - break; - case XMPFILE_TYPE_FILE: - case XMPFILE_TYPE_NETFILE: - case XMPFILE_TYPE_NETSTREAM: - default: - { - xmplay_istream s( file ); - openmpt::module mod( s, std::clog, ctls ); - subsongs = build_xmplay_file_info( mod, length, tags ); - } - break; - } - #else - if ( xmpffile->GetType( file ) == XMPFILE_TYPE_MEMORY ) { + switch ( xmpffile->GetType( file ) ) { + case XMPFILE_TYPE_MEMORY: + { openmpt::module mod( xmpffile->GetMemory( file ), xmpffile->GetSize( file ), std::clog, ctls ); subsongs = build_xmplay_file_info( mod, length, tags ); - } else { - openmpt::module mod( read_XMPFILE_vector( file ), std::clog, ctls ); + } + break; + case XMPFILE_TYPE_FILE: + case XMPFILE_TYPE_NETFILE: + case XMPFILE_TYPE_NETSTREAM: + default: + { + xmplay_istream s( file ); + openmpt::module mod( s, std::clog, ctls ); subsongs = build_xmplay_file_info( mod, length, tags ); } - #endif - #else - std::ifstream s( filename, std::ios_base::binary ); - openmpt::module mod( s, std::clog, ctls ); - subsongs = build_xmplay_file_info( mod, length, tags ); -#endif + break; + } } catch ( ... ) { if ( length ) *length = nullptr; if ( tags ) *tags = nullptr; @@ -930,32 +870,20 @@ { "play.at_end", "continue" }, }; self->delete_mod(); - #ifdef USE_XMPLAY_FILE_IO - #ifdef USE_XMPLAY_ISTREAM - switch ( xmpffile->GetType( file ) ) { - case XMPFILE_TYPE_MEMORY: - self->mod = new openmpt::module_ext( xmpffile->GetMemory( file ), xmpffile->GetSize( file ), std::clog, ctls ); - break; - case XMPFILE_TYPE_FILE: - case XMPFILE_TYPE_NETFILE: - case XMPFILE_TYPE_NETSTREAM: - default: - { - xmplay_istream s( file ); - self->mod = new openmpt::module_ext( s, std::clog, ctls ); - } - break; - } - #else - if ( xmpffile->GetType( file ) == XMPFILE_TYPE_MEMORY ) { - self->mod = new openmpt::module_ext( xmpffile->GetMemory( file ), xmpffile->GetSize( file ), std::clog, ctls ); - } else { - self->mod = new openmpt::module_ext( read_XMPFILE_vector( file ), std::clog, ctls ); + switch ( xmpffile->GetType( file ) ) { + case XMPFILE_TYPE_MEMORY: + self->mod = new openmpt::module_ext( xmpffile->GetMemory( file ), xmpffile->GetSize( file ), std::clog, ctls ); + break; + case XMPFILE_TYPE_FILE: + case XMPFILE_TYPE_NETFILE: + case XMPFILE_TYPE_NETSTREAM: + default: + { + xmplay_istream s( file ); + self->mod = new openmpt::module_ext( s, std::clog, ctls ); } - #endif - #else - self->mod = new openmpt::module_ext( std::ifstream( filename, std::ios_base::binary ), std::clog, ctls ); - #endif + break; + } self->on_new_mod(); clear_current_timeinfo(); reset_timeinfos(); @@ -1664,11 +1592,6 @@ #endif static XMPIN xmpin = { -#ifdef USE_XMPLAY_FILE_IO - 0 | -#else - XMPIN_FLAG_NOXMPFILE | -#endif XMPIN_FLAG_CONFIG | XMPIN_FLAG_LOOP, xmp_openmpt_string, nullptr, // "libopenmpt\0mptm/mptmz", |
From: <sv...@op...> - 2024-03-15 12:57:47
|
Author: manx Date: Fri Mar 15 13:57:29 2024 New Revision: 20360 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20360 Log: Merged revision(s) 20358 from trunk/OpenMPT: [Ref] mpt/base/numeric.hpp: Small cleanup. ........ Modified: branches/OpenMPT-1.30/ (props changed) branches/OpenMPT-1.30/src/mpt/base/numeric.hpp Modified: branches/OpenMPT-1.30/src/mpt/base/numeric.hpp ============================================================================== --- branches/OpenMPT-1.30/src/mpt/base/numeric.hpp Fri Mar 15 13:57:08 2024 (r20359) +++ branches/OpenMPT-1.30/src/mpt/base/numeric.hpp Fri Mar 15 13:57:29 2024 (r20360) @@ -86,8 +86,7 @@ if (x > (std::numeric_limits<T>::max() - (target - 1))) { return std::numeric_limits<T>::max(); } - T result = ((x + (target - 1)) / target) * target; - return result; + return ((x + (target - 1)) / target) * target; } // Returns sign of a number (-1 for negative numbers, 1 for positive numbers, 0 for 0) |