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
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sv...@op...> - 2024-10-20 11:51:11
|
Author: manx Date: Sun Oct 20 13:50:56 2024 New Revision: 21868 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21868 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 Sun Oct 20 13:49:58 2024 (r21867) +++ trunk/OpenMPT/libopenmpt/libopenmpt_version.h Sun Oct 20 13:50:56 2024 (r21868) @@ -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.9" +#define OPENMPT_API_VERSION_PREREL "-pre.10" /*! \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 Sun Oct 20 13:49:58 2024 (r21867) +++ trunk/OpenMPT/libopenmpt/libopenmpt_version.mk Sun Oct 20 13:50:56 2024 (r21868) @@ -1,7 +1,7 @@ LIBOPENMPT_VERSION_MAJOR=0 LIBOPENMPT_VERSION_MINOR=8 LIBOPENMPT_VERSION_PATCH=0 -LIBOPENMPT_VERSION_PREREL=-pre.9 +LIBOPENMPT_VERSION_PREREL=-pre.10 LIBOPENMPT_LTVER_CURRENT=5 LIBOPENMPT_LTVER_REVISION=0 |
From: <sv...@op...> - 2024-10-20 11:50:05
|
Author: sagamusix Date: Sun Oct 20 13:49:58 2024 New Revision: 21867 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21867 Log: [New] libopenmpt: Add functions to retrieve the start position of the song (https://bugs.openmpt.org/view.php?id=1675). Modified: trunk/OpenMPT/libopenmpt/bindings/freebasic/libopenmpt.bi trunk/OpenMPT/libopenmpt/libopenmpt.h trunk/OpenMPT/libopenmpt/libopenmpt.hpp trunk/OpenMPT/libopenmpt/libopenmpt_c.cpp trunk/OpenMPT/libopenmpt/libopenmpt_cxx.cpp trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp Modified: trunk/OpenMPT/libopenmpt/bindings/freebasic/libopenmpt.bi ============================================================================== --- trunk/OpenMPT/libopenmpt/bindings/freebasic/libopenmpt.bi Sun Oct 20 13:49:49 2024 (r21866) +++ trunk/OpenMPT/libopenmpt/bindings/freebasic/libopenmpt.bi Sun Oct 20 13:49:58 2024 (r21867) @@ -775,6 +775,25 @@ '/ Declare Function openmpt_module_get_selected_subsong(ByVal module As openmpt_module Ptr) As Long +/'* \brief Get the restart order of the specified sub-song + + \param module The module handle to work on. + \param subsong Index of the sub-song to retrieve the restart position from. + \return The restart order of the specified sub-song. This is the order to which playback returns after the last pattern row of the song has been played. -1 is returned if if sub-song is not in range [0,openmpt_module_get_num_subsongs()[ + \sa openmpt_module_get_restart_row + \since 0.8.0 +'/ +Declare Function openmpt_module_get_restart_order(ByVal module As openmpt_module Ptr, ByVal subsong As Long) As Long +/'* \brief Get the restart row of the specified sub-song + + \param module The module handle to work on. + \param subsong Index of the sub-song to retrieve the restart position from. + \return The restart row of the specified sub-song. This is the first played row of the order to which playback returns after the last pattern row of the song has been played. -1 is returned if if sub-song is not in range [0,openmpt_module_get_num_subsongs()[ + \sa openmpt_module_get_restart_order + \since 0.8.0 +'/ +Declare Function openmpt_module_get_restart_row(ByVal module As openmpt_module Ptr, ByVal subsong As Long) As Long + /'* \brief Set Repeat Count \param module The module handle to work on. Modified: trunk/OpenMPT/libopenmpt/libopenmpt.h ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.h Sun Oct 20 13:49:49 2024 (r21866) +++ trunk/OpenMPT/libopenmpt/libopenmpt.h Sun Oct 20 13:49:58 2024 (r21867) @@ -875,6 +875,26 @@ * \since 0.3.0 */ LIBOPENMPT_API int32_t openmpt_module_get_selected_subsong( openmpt_module * mod ); + +/*! \brief Get the restart order of the specified sub-song + * + * \param mod The module handle to work on. + * \param subsong Index of the sub-song to retrieve the restart position from. + * \return The restart order of the specified sub-song. This is the order to which playback returns after the last pattern row of the song has been played. -1 is returned if if sub-song is not in range [0,openmpt_module_get_num_subsongs()[ + * \sa openmpt_module_get_restart_row + * \since 0.8.0 + */ +LIBOPENMPT_API int32_t openmpt_module_get_restart_order( openmpt_module * mod, int32_t subsong ); +/*! \brief Get the restart row of the specified sub-song + * + * \param mod The module handle to work on. + * \param subsong Index of the sub-song to retrieve the restart position from. + * \return The restart row of the specified sub-song. This is the first played row of the order to which playback returns after the last pattern row of the song has been played. -1 is returned if if sub-song is not in range [0,openmpt_module_get_num_subsongs()[ + * \sa openmpt_module_get_restart_order + * \since 0.8.0 + */ +LIBOPENMPT_API int32_t openmpt_module_get_restart_row( openmpt_module * mod, int32_t subsong ); + /*! \brief Set Repeat Count * * \param mod The module handle to work on. Modified: trunk/OpenMPT/libopenmpt/libopenmpt.hpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.hpp Sun Oct 20 13:49:49 2024 (r21866) +++ trunk/OpenMPT/libopenmpt/libopenmpt.hpp Sun Oct 20 13:49:58 2024 (r21867) @@ -592,6 +592,26 @@ \since 0.3.0 */ LIBOPENMPT_CXX_API_MEMBER std::int32_t get_selected_subsong() const; + + //! Get the restart order of the specified sub-song + /*! + \param subsong Index of the sub-song to retrieve the restart position from. + \return The restart order of the specified sub-song. This is the order to which playback returns after the last pattern row of the song has been played. + \throws openmpt::exception Throws an exception derived from openmpt::exception if sub-song is not in range [0,openmpt::module::get_num_subsongs()[ + \sa openmpt::module::get_restart_row + \since 0.8.0 + */ + LIBOPENMPT_CXX_API_MEMBER std::int32_t get_restart_order( std::int32_t subsong ) const; + //! Get the restart row of the specified sub-song + /*! + \param subsong Index of the sub-song to retrieve the restart position from. + \return The restart row of the specified sub-song. This is the first played row of the order to which playback returns after the last pattern row of the song has been played. + \throws openmpt::exception Throws an exception derived from openmpt::exception if sub-song is not in range [0,openmpt::module::get_num_subsongs()[ + \sa openmpt::module::get_restart_order + \since 0.8.0 + */ + LIBOPENMPT_CXX_API_MEMBER std::int32_t get_restart_row( std::int32_t subsong ) const; + //! Set Repeat Count /*! \param repeat_count Repeat Count Modified: trunk/OpenMPT/libopenmpt/libopenmpt_c.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_c.cpp Sun Oct 20 13:49:49 2024 (r21866) +++ trunk/OpenMPT/libopenmpt/libopenmpt_c.cpp Sun Oct 20 13:49:58 2024 (r21867) @@ -741,6 +741,26 @@ return -1; } +int32_t openmpt_module_get_restart_order( openmpt_module * mod, int32_t subsong ) { + try { + openmpt::interface::check_soundfile( mod ); + return mod->impl->get_restart_order( subsong ); + } catch ( ... ) { + openmpt::report_exception( __func__, mod ); + } + return -1; +} + +int32_t openmpt_module_get_restart_row( openmpt_module * mod, int32_t subsong ) { + try { + openmpt::interface::check_soundfile( mod ); + return mod->impl->get_restart_row( subsong ); + } catch ( ... ) { + openmpt::report_exception( __func__, mod ); + } + return -1; +} + int openmpt_module_set_repeat_count( openmpt_module * mod, int32_t repeat_count ) { try { openmpt::interface::check_soundfile( mod ); Modified: trunk/OpenMPT/libopenmpt/libopenmpt_cxx.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_cxx.cpp Sun Oct 20 13:49:49 2024 (r21866) +++ trunk/OpenMPT/libopenmpt/libopenmpt_cxx.cpp Sun Oct 20 13:49:58 2024 (r21867) @@ -240,6 +240,13 @@ return impl->get_selected_subsong(); } +std::int32_t module::get_restart_order( std::int32_t subsong ) const { + return impl->get_restart_order( subsong ); +} +std::int32_t module::get_restart_row( std::int32_t subsong ) const { + return impl->get_restart_row( subsong ); +} + void module::set_repeat_count( std::int32_t repeat_count ) { impl->set_repeat_count( repeat_count ); } Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp Sun Oct 20 13:49:49 2024 (r21866) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp Sun Oct 20 13:49:58 2024 (r21867) @@ -306,11 +306,13 @@ m_sndFile->AddToLog( static_cast<OpenMPT::LogLevel>( loglevel ), mpt::transcode<mpt::ustring>( mpt::common_encoding::utf8, text ) ); } -module_impl::subsong_data::subsong_data( double duration, std::int32_t start_row, std::int32_t start_order, std::int32_t sequence ) +module_impl::subsong_data::subsong_data( double duration, std::int32_t start_row, std::int32_t start_order, std::int32_t sequence, std::int32_t restart_row, std::int32_t restart_order ) : duration(duration) , start_row(start_row) , start_order(start_order) , sequence(sequence) + , restart_row(restart_row) + , restart_order(restart_order) { return; } @@ -436,7 +438,7 @@ for ( OpenMPT::SEQUENCEINDEX seq = 0; seq < m_sndFile->Order.GetNumSequences(); ++seq ) { const std::vector<OpenMPT::GetLengthType> lengths = m_sndFile->GetLength( OpenMPT::eNoAdjust, OpenMPT::GetLengthTarget( true ).StartPos( seq, 0, 0 ) ); for ( const auto & l : lengths ) { - subsongs.push_back( subsong_data( l.duration, l.startRow, l.startOrder, seq ) ); + subsongs.push_back( subsong_data( l.duration, l.startRow, l.startOrder, seq, l.restartRow, l.restartOrder ) ); } } return subsongs; @@ -1093,6 +1095,24 @@ std::int32_t module_impl::get_selected_subsong() const { return m_current_subsong; } + +std::int32_t module_impl::get_restart_order( std::int32_t subsong ) const { + std::unique_ptr<subsongs_type> subsongs_temp = has_subsongs_inited() ? std::unique_ptr<subsongs_type>() : std::make_unique<subsongs_type>( get_subsongs() ); + const subsongs_type & subsongs = has_subsongs_inited() ? m_subsongs : *subsongs_temp; + if ( subsong < 0 || subsong >= static_cast<std::int32_t>( subsongs.size() ) ) { + throw openmpt::exception( "invalid subsong" ); + } + return subsongs[subsong].restart_order; +} +std::int32_t module_impl::get_restart_row( std::int32_t subsong ) const { + std::unique_ptr<subsongs_type> subsongs_temp = has_subsongs_inited() ? std::unique_ptr<subsongs_type>() : std::make_unique<subsongs_type>( get_subsongs() ); + const subsongs_type & subsongs = has_subsongs_inited() ? m_subsongs : *subsongs_temp; + if ( subsong < 0 || subsong >= static_cast<std::int32_t>( subsongs.size() ) ) { + throw openmpt::exception( "invalid subsong" ); + } + return subsongs[subsong].restart_row; +} + void module_impl::set_repeat_count( std::int32_t repeat_count ) { m_sndFile->SetRepeatCount( repeat_count ); } Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp Sun Oct 20 13:49:49 2024 (r21866) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp Sun Oct 20 13:49:58 2024 (r21867) @@ -107,7 +107,9 @@ std::int32_t start_row; std::int32_t start_order; std::int32_t sequence; - subsong_data( double duration, std::int32_t start_row, std::int32_t start_order, std::int32_t sequence ); + std::int32_t restart_row; + std::int32_t restart_order; + subsong_data( double duration, std::int32_t start_row, std::int32_t start_order, std::int32_t sequence, std::int32_t restart_row, std::int32_t restart_order ); }; // struct subsong_data typedef std::vector<subsong_data> subsongs_type; @@ -198,6 +200,10 @@ public: void select_subsong( std::int32_t subsong ); std::int32_t get_selected_subsong() const; + + std::int32_t get_restart_order( std::int32_t subsong ) const; + std::int32_t get_restart_row( std::int32_t subsong ) const; + void set_repeat_count( std::int32_t repeat_count ); std::int32_t get_repeat_count() const; double get_duration_seconds() const; |
From: <sv...@op...> - 2024-10-20 11:50:00
|
Author: manx Date: Sun Oct 20 13:49:49 2024 New Revision: 21866 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21866 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 Sun Oct 20 13:48:19 2024 (r21865) +++ trunk/OpenMPT/libopenmpt/libopenmpt_version.h Sun Oct 20 13:49:49 2024 (r21866) @@ -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.8" +#define OPENMPT_API_VERSION_PREREL "-pre.9" /*! \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 Sun Oct 20 13:48:19 2024 (r21865) +++ trunk/OpenMPT/libopenmpt/libopenmpt_version.mk Sun Oct 20 13:49:49 2024 (r21866) @@ -1,7 +1,7 @@ LIBOPENMPT_VERSION_MAJOR=0 LIBOPENMPT_VERSION_MINOR=8 LIBOPENMPT_VERSION_PATCH=0 -LIBOPENMPT_VERSION_PREREL=-pre.8 +LIBOPENMPT_VERSION_PREREL=-pre.9 LIBOPENMPT_LTVER_CURRENT=5 LIBOPENMPT_LTVER_REVISION=0 |
From: <sv...@op...> - 2024-10-20 11:48:28
|
Author: sagamusix Date: Sun Oct 20 13:48:19 2024 New Revision: 21865 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21865 Log: [New] libopenmpt: Add functions to retrieve pattern time signature information: get_pattern_rows_per_beat, get_pattern_rows_per_measure (https://bugs.openmpt.org/view.php?id=1832). Modified: trunk/OpenMPT/libopenmpt/bindings/freebasic/libopenmpt.bi trunk/OpenMPT/libopenmpt/libopenmpt.h trunk/OpenMPT/libopenmpt/libopenmpt.hpp trunk/OpenMPT/libopenmpt/libopenmpt_c.cpp trunk/OpenMPT/libopenmpt/libopenmpt_cxx.cpp trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp Modified: trunk/OpenMPT/libopenmpt/bindings/freebasic/libopenmpt.bi ============================================================================== --- trunk/OpenMPT/libopenmpt/bindings/freebasic/libopenmpt.bi Sun Oct 20 13:28:17 2024 (r21864) +++ trunk/OpenMPT/libopenmpt/bindings/freebasic/libopenmpt.bi Sun Oct 20 13:48:19 2024 (r21865) @@ -1314,6 +1314,26 @@ '/ Declare Function openmpt_module_get_pattern_num_rows(ByVal module As openmpt_module Ptr, ByVal pattern As Long) As Long +/'* \brief Get the rows per beat of a pattern + + \param mod The module handle to work on. + \param pattern The pattern whose time signature should be retrieved. + \return The rows per beat of the given pattern. If the pattern does not exist or the time signature is not defined, 0 is returned. + \remarks Many module formats lack time signature metadata. In this case, the returned value may be an incorrect estimation. + \since 0.8.0 +'/ +Declare Function openmpt_module_get_pattern_rows_per_beat(ByVal module As openmpt_module Ptr, ByVal pattern As Long) As Long + +/'* \brief Get the rows per measure of a pattern + + \param mod The module handle to work on. + \param pattern The pattern whose time signature should be retrieved. + \return The rows per measure of the given pattern. If the pattern does not exist or the time signature is not defined, 0 is returned. + \remarks Many module formats lack time signature metadata. In this case, the returned value may be an incorrect estimation. + \since 0.8.0 +'/ +Declare Function openmpt_module_get_pattern_rows_per_measure(ByVal module As openmpt_module Ptr, ByVal pattern As Long) As Long + /'* \brief Get raw pattern content \param module The module handle to work on. Modified: trunk/OpenMPT/libopenmpt/libopenmpt.h ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.h Sun Oct 20 13:28:17 2024 (r21864) +++ trunk/OpenMPT/libopenmpt/libopenmpt.h Sun Oct 20 13:48:19 2024 (r21865) @@ -1372,6 +1372,25 @@ */ LIBOPENMPT_API int32_t openmpt_module_get_pattern_num_rows( openmpt_module * mod, int32_t pattern ); +/*! \brief Get the rows per beat of a pattern + * + * \param mod The module handle to work on. + * \param pattern The pattern whose time signature should be retrieved. + * \return The rows per beat of the given pattern. If the pattern does not exist or the time signature is not defined, 0 is returned. + * \remarks Many module formats lack time signature metadata. In this case, the returned value may be an incorrect estimation. + * \since 0.8.0 + */ +LIBOPENMPT_API int32_t openmpt_module_get_pattern_rows_per_beat( openmpt_module * mod, int32_t pattern ); + +/*! \brief Get the rows per measure of a pattern + * + * \param mod The module handle to work on. + * \param pattern The pattern whose time signature should be retrieved. + * \return The rows per measure of the given pattern. If the pattern does not exist or the time signature is not defined, 0 is returned. + * \remarks Many module formats lack time signature metadata. In this case, the returned value may be an incorrect estimation. + */ +LIBOPENMPT_API int32_t openmpt_module_get_pattern_rows_per_measure( openmpt_module * mod, int32_t pattern ); + /*! \brief Get raw pattern content * * \param mod The module handle to work on. Modified: trunk/OpenMPT/libopenmpt/libopenmpt.hpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.hpp Sun Oct 20 13:28:17 2024 (r21864) +++ trunk/OpenMPT/libopenmpt/libopenmpt.hpp Sun Oct 20 13:48:19 2024 (r21865) @@ -1029,6 +1029,24 @@ */ LIBOPENMPT_CXX_API_MEMBER std::int32_t get_pattern_num_rows( std::int32_t pattern ) const; + //! Get the rows per beat of a pattern + /*! + \param pattern The pattern whose time signature should be retrieved. + \return The rows per beat of the given pattern. If the pattern does not exist or the time signature is not defined, 0 is returned. + \remarks Many module formats lack time signature metadata. In this case, the returned value may be an incorrect estimation. + \since 0.8.0 + */ + LIBOPENMPT_CXX_API_MEMBER std::int32_t get_pattern_rows_per_beat( std::int32_t pattern ) const; + + //! Get the rows per measure of a pattern + /*! + \param pattern The pattern whose time signature should be retrieved. + \return The rows per measure of the given pattern. If the pattern does not exist or the time signature is not defined, 0 is returned. + \remarks Many module formats lack time signature metadata. In this case, the returned value may be an incorrect estimation. + \since 0.8.0 + */ + LIBOPENMPT_CXX_API_MEMBER std::int32_t get_pattern_rows_per_measure( std::int32_t pattern ) const; + //! Get raw pattern content /*! \param pattern The pattern whose data should be retrieved. Modified: trunk/OpenMPT/libopenmpt/libopenmpt_c.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_c.cpp Sun Oct 20 13:28:17 2024 (r21864) +++ trunk/OpenMPT/libopenmpt/libopenmpt_c.cpp Sun Oct 20 13:48:19 2024 (r21865) @@ -1273,6 +1273,25 @@ return 0; } +int32_t openmpt_module_get_pattern_rows_per_beat( openmpt_module * mod, int32_t pattern ) { + try { + openmpt::interface::check_soundfile( mod ); + return mod->impl->get_pattern_rows_per_beat( pattern ); + } catch ( ... ) { + openmpt::report_exception( __func__, mod ); + } + return 0; +} +int32_t openmpt_module_get_pattern_rows_per_measure( openmpt_module * mod, int32_t pattern ) { + try { + openmpt::interface::check_soundfile( mod ); + return mod->impl->get_pattern_rows_per_measure( pattern ); + } catch ( ... ) { + openmpt::report_exception( __func__, mod ); + } + return 0; +} + uint8_t openmpt_module_get_pattern_row_channel_command( openmpt_module * mod, int32_t pattern, int32_t row, int32_t channel, int command ) { try { openmpt::interface::check_soundfile( mod ); Modified: trunk/OpenMPT/libopenmpt/libopenmpt_cxx.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_cxx.cpp Sun Oct 20 13:28:17 2024 (r21864) +++ trunk/OpenMPT/libopenmpt/libopenmpt_cxx.cpp Sun Oct 20 13:48:19 2024 (r21865) @@ -407,6 +407,14 @@ return impl->get_pattern_num_rows( pattern ); } +std::int32_t module::get_pattern_rows_per_beat( std::int32_t pattern ) const { + return impl->get_pattern_rows_per_beat( pattern ); +} + +std::int32_t module::get_pattern_rows_per_measure( std::int32_t pattern ) const { + return impl->get_pattern_rows_per_measure( pattern ); +} + std::uint8_t module::get_pattern_row_channel_command( std::int32_t pattern, std::int32_t row, std::int32_t channel, int command ) const { return impl->get_pattern_row_channel_command( pattern, row, channel, command ); } Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp Sun Oct 20 13:28:17 2024 (r21864) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp Sun Oct 20 13:48:19 2024 (r21865) @@ -1484,6 +1484,26 @@ return m_sndFile->Patterns[p].GetNumRows(); } +std::int32_t module_impl::get_pattern_rows_per_beat( std::int32_t p ) const { + if ( !mpt::is_in_range( p, std::numeric_limits<OpenMPT::PATTERNINDEX>::min(), std::numeric_limits<OpenMPT::PATTERNINDEX>::max() ) || !m_sndFile->Patterns.IsValidPat( static_cast<OpenMPT::PATTERNINDEX>( p ) ) ) { + return 0; + } + if ( m_sndFile->Patterns[p].GetOverrideSignature() ) { + return m_sndFile->Patterns[p].GetRowsPerBeat(); + } + return m_sndFile->m_nDefaultRowsPerBeat; +} + +std::int32_t module_impl::get_pattern_rows_per_measure( std::int32_t p ) const { + if ( !mpt::is_in_range( p, std::numeric_limits<OpenMPT::PATTERNINDEX>::min(), std::numeric_limits<OpenMPT::PATTERNINDEX>::max() ) || !m_sndFile->Patterns.IsValidPat( static_cast<OpenMPT::PATTERNINDEX>( p ) ) ) { + return 0; + } + if ( m_sndFile->Patterns[p].GetOverrideSignature() ) { + return m_sndFile->Patterns[p].GetRowsPerMeasure(); + } + return m_sndFile->m_nDefaultRowsPerMeasure; +} + std::uint8_t module_impl::get_pattern_row_channel_command( std::int32_t p, std::int32_t r, std::int32_t c, int cmd ) const { if ( !mpt::is_in_range( p, std::numeric_limits<OpenMPT::PATTERNINDEX>::min(), std::numeric_limits<OpenMPT::PATTERNINDEX>::max() ) || !m_sndFile->Patterns.IsValidPat( static_cast<OpenMPT::PATTERNINDEX>( p ) ) ) { return 0; Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp Sun Oct 20 13:28:17 2024 (r21864) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp Sun Oct 20 13:48:19 2024 (r21865) @@ -249,6 +249,8 @@ bool is_order_stop_entry( std::int32_t order ) const; static bool is_pattern_stop_item( std::int32_t pattern ); std::int32_t get_pattern_num_rows( std::int32_t p ) const; + std::int32_t get_pattern_rows_per_beat( std::int32_t pattern ) const; + std::int32_t get_pattern_rows_per_measure( std::int32_t pattern ) const; std::uint8_t get_pattern_row_channel_command( std::int32_t p, std::int32_t r, std::int32_t c, int cmd ) const; std::string format_pattern_row_channel_command( std::int32_t p, std::int32_t r, std::int32_t c, int cmd ) const; std::string highlight_pattern_row_channel_command( std::int32_t p, std::int32_t r, std::int32_t c, int cmd ) const; |
From: <sv...@op...> - 2024-10-20 11:28:29
|
Author: manx Date: Sun Oct 20 13:28:17 2024 New Revision: 21864 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21864 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 Sun Oct 20 13:22:44 2024 (r21863) +++ trunk/OpenMPT/libopenmpt/libopenmpt_version.h Sun Oct 20 13:28:17 2024 (r21864) @@ -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.7" +#define OPENMPT_API_VERSION_PREREL "-pre.8" /*! \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 Sun Oct 20 13:22:44 2024 (r21863) +++ trunk/OpenMPT/libopenmpt/libopenmpt_version.mk Sun Oct 20 13:28:17 2024 (r21864) @@ -1,7 +1,7 @@ LIBOPENMPT_VERSION_MAJOR=0 LIBOPENMPT_VERSION_MINOR=8 LIBOPENMPT_VERSION_PATCH=0 -LIBOPENMPT_VERSION_PREREL=-pre.7 +LIBOPENMPT_VERSION_PREREL=-pre.8 LIBOPENMPT_LTVER_CURRENT=5 LIBOPENMPT_LTVER_REVISION=0 |
From: <sv...@op...> - 2024-10-20 11:22:52
|
Author: sagamusix Date: Sun Oct 20 13:22:44 2024 New Revision: 21863 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21863 Log: [New] libopenmpt: Add new functions to check if an order list entry or pattern index is a skip (+++) or stop (---) index: is_order_stop_entry, is_pattern_skip_item, is_order_stop_entry, is_pattern_stop_item (https://bugs.openmpt.org/view.php?id=1766). Modified: trunk/OpenMPT/libopenmpt/bindings/freebasic/libopenmpt.bi trunk/OpenMPT/libopenmpt/libopenmpt.h trunk/OpenMPT/libopenmpt/libopenmpt.hpp trunk/OpenMPT/libopenmpt/libopenmpt_c.cpp trunk/OpenMPT/libopenmpt/libopenmpt_cxx.cpp trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp Modified: trunk/OpenMPT/libopenmpt/bindings/freebasic/libopenmpt.bi ============================================================================== --- trunk/OpenMPT/libopenmpt/bindings/freebasic/libopenmpt.bi Sun Oct 20 12:45:13 2024 (r21862) +++ trunk/OpenMPT/libopenmpt/bindings/freebasic/libopenmpt.bi Sun Oct 20 13:22:44 2024 (r21863) @@ -1273,6 +1273,39 @@ '/ Declare Function openmpt_module_get_order_pattern(ByVal module As openmpt_module Ptr, ByVal order As Long) As Long +/'* \brief Check if specified order is a skip ("+++") item + + \param The order item to check. + \return Returns non-zero value if the pattern index at the given order position represents a skip item. During playback, this item is ignored and playback resumes at the next order list item. + \sa openmpt_module_is_order_stop_entry, openmpt_module_is_pattern_skip_item + \since 0.8.0 +'/ +Declare Function openmpt_module_is_order_skip_entry(ByVal module As openmpt_module Ptr, ByVal order As Long) As Long +/'* \brief Check if specified pattern index is a skip ("+++") item + + \param The pattern index to check. + \return Returns non-zero value if the pattern index represents a skip item. During playback, this item is ignored and playback resumes at the next order list item. + \sa openmpt_module_is_pattern_stop_item, openmpt_module_is_order_skip_entry, openmpt_module_get_order_pattern + \since 0.8.0 +'/ +Declare Function openmpt_module_is_pattern_skip_item(ByVal module As openmpt_module Ptr, ByVal pattern As Long) As Long +/'* \brief Check if specified order is a stop ("---") item + + \param The order item to check. + \return Returns non-zero value if the pattern index at the given order position represents a stop item. When this item is reached, playback continues at the restart position of the current sub-song. + \sa openmpt_module_is_order_skip_entry, openmpt_module_is_pattern_stop_item + \since 0.8.0 +'/ +Declare Function openmpt_module_is_order_stop_entry(ByVal module As openmpt_module Ptr, ByVal order As Long) As Long +/'* \brief Check if specified pattern index is a stop ("---") item + + \param The pattern index to check. + \return Returns non-zero value if the pattern index represents a stop item. When this item is reached, playback continues at the restart position of the current sub-song. + \sa openmpt_module_is_pattern_skip_item, openmpt_module_is_order_stop_entry, openmpt_module_get_order_pattern + \since 0.8.0 +'/ +Declare Function openmpt_module_is_pattern_stop_item(ByVal module As openmpt_module Ptr, ByVal pattern As Long) As Long + /'* \brief Get the number of rows in a pattern \param module The module handle to work on. Modified: trunk/OpenMPT/libopenmpt/libopenmpt.h ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.h Sun Oct 20 12:45:13 2024 (r21862) +++ trunk/OpenMPT/libopenmpt/libopenmpt.h Sun Oct 20 13:22:44 2024 (r21863) @@ -1330,6 +1330,40 @@ * \return The pattern index found at the given order position of the current sequence. */ LIBOPENMPT_API int32_t openmpt_module_get_order_pattern( openmpt_module * mod, int32_t order ); + +/*! \brief Check if specified order is a skip ("+++") item + * + * \param The order item to check. + * \return Returns non-zero value if the pattern index at the given order position represents a skip item. During playback, this item is ignored and playback resumes at the next order list item. + * \sa openmpt_module_is_order_stop_entry, openmpt_module_is_pattern_skip_item + * \since 0.8.0 + */ +LIBOPENMPT_API int openmpt_module_is_order_skip_entry( openmpt_module * mod, int32_t order ); +/*! \brief Check if specified pattern index is a skip ("+++") item + * + * \param The pattern index to check. + * \return Returns non-zero value if the pattern index represents a skip item. During playback, this item is ignored and playback resumes at the next order list item. + * \sa openmpt_module_is_pattern_stop_item, openmpt_module_is_order_skip_entry, openmpt_module_get_order_pattern + * \since 0.8.0 + */ +LIBOPENMPT_API int openmpt_module_is_pattern_skip_item( openmpt_module * mod, int32_t pattern ); +/*! \brief Check if specified order is a stop ("---") item + * + * \param The order item to check. + * \return Returns non-zero value if the pattern index at the given order position represents a stop item. When this item is reached, playback continues at the restart position of the current sub-song. + * \sa openmpt_module_is_order_skip_entry, openmpt_module_is_pattern_stop_item + * \since 0.8.0 + */ +LIBOPENMPT_API int openmpt_module_is_order_stop_entry( openmpt_module * mod, int32_t order ); +/*! \brief Check if specified pattern index is a stop ("---") item + * + * \param The pattern index to check. + * \return Returns non-zero value if the pattern index represents a stop item. When this item is reached, playback continues at the restart position of the current sub-song. + * \sa openmpt_module_is_pattern_skip_item, openmpt_module_is_order_stop_entry, openmpt_module_get_order_pattern + * \since 0.8.0 + */ +LIBOPENMPT_API int openmpt_module_is_pattern_stop_item( openmpt_module * mod, int32_t pattern ); + /*! \brief Get the number of rows in a pattern * * \param mod The module handle to work on. Modified: trunk/OpenMPT/libopenmpt/libopenmpt.hpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt.hpp Sun Oct 20 12:45:13 2024 (r21862) +++ trunk/OpenMPT/libopenmpt/libopenmpt.hpp Sun Oct 20 13:22:44 2024 (r21863) @@ -989,6 +989,39 @@ */ LIBOPENMPT_CXX_API_MEMBER std::int32_t get_order_pattern( std::int32_t order ) const; + //! Check if specified order is a skip ("+++") item + /*! + \param The order item to check. + \return Returns true if the pattern index at the given order position represents a skip item. During playback, this item is ignored and playback resumes at the next order list item. + \sa openmpt::module::is_order_stop_entry, openmpt::module::is_pattern_skip_item + \since 0.8.0 + */ + LIBOPENMPT_CXX_API_MEMBER bool is_order_skip_entry( std::int32_t order ) const ; + //! Check if specified pattern index is a skip ("+++") item + /*! + \param The pattern index to check. + \return Returns true if the pattern index represents a skip item. During playback, this item is ignored and playback resumes at the next order list item. + \sa openmpt::module::is_pattern_stop_item, openmpt::module::is_order_skip_entry, openmpt::module::get_order_pattern + \since 0.8.0 + */ + LIBOPENMPT_CXX_API_MEMBER bool is_pattern_skip_item( std::int32_t pattern ) const; + //! Check if specified order is a stop ("---") item + /*! + \param The order item to check. + \return Returns true if the pattern index at the given order position represents a stop item. When this item is reached, playback continues at the restart position of the current sub-song. + \sa openmpt::module::is_order_skip_entry, openmpt::module::is_pattern_stop_item + \since 0.8.0 + */ + LIBOPENMPT_CXX_API_MEMBER bool is_order_stop_entry( std::int32_t order ) const; + //! Check if specified pattern index is a stop ("---") item + /*! + \param The pattern index to check. + \return Returns true if the pattern index represents a stop item. When this item is reached, playback continues at the restart position of the current sub-song. + \sa openmpt::module::is_pattern_skip_item, openmpt::module::is_order_stop_entry, openmpt::module::get_order_pattern + \since 0.8.0 + */ + LIBOPENMPT_CXX_API_MEMBER bool is_pattern_stop_item( std::int32_t pattern ) const; + //! Get the number of rows in a pattern /*! \param pattern The pattern whose row count should be retrieved. Modified: trunk/OpenMPT/libopenmpt/libopenmpt_c.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_c.cpp Sun Oct 20 12:45:13 2024 (r21862) +++ trunk/OpenMPT/libopenmpt/libopenmpt_c.cpp Sun Oct 20 13:22:44 2024 (r21863) @@ -1225,6 +1225,44 @@ return 0; } +int openmpt_module_is_order_skip_entry( openmpt_module * mod, int32_t order ) { + try { + openmpt::interface::check_soundfile( mod ); + return mod->impl->is_order_skip_entry( order ) ? 1 : 0; + } catch ( ... ) { + openmpt::report_exception( __func__, mod ); + } + return 0; +} +int openmpt_module_is_pattern_skip_item( openmpt_module * mod, int32_t pattern ) { + try { + openmpt::interface::check_soundfile( mod ); + return mod->impl->is_pattern_skip_item( pattern ) ? 1 : 0; + } catch ( ... ) { + openmpt::report_exception( __func__, mod ); + } + return 0; +} +int openmpt_module_is_order_stop_entry( openmpt_module * mod, int32_t order ) { + try { + openmpt::interface::check_soundfile( mod ); + return mod->impl->is_order_stop_entry( order ) ? 1 : 0; + } catch ( ... ) { + openmpt::report_exception( __func__, mod ); + } + return 0; +} +int openmpt_module_is_pattern_stop_item( openmpt_module * mod, int32_t pattern ) { + try { + openmpt::interface::check_soundfile( mod ); + return mod->impl->is_pattern_stop_item( pattern ) ? 1 : 0; + } catch ( ... ) { + openmpt::report_exception( __func__, mod ); + } + return 0; +} + + int32_t openmpt_module_get_pattern_num_rows( openmpt_module * mod, int32_t pattern ) { try { openmpt::interface::check_soundfile( mod ); Modified: trunk/OpenMPT/libopenmpt/libopenmpt_cxx.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_cxx.cpp Sun Oct 20 12:45:13 2024 (r21862) +++ trunk/OpenMPT/libopenmpt/libopenmpt_cxx.cpp Sun Oct 20 13:22:44 2024 (r21863) @@ -389,6 +389,20 @@ std::int32_t module::get_order_pattern( std::int32_t order ) const { return impl->get_order_pattern( order ); } + +bool module::is_order_skip_entry(std::int32_t order) const { + return impl->is_order_skip_entry( order ); +} +bool module::is_pattern_skip_item( std::int32_t pattern ) const { + return module_impl::is_pattern_skip_item( pattern ); +} +bool module::is_order_stop_entry( std::int32_t order ) const { + return impl->is_order_stop_entry( order ); +} +bool module::is_pattern_stop_item( std::int32_t pattern ) const { + return module_impl::is_pattern_stop_item( pattern ); +} + std::int32_t module::get_pattern_num_rows( std::int32_t pattern ) const { return impl->get_pattern_num_rows( pattern ); } Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp Sun Oct 20 12:45:13 2024 (r21862) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp Sun Oct 20 13:22:44 2024 (r21863) @@ -1457,6 +1457,26 @@ } return m_sndFile->Order()[o]; } + +bool module_impl::is_order_skip_entry( std::int32_t order ) const { + if ( order < 0 || order >= m_sndFile->Order().GetLengthTailTrimmed() ) { + return false; + } + return is_pattern_skip_item( m_sndFile->Order()[order] ); +} +bool module_impl::is_pattern_skip_item( std::int32_t pattern ) { + return pattern == OpenMPT::PATTERNINDEX_SKIP; +} +bool module_impl::is_order_stop_entry( std::int32_t order ) const { + if ( order < 0 || order >= m_sndFile->Order().GetLengthTailTrimmed() ) { + return false; + } + return is_pattern_stop_item( m_sndFile->Order()[order] ); +} +bool module_impl::is_pattern_stop_item( std::int32_t pattern ) { + return pattern == OpenMPT::PATTERNINDEX_INVALID; +} + std::int32_t module_impl::get_pattern_num_rows( std::int32_t p ) const { if ( !mpt::is_in_range( p, std::numeric_limits<OpenMPT::PATTERNINDEX>::min(), std::numeric_limits<OpenMPT::PATTERNINDEX>::max() ) || !m_sndFile->Patterns.IsValidPat( static_cast<OpenMPT::PATTERNINDEX>( p ) ) ) { return 0; Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp Sun Oct 20 12:45:13 2024 (r21862) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.hpp Sun Oct 20 13:22:44 2024 (r21863) @@ -244,6 +244,10 @@ std::vector<std::string> get_instrument_names() const; std::vector<std::string> get_sample_names() const; std::int32_t get_order_pattern( std::int32_t o ) const; + bool is_order_skip_entry( std::int32_t order ) const; + static bool is_pattern_skip_item( std::int32_t pattern ); + bool is_order_stop_entry( std::int32_t order ) const; + static bool is_pattern_stop_item( std::int32_t pattern ); std::int32_t get_pattern_num_rows( std::int32_t p ) const; std::uint8_t get_pattern_row_channel_command( std::int32_t p, std::int32_t r, std::int32_t c, int cmd ) const; std::string format_pattern_row_channel_command( std::int32_t p, std::int32_t r, std::int32_t c, int cmd ) const; |
From: <sv...@op...> - 2024-10-20 10:45:25
|
Author: sagamusix Date: Sun Oct 20 12:45:13 2024 New Revision: 21862 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21862 Log: [Fix] And another one... Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp Sun Oct 20 12:35:05 2024 (r21861) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp Sun Oct 20 12:45:13 2024 (r21862) @@ -1123,8 +1123,8 @@ } m_sndFile->SetCurrentOrder( static_cast<OpenMPT::ORDERINDEX>( subsong->start_order ) ); OpenMPT::GetLengthType t = m_sndFile->GetLength( m_ctl_seek_sync_samples ? OpenMPT::eAdjustSamplePositions : OpenMPT::eAdjust, OpenMPT::GetLengthTarget( seconds ).StartPos( static_cast<OpenMPT::SEQUENCEINDEX>( subsong->sequence ), static_cast<OpenMPT::ORDERINDEX>( subsong->start_order ), static_cast<OpenMPT::ROWINDEX>( subsong->start_row ) ) ).back(); - m_sndFile->m_PlayState.m_nNextOrder = m_sndFile->m_PlayState.m_nCurrentOrder = t.targetReached ? t.lastOrder : t.endOrder; - m_sndFile->m_PlayState.m_nNextRow = t.targetReached ? t.lastRow : t.endRow; + m_sndFile->m_PlayState.m_nNextOrder = m_sndFile->m_PlayState.m_nCurrentOrder = t.targetReached ? t.restartOrder : t.endOrder; + m_sndFile->m_PlayState.m_nNextRow = t.targetReached ? t.restartRow : t.endRow; m_sndFile->m_PlayState.m_nTickCount = OpenMPT::CSoundFile::TICKS_ROW_FINISHED; m_currentPositionSeconds = base_seconds + t.duration; return m_currentPositionSeconds; |
From: <sv...@op...> - 2024-10-20 10:35:17
|
Author: sagamusix Date: Sun Oct 20 12:35:05 2024 New Revision: 21861 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21861 Log: [Fix] One rename was missing. Modified: trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/soundlib/Sndfile.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp Sun Oct 20 12:29:43 2024 (r21860) +++ trunk/OpenMPT/soundlib/Sndfile.cpp Sun Oct 20 12:35:05 2024 (r21861) @@ -1796,7 +1796,7 @@ subSongs.reserve(subSongs.size() + subSongsSeq.size()); for(const auto &song : subSongsSeq) { - subSongs.push_back({song.duration, song.startRow, song.endRow, song.lastRow, song.startOrder, song.endOrder, song.restartOrder, seq}); + subSongs.push_back({song.duration, song.startRow, song.endRow, song.restartRow, song.startOrder, song.endOrder, song.restartOrder, seq}); } } return subSongs; |
From: <sv...@op...> - 2024-10-20 10:29:51
|
Author: sagamusix Date: Sun Oct 20 12:29:43 2024 New Revision: 21860 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21860 Log: [Ref] Rename GetLengthType members to be less ambiguous. Modified: trunk/OpenMPT/mptrack/PatternGotoDialog.cpp trunk/OpenMPT/mptrack/mod2midi.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/test/test.cpp Modified: trunk/OpenMPT/mptrack/PatternGotoDialog.cpp ============================================================================== --- trunk/OpenMPT/mptrack/PatternGotoDialog.cpp Sat Oct 19 23:31:54 2024 (r21859) +++ trunk/OpenMPT/mptrack/PatternGotoDialog.cpp Sun Oct 20 12:29:43 2024 (r21860) @@ -163,8 +163,8 @@ if(!result.targetReached) return; - m_nOrder = result.lastOrder; - m_nRow = result.lastRow; + m_nOrder = result.restartOrder; + m_nRow = result.restartRow; if(m_SndFile.Order().IsValidPat(m_nOrder)) m_nPattern = m_SndFile.Order()[m_nOrder]; Modified: trunk/OpenMPT/mptrack/mod2midi.cpp ============================================================================== --- trunk/OpenMPT/mptrack/mod2midi.cpp Sat Oct 19 23:31:54 2024 (r21859) +++ trunk/OpenMPT/mptrack/mod2midi.cpp Sun Oct 20 12:29:43 2024 (r21860) @@ -208,7 +208,7 @@ mpt::IO::WriteRaw(f, msg, 9); } - if(!m_tempoTrack && !m_wroteLoopStart && m_sndFile.m_PlayState.m_nRow == m_songLength.lastRow && m_sndFile.m_PlayState.m_nCurrentOrder == m_songLength.lastOrder) + if(!m_tempoTrack && !m_wroteLoopStart && m_sndFile.m_PlayState.m_nRow == m_songLength.restartRow && m_sndFile.m_PlayState.m_nCurrentOrder == m_songLength.restartOrder) { WriteString(kCue, U_("loopStart")); m_wroteLoopStart = true; Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Sat Oct 19 23:31:54 2024 (r21859) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Sun Oct 20 12:29:43 2024 (r21860) @@ -442,8 +442,8 @@ { if(!hasSearchTarget) { - retval.lastOrder = playState.m_nCurrentOrder; - retval.lastRow = 0; + retval.restartOrder = playState.m_nCurrentOrder; + retval.restartRow = 0; } if(target.mode == GetLengthTarget::NoTarget || !visitedRows.GetFirstUnvisitedRow(playState.m_nNextOrder, playState.m_nRow, true)) { @@ -523,8 +523,8 @@ { if(!hasSearchTarget) { - retval.lastOrder = playState.m_nCurrentOrder; - retval.lastRow = playState.m_nRow; + retval.restartOrder = playState.m_nCurrentOrder; + retval.restartRow = playState.m_nRow; } if(target.mode == GetLengthTarget::NoTarget || !visitedRows.GetFirstUnvisitedRow(playState.m_nNextOrder, playState.m_nRow, true)) { @@ -1352,8 +1352,8 @@ if(retval.targetReached) { - retval.lastOrder = playState.m_nCurrentOrder; - retval.lastRow = playState.m_nRow; + retval.restartOrder = playState.m_nCurrentOrder; + retval.restartRow = playState.m_nRow; } retval.duration = memory.elapsedTime; results.push_back(retval); Modified: trunk/OpenMPT/soundlib/Sndfile.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp Sat Oct 19 23:31:54 2024 (r21859) +++ trunk/OpenMPT/soundlib/Sndfile.cpp Sun Oct 20 12:29:43 2024 (r21860) @@ -1796,7 +1796,7 @@ subSongs.reserve(subSongs.size() + subSongsSeq.size()); for(const auto &song : subSongsSeq) { - subSongs.push_back({song.duration, song.startRow, song.endRow, song.lastRow, song.startOrder, song.endOrder, song.lastOrder, seq}); + subSongs.push_back({song.duration, song.startRow, song.endRow, song.lastRow, song.startOrder, song.endOrder, song.restartOrder, seq}); } } return subSongs; Modified: trunk/OpenMPT/soundlib/Sndfile.h ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h Sat Oct 19 23:31:54 2024 (r21859) +++ trunk/OpenMPT/soundlib/Sndfile.h Sun Oct 20 12:29:43 2024 (r21860) @@ -109,14 +109,14 @@ // Return values for GetLength() struct GetLengthType { - double duration = 0.0; // Total time in seconds - ROWINDEX lastRow = ROWINDEX_INVALID; // Last parsed row (if no target is specified, this is the first row that is parsed twice, i.e. not the *last* played order) - ROWINDEX endRow = ROWINDEX_INVALID; // Last row before module loops (UNDEFINED if a target is specified) - ROWINDEX startRow = 0; // First row of parsed subsong - ORDERINDEX lastOrder = ORDERINDEX_INVALID; // Last parsed order (see lastRow remark) - ORDERINDEX endOrder = ORDERINDEX_INVALID; // Last order before module loops (UNDEFINED if a target is specified) - ORDERINDEX startOrder = 0; // First order of parsed subsong - bool targetReached = false; // True if the specified order/row combination or duration has been reached while going through the module + double duration = 0.0; // Total time in seconds + ROWINDEX restartRow = ROWINDEX_INVALID; // First row to play after module loops (or last parsed row if target is specified; equal to target if it was found) + ROWINDEX endRow = ROWINDEX_INVALID; // Last row played before module loops (UNDEFINED if a target is specified) + ROWINDEX startRow = 0; // First row of parsed subsong + ORDERINDEX restartOrder = ORDERINDEX_INVALID; // First row to play after module loops (see restartRow remark) + ORDERINDEX endOrder = ORDERINDEX_INVALID; // Last order played before module loops (UNDEFINED if a target is specified) + ORDERINDEX startOrder = 0; // First order of parsed subsong + bool targetReached = false; // True if the specified order/row combination or duration has been reached while going through the module }; Modified: trunk/OpenMPT/soundlib/Sndmix.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp Sat Oct 19 23:31:54 2024 (r21859) +++ trunk/OpenMPT/soundlib/Sndmix.cpp Sun Oct 20 12:29:43 2024 (r21860) @@ -601,7 +601,7 @@ { for(const auto &t : GetLength(eNoAdjust, GetLengthTarget(true))) { - if(t.lastOrder == m_PlayState.m_nCurrentOrder && t.lastRow == m_PlayState.m_nRow) + if(t.restartOrder == m_PlayState.m_nCurrentOrder && t.restartRow == m_PlayState.m_nRow) { isReallyAtEnd = true; break; Modified: trunk/OpenMPT/test/test.cpp ============================================================================== --- trunk/OpenMPT/test/test.cpp Sat Oct 19 23:31:54 2024 (r21859) +++ trunk/OpenMPT/test/test.cpp Sun Oct 20 12:29:43 2024 (r21860) @@ -3421,10 +3421,10 @@ VERIFY_EQUAL_NONCONT(allSubSongs.size(), 2); VERIFY_EQUAL_EPS(allSubSongs[0].duration, 2.04, 0.1); VERIFY_EQUAL_EPS(allSubSongs[1].duration, 118.84, 0.1); - VERIFY_EQUAL_NONCONT(allSubSongs[0].lastOrder, 0); - VERIFY_EQUAL_NONCONT(allSubSongs[0].lastRow, 1); - VERIFY_EQUAL_NONCONT(allSubSongs[1].lastOrder, 2); - VERIFY_EQUAL_NONCONT(allSubSongs[1].lastRow, 61); + VERIFY_EQUAL_NONCONT(allSubSongs[0].restartOrder, 0); + VERIFY_EQUAL_NONCONT(allSubSongs[0].restartRow, 1); + VERIFY_EQUAL_NONCONT(allSubSongs[1].restartOrder, 2); + VERIFY_EQUAL_NONCONT(allSubSongs[1].restartRow, 61); VERIFY_EQUAL_NONCONT(allSubSongs[1].startOrder, 2); VERIFY_EQUAL_NONCONT(allSubSongs[1].startRow, 0); |
From: <sv...@op...> - 2024-10-19 21:32:06
|
Author: sagamusix Date: Sat Oct 19 23:31:54 2024 New Revision: 21859 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21859 Log: [Fix] XM: If key-off is encountered before auto-vibrato sweep reaches full depth, the vibrato depth is reset. Test case: AutoVibratoSweepKeyOff.xm [Mod] OpenMPT: Version is now 1.32.00.29 Modified: trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/UpgradeModule.cpp Modified: trunk/OpenMPT/common/versionNumber.h ============================================================================== --- trunk/OpenMPT/common/versionNumber.h Sat Oct 19 13:46:07 2024 (r21858) +++ trunk/OpenMPT/common/versionNumber.h Sat Oct 19 23:31:54 2024 (r21859) @@ -16,4 +16,4 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 32 #define VER_MINOR 00 -#define VER_MINORMINOR 28 +#define VER_MINORMINOR 29 Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp ============================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp Sat Oct 19 13:46:07 2024 (r21858) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp Sat Oct 19 23:31:54 2024 (r21859) @@ -79,7 +79,7 @@ BOOL CModTypeDlg::OnInitDialog() { DialogBase::OnInitDialog(); - m_nType = sndFile.GetType(); + m_nType = sndFile.GetBestSaveFormat(); m_nChannels = sndFile.GetNumChannels(); m_tempoSwing = sndFile.m_tempoSwing; m_playBehaviour = sndFile.m_playBehaviour; @@ -732,6 +732,7 @@ case kMIDINotesFromChannelPlugin: desc = _T("MIDI notes can be sent to channel plugins"); break; case kITDoublePortamentoSlides: desc = _T("Parameters of conflicting volume and effect column portamento commands may overwrite each other"); break; case kS3MIgnoreCombinedFineSlides: desc =_T("Ignore combined fine slides (Kxy / Lxy)"); break; + case kFT2AutoVibratoAbortSweep: desc = _T("Key-off before auto-vibrato sweep-in is complete resets auto-vibrato depth"); break; default: MPT_ASSERT_NOTREACHED(); } Modified: trunk/OpenMPT/soundlib/Snd_defs.h ============================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h Sat Oct 19 13:46:07 2024 (r21858) +++ trunk/OpenMPT/soundlib/Snd_defs.h Sat Oct 19 23:31:54 2024 (r21859) @@ -601,6 +601,7 @@ kMIDINotesFromChannelPlugin, // Behaviour before OpenMPT 1.26: Channel plugin can be used to send MIDI notes kITDoublePortamentoSlides, // IT only reads parameters once per row, so if two commands sharing effect parameters are found in the two effect columns, they influence each other kS3MIgnoreCombinedFineSlides, // S3M commands Kxy and Lxy ignore fine slides + kFT2AutoVibratoAbortSweep, // Key-off before auto-vibrato sweep-in is complete resets auto-vibrato depth // Add new play behaviours here. Modified: trunk/OpenMPT/soundlib/Sndfile.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp Sat Oct 19 13:46:07 2024 (r21858) +++ trunk/OpenMPT/soundlib/Sndfile.cpp Sat Oct 19 23:31:54 2024 (r21859) @@ -1242,6 +1242,7 @@ playBehaviour.set(kFT2PanSustainRelease); playBehaviour.set(kFT2NoteDelayWithoutInstr); playBehaviour.set(kFT2PortaResetDirection); + playBehaviour.set(kFT2AutoVibratoAbortSweep); break; case MOD_TYPE_S3M: Modified: trunk/OpenMPT/soundlib/Sndmix.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp Sat Oct 19 13:46:07 2024 (r21858) +++ trunk/OpenMPT/soundlib/Sndmix.cpp Sat Oct 19 23:31:54 2024 (r21859) @@ -1848,23 +1848,33 @@ } else { // MPT's autovibrato code + int32 autoVibDepth = chn.nAutoVibDepth; + const int32 fullDepth = pSmp->nVibDepth * 256u; if (pSmp->nVibSweep == 0 && !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT))) { - chn.nAutoVibDepth = pSmp->nVibDepth * 256; + autoVibDepth = fullDepth; } else { // Calculate current autovibrato depth using vibsweep - if (GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) + if(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) { - chn.nAutoVibDepth += pSmp->nVibSweep * 2u; + autoVibDepth += pSmp->nVibSweep * 2u; + LimitMax(autoVibDepth, fullDepth); + chn.nAutoVibDepth = autoVibDepth; } else { - if(!chn.dwFlags[CHN_KEYOFF]) + if(!chn.dwFlags[CHN_KEYOFF] && autoVibDepth <= fullDepth) { - chn.nAutoVibDepth += (pSmp->nVibDepth * 256u) / pSmp->nVibSweep; + autoVibDepth += fullDepth / pSmp->nVibSweep; + chn.nAutoVibDepth = autoVibDepth; } + // FT2 compatibility: Key-off before auto-vibrato sweep-in is complete resets auto-vibrato depth + // Test case: AutoVibratoSweepKeyOff.xm + if(autoVibDepth > fullDepth) + autoVibDepth = fullDepth; + else if(chn.dwFlags[CHN_KEYOFF] && m_playBehaviour[kFT2AutoVibratoAbortSweep]) + autoVibDepth = fullDepth / pSmp->nVibSweep; } - LimitMax(chn.nAutoVibDepth, static_cast<int>(pSmp->nVibDepth * 256u)); } chn.nAutoVibPos += pSmp->nVibRate; int vdelta; @@ -1896,7 +1906,7 @@ vdelta = (-ITSinusTable[(chn.nAutoVibPos + 192) & 0xFF] + 64) / 2; } } - int n = (vdelta * chn.nAutoVibDepth) / 256; + int n = (vdelta * autoVibDepth) / 256; if(hasTuning) { Modified: trunk/OpenMPT/soundlib/UpgradeModule.cpp ============================================================================== --- trunk/OpenMPT/soundlib/UpgradeModule.cpp Sat Oct 19 13:46:07 2024 (r21858) +++ trunk/OpenMPT/soundlib/UpgradeModule.cpp Sat Oct 19 23:31:54 2024 (r21859) @@ -625,6 +625,7 @@ { kFT2NoteDelayWithoutInstr, MPT_V("1.28.00.44") }, { kITFT2DontResetNoteOffOnPorta, MPT_V("1.29.00.34") }, { kFT2PortaResetDirection, MPT_V("1.30.00.40") }, + { kFT2AutoVibratoAbortSweep, MPT_V("1.32.00.29") }, }; for(const auto &b : behaviours) |
From: <sv...@op...> - 2024-10-19 11:46:16
|
Author: sagamusix Date: Sat Oct 19 13:46:07 2024 New Revision: 21858 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21858 Log: [Ref] Remove ModSequence/ModSequenceSet::GetInvalidPatIndex/GetIgnoreIndex. Directly use PATTERNINDEX_INVALID and new PATTERNINDEX_SKIP instead. Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp trunk/OpenMPT/mptrack/AppendModule.cpp trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/MPTHacks.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/PatternClipboard.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/soundlib/Load_etx.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_med.cpp trunk/OpenMPT/soundlib/Load_plm.cpp trunk/OpenMPT/soundlib/Load_psm.cpp trunk/OpenMPT/soundlib/Load_stm.cpp trunk/OpenMPT/soundlib/Load_symmod.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/Loaders.h trunk/OpenMPT/soundlib/MODTools.cpp trunk/OpenMPT/soundlib/ModSequence.cpp trunk/OpenMPT/soundlib/ModSequence.h trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/test/test.cpp Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -1415,9 +1415,9 @@ if ( m_sndFile->Patterns.IsValidIndex( pat ) ) { retval.push_back( mod_string_to_utf8( m_sndFile->Patterns[ m_sndFile->Order()[i] ].GetName() ) ); } else { - if ( pat == m_sndFile->Order.GetIgnoreIndex() ) { + if ( pat == OpenMPT::PATTERNINDEX_SKIP ) { retval.push_back( "+++ skip" ); - } else if ( pat == m_sndFile->Order.GetInvalidPatIndex() ) { + } else if ( pat == OpenMPT::PATTERNINDEX_INVALID ) { retval.push_back( "--- stop" ); } else { retval.push_back( "???" ); Modified: trunk/OpenMPT/mptrack/AppendModule.cpp ============================================================================== --- trunk/OpenMPT/mptrack/AppendModule.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/mptrack/AppendModule.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -202,12 +202,12 @@ continue; } insertPat = patternMapping[srcPat]; - } else if(srcPat == srcOrder.GetIgnoreIndex() && specs.hasIgnoreIndex) + } else if(srcPat == PATTERNINDEX_SKIP && specs.hasIgnoreIndex) { - insertPat = m_SndFile.Order.GetIgnoreIndex(); - } else if(srcPat == srcOrder.GetInvalidPatIndex() && specs.hasStopIndex) + insertPat = PATTERNINDEX_SKIP; + } else if(srcPat == PATTERNINDEX_INVALID && specs.hasStopIndex) { - insertPat = m_SndFile.Order.GetInvalidPatIndex(); + insertPat = PATTERNINDEX_INVALID; } else { continue; Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -416,7 +416,7 @@ } m_pParent.SetCurrentPattern(n); - } else if(setPlayPos && !shiftClick && n != Order().GetIgnoreIndex() && n != Order().GetInvalidPatIndex()) + } else if(setPlayPos && !shiftClick && n != PATTERNINDEX_SKIP && n != PATTERNINDEX_INVALID) { m_pParent.SetCurrentPattern(n); } @@ -599,7 +599,7 @@ PATTERNINDEX curIndex = Order()[m_nScrollPos]; const PATTERNINDEX maxIndex = std::max(PATTERNINDEX(1), sndFile.Patterns.GetNumPatterns()) - 1; - const PATTERNINDEX firstInvalid = sndFile.GetModSpecifications().hasIgnoreIndex ? sndFile.Order.GetIgnoreIndex() : sndFile.Order.GetInvalidPatIndex(); + const PATTERNINDEX firstInvalid = sndFile.GetModSpecifications().hasIgnoreIndex ? PATTERNINDEX_SKIP : PATTERNINDEX_INVALID; if(enterNum >= 0 && enterNum <= 9) // enter 0...9 { @@ -615,7 +615,7 @@ { if(curIndex == 0) { - curIndex = sndFile.Order.GetInvalidPatIndex(); + curIndex = PATTERNINDEX_INVALID; } else if(curIndex > maxIndex && curIndex <= firstInvalid) { curIndex = maxIndex; @@ -628,7 +628,7 @@ } } else if(enterNum == 11) // increase pattern index { - if(curIndex >= sndFile.Order.GetInvalidPatIndex()) + if(curIndex >= PATTERNINDEX_INVALID) { curIndex = 0; } else if(curIndex >= maxIndex && curIndex < firstInvalid) @@ -644,12 +644,10 @@ } else if(enterNum == 12) // ignore index (+++) { if(sndFile.GetModSpecifications().hasIgnoreIndex) - { - curIndex = sndFile.Order.GetIgnoreIndex(); - } + curIndex = PATTERNINDEX_SKIP; } else if(enterNum == 13) // invalid index (---) { - curIndex = sndFile.Order.GetInvalidPatIndex(); + curIndex = PATTERNINDEX_INVALID; } // apply if(curIndex != Order()[m_nScrollPos]) @@ -746,9 +744,9 @@ s += _T(", "); first = false; PATTERNINDEX pat = order[o]; - if(pat == ModSequence::GetIgnoreIndex()) + if(pat == PATTERNINDEX_SKIP) s += _T(" Skip"); - else if(pat == ModSequence::GetInvalidPatIndex()) + else if(pat == PATTERNINDEX_INVALID) s += _T(" Stop"); else s += MPT_CFORMAT("Pattern {}")(pat); @@ -864,9 +862,9 @@ const PATTERNINDEX pat = (ord < order.size()) ? order[ord] : PATTERNINDEX_INVALID; if(ord < maxEntries && (rect.left + m_cxFont - 4) <= rcClient.right) { - if(pat == order.GetInvalidPatIndex()) + if(pat == PATTERNINDEX_INVALID) _tcscpy(s, _T("---")); - else if(pat == order.GetIgnoreIndex()) + else if(pat == PATTERNINDEX_SKIP) _tcscpy(s, _T("+++")); else wsprintf(s, _T("%u"), pat); @@ -1198,7 +1196,7 @@ PATTERNINDEX pat = Order()[m_nScrollPos]; if(sndFile.Patterns.IsValidPat(pat)) m_pParent.SetCurrentPattern(pat); - else if(pat != sndFile.Order.GetIgnoreIndex()) + else if(pat != PATTERNINDEX_SKIP) OnCreateNewPattern(); } @@ -1300,14 +1298,14 @@ if(!EnsureEditable(insertPos)) return; - if(order[insertPos] != order.GetInvalidPatIndex()) + if(order[insertPos] != PATTERNINDEX_INVALID) { // If we're not inserting at a stop (---) index, we move on by one position. insertPos++; - order.insert(insertPos, 1, order.GetIgnoreIndex()); + order.insert(insertPos, 1, PATTERNINDEX_SKIP); } else { - order[insertPos] = order.GetIgnoreIndex(); + order[insertPos] = PATTERNINDEX_SKIP; } InsertUpdatePlaystate(insertPos, insertPos); @@ -1556,7 +1554,7 @@ const ORDERINDEX length = Order().GetLength(); // If this is not a playable order item, find the next valid item. - while(order < length && (Order()[order] == sndFile.Order.GetIgnoreIndex() || Order()[order] == sndFile.Order.GetInvalidPatIndex())) + while(order < length && (Order()[order] == PATTERNINDEX_SKIP || Order()[order] == PATTERNINDEX_INVALID)) { order++; } Modified: trunk/OpenMPT/mptrack/MPTHacks.cpp ============================================================================== --- trunk/OpenMPT/mptrack/MPTHacks.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/mptrack/MPTHacks.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -87,14 +87,14 @@ #endif // NO_PLUGINS // Check for invalid order items - if(!originalSpecs->hasIgnoreIndex && mpt::contains(m_SndFile.Order(), m_SndFile.Order.GetIgnoreIndex())) + if(!originalSpecs->hasIgnoreIndex && mpt::contains(m_SndFile.Order(), PATTERNINDEX_SKIP)) { foundHacks = true; AddToLog("This format does not support separator (+++) patterns"); if(autofix) { - m_SndFile.Order().RemovePattern(m_SndFile.Order.GetIgnoreIndex()); + m_SndFile.Order().RemovePattern(PATTERNINDEX_SKIP); } } @@ -105,7 +105,7 @@ if(autofix) { - m_SndFile.Order().RemovePattern(m_SndFile.Order.GetInvalidPatIndex()); + m_SndFile.Order().RemovePattern(PATTERNINDEX_INVALID); } } @@ -339,7 +339,7 @@ instr->VolEnv.nReleaseNode = instr->PanEnv.nReleaseNode = instr->PitchEnv.nReleaseNode = ENV_RELEASE_NODE_UNSET; } } - if((m_SndFile.GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (instr->nFadeOut % 32u) != 0) + if((modType & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (instr->nFadeOut % 32u) != 0) { foundHere = foundHacks = true; if(autofix) Modified: trunk/OpenMPT/mptrack/Moddoc.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/mptrack/Moddoc.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -2198,7 +2198,8 @@ { for (ORDERINDEX nOrd = 0; nOrd < m_SndFile.Order().GetLength(); nOrd++) { - if (m_SndFile.Order()[nOrd] == m_SndFile.Order.GetInvalidPatIndex()) break; + if (m_SndFile.Order()[nOrd] == PATTERNINDEX_INVALID) + break; if (m_SndFile.Order()[nOrd] == nPat) { m_SndFile.m_PlayState.m_nCurrentOrder = nOrd; Modified: trunk/OpenMPT/mptrack/Modedit.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/mptrack/Modedit.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -953,7 +953,7 @@ return false; auto &sourceSequence = m_SndFile.Order(sourceSeq); - const PATTERNINDEX sourcePat = sourceOrd < sourceSequence.size() ? sourceSequence[sourceOrd] : sourceSequence.GetInvalidPatIndex(); + const PATTERNINDEX sourcePat = sourceOrd < sourceSequence.size() ? sourceSequence[sourceOrd] : PATTERNINDEX_INVALID; // Delete source if(!copy) Modified: trunk/OpenMPT/mptrack/PatternClipboard.cpp ============================================================================== --- trunk/OpenMPT/mptrack/PatternClipboard.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/mptrack/PatternClipboard.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -88,10 +88,10 @@ if(ord != first) data += ','; - if(pattern == order.GetInvalidPatIndex()) + if(pattern == PATTERNINDEX_INVALID) { data += '-'; - } else if(pattern == order.GetIgnoreIndex()) + } else if(pattern == PATTERNINDEX_SKIP) { data += '+'; } else if(sndFile.Patterns.IsValidPat(pattern)) @@ -451,10 +451,10 @@ if(data[curPos] == '+') { - insertPat = order.GetIgnoreIndex(); + insertPat = PATTERNINDEX_SKIP; } else if(data[curPos] == '-') { - insertPat = order.GetInvalidPatIndex(); + insertPat = PATTERNINDEX_INVALID; } else { insertPat = mpt::parse<PATTERNINDEX>(data.substr(curPos, 10)); @@ -482,8 +482,7 @@ } } - if((insertPat == order.GetIgnoreIndex() && !sndFile.GetModSpecifications().hasIgnoreIndex) - || (insertPat == order.GetInvalidPatIndex() && !sndFile.GetModSpecifications().hasStopIndex) + if((insertPat == PATTERNINDEX_SKIP && !sndFile.GetModSpecifications().hasIgnoreIndex) || insertPat == PATTERNINDEX_INVALID || patternMode == kMultiOverwrite) { Modified: trunk/OpenMPT/mptrack/View_pat.cpp ============================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/mptrack/View_pat.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -210,7 +210,7 @@ if(pSndFile == nullptr) return false; - if(pat == pSndFile->Order.GetIgnoreIndex() || pat == pSndFile->Order.GetInvalidPatIndex()) + if(pat == PATTERNINDEX_SKIP || pat == PATTERNINDEX_INVALID) return false; if(m_pEditWnd && m_pEditWnd->IsWindowVisible()) m_pEditWnd->ShowWindow(SW_HIDE); @@ -1965,7 +1965,7 @@ { auto &order = Order(); const auto start = order.begin() + GetCurrentOrder(); - const auto end = std::find(start, order.end(), order.GetInvalidPatIndex()); + const auto end = std::find(start, order.end(), PATTERNINDEX_INVALID); // As this is a global operation, ensure that all modified patterns are unique bool orderListChanged = false; Modified: trunk/OpenMPT/mptrack/View_tre.cpp ============================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/mptrack/View_tre.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -1006,7 +1006,7 @@ } } else { - if(sndFile.Order(seq)[iOrd] == sndFile.Order.GetIgnoreIndex()) + if(sndFile.Order(seq)[iOrd] == PATTERNINDEX_SKIP) { // +++ Item wsprintf(s, _T("[%02u] Skip"), iOrd); @@ -2657,19 +2657,15 @@ return false; sequenceHint = 0; } - sndFile->Order().resize(std::min(sndFile->GetModSpecifications().ordersMax, origSeq.GetLength()), sndFile->Order.GetInvalidPatIndex()); + sndFile->Order().resize(std::min(sndFile->GetModSpecifications().ordersMax, origSeq.GetLength()), PATTERNINDEX_INVALID); for(ORDERINDEX nOrd = 0; nOrd < std::min(sndFile->GetModSpecifications().ordersMax, origSeq.GetLengthTailTrimmed()); nOrd++) { PATTERNINDEX pat = dragSndFile.Order(origSeqId)[nOrd]; // translate pattern index - if(pat == dragSndFile.Order.GetInvalidPatIndex()) - pat = sndFile->Order.GetInvalidPatIndex(); - else if(pat == dragSndFile.Order.GetIgnoreIndex() && sndFile->GetModSpecifications().hasIgnoreIndex) - pat = sndFile->Order.GetIgnoreIndex(); - else if(pat == dragSndFile.Order.GetIgnoreIndex() && !sndFile->GetModSpecifications().hasIgnoreIndex) - pat = sndFile->Order.GetInvalidPatIndex(); + if(pat == PATTERNINDEX_SKIP && sndFile->GetModSpecifications().hasIgnoreIndex) + pat = PATTERNINDEX_SKIP; else if(pat >= sndFile->GetModSpecifications().patternsMax) - pat = sndFile->Order.GetInvalidPatIndex(); + pat = PATTERNINDEX_INVALID; sndFile->Order()[nOrd] = pat; } @@ -4486,9 +4482,9 @@ case MODITEM_ORDER: { PATTERNINDEX pat = sndFile.Order(static_cast<SEQUENCEINDEX>(modItem.val2)).at(static_cast<ORDERINDEX>(modItem.val1)); - if(pat == sndFile.Order.GetInvalidPatIndex()) + if(pat == PATTERNINDEX_INVALID) text = UL_("---"); - else if(pat == sndFile.Order.GetIgnoreIndex()) + else if(pat == PATTERNINDEX_SKIP) text = UL_("+++"); else text = mpt::ufmt::val(pat); @@ -4593,11 +4589,11 @@ bool valid = true; if(itemText[0] == UC_('-')) { - pat = sndFile.Order.GetInvalidPatIndex(); + pat = PATTERNINDEX_INVALID; } else if(itemText[0] == UC_('+')) { if(modSpecs.hasIgnoreIndex) - pat = sndFile.Order.GetIgnoreIndex(); + pat = PATTERNINDEX_SKIP; else valid = false; } else Modified: trunk/OpenMPT/soundlib/Load_etx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_etx.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/soundlib/Load_etx.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -107,7 +107,7 @@ ReadOrderFromFile<uint8>(Order(), file, 1024, 0xFF); for(ORDERINDEX ord = 0; ord < Order().size(); ord++) { - if(Order()[ord] == Order().GetInvalidPatIndex()) + if(Order()[ord] == PATTERNINDEX_INVALID) Order().resize(ord); else if(Order()[ord] > 127) return false; Modified: trunk/OpenMPT/soundlib/Load_it.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/soundlib/Load_it.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -707,7 +707,7 @@ if(fileHeader.cwtv == 0x0217 && fileHeader.cmwt == 0x0200 && fileHeader.reserved == 0 && !isBeRoTracker) { if(hasModPlugExtensions - || (!Order().empty() && Order().back() == Order.GetInvalidPatIndex()) + || (!Order().empty() && Order().back() == PATTERNINDEX_INVALID) || memchr(fileHeader.chnpan, 0xFF, sizeof(fileHeader.chnpan)) != nullptr) { m_dwLastSavedWithVersion = MPT_V("1.16"); Modified: trunk/OpenMPT/soundlib/Load_med.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_med.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/soundlib/Load_med.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -1400,7 +1400,7 @@ file.ReadStruct(playSeq); if(!order.empty()) - order.push_back(order.GetIgnoreIndex()); + order.push_back(PATTERNINDEX_SKIP); const size_t orderStart = order.size(); size_t readOrders = playSeq.length; @@ -1432,11 +1432,11 @@ break; if(command.command == MMDPlaySeqCommand::kStop) { - order[ord] = order.GetInvalidPatIndex(); + order[ord] = PATTERNINDEX_INVALID; } else if(command.command == MMDPlaySeqCommand::kJump) { jumpTargets[ord] = chunk.ReadUint16BE(); - order[ord] = order.GetIgnoreIndex(); + order[ord] = PATTERNINDEX_SKIP; } } } Modified: trunk/OpenMPT/soundlib/Load_plm.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_plm.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/soundlib/Load_plm.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -385,7 +385,7 @@ PATTERNINDEX blankPat = PATTERNINDEX_INVALID; for(auto &pat : Order()) { - if(pat == Order.GetInvalidPatIndex()) + if(pat == PATTERNINDEX_INVALID) { if(blankPat == PATTERNINDEX_INVALID) { Modified: trunk/OpenMPT/soundlib/Load_psm.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_psm.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/soundlib/Load_psm.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -409,9 +409,9 @@ { PATTERNINDEX pat = ReadPSMPatternIndex(subChunk, sinariaFormat); if(pat == 0xFF) - pat = Order.GetInvalidPatIndex(); + pat = PATTERNINDEX_INVALID; else if(pat == 0xFE) - pat = Order.GetIgnoreIndex(); + pat = PATTERNINDEX_SKIP; Order().push_back(pat); // Decide whether this is the first order chunk or not (for finding out the correct restart position) if(firstOrderChunk == uint16_max) Modified: trunk/OpenMPT/soundlib/Load_stm.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_stm.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/soundlib/Load_stm.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -113,7 +113,7 @@ for(auto &pat : order) { if(pat == 99 || pat == 255) // 99 is regular, sometimes a single 255 entry can be found too - pat = order.GetInvalidPatIndex(); + pat = PATTERNINDEX_INVALID; else if(pat > 63) return false; } Modified: trunk/OpenMPT/soundlib/Load_symmod.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_symmod.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/soundlib/Load_symmod.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -1385,7 +1385,7 @@ // Sequences are all part of the same song, just add a skip index as a divider ModSequence &order = Order(); if(!order.empty()) - order.push_back(ModSequence::GetIgnoreIndex()); + order.push_back(PATTERNINDEX_SKIP); for(auto &pos : seqPositions) { Modified: trunk/OpenMPT/soundlib/Load_xm.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/soundlib/Load_xm.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -1106,7 +1106,7 @@ if(!Patterns.IsValidPat(0xFE)) Order().RemovePattern(0xFE); if(!Patterns.IsValidPat(0xFF)) - Order().Replace(0xFF, Order.GetInvalidPatIndex()); + Order().Replace(0xFF, PATTERNINDEX_INVALID); } m_modFormat.formatName = MPT_UFORMAT("FastTracker 2 v{}.{}")(fileHeader.version >> 8, mpt::ufmt::hex0<2>(fileHeader.version & 0xFF)); @@ -1186,7 +1186,7 @@ for(ORDERINDEX ord = 0; ord < trimmedLength; ord++) { PATTERNINDEX pat = Order()[ord]; - if(pat == Order.GetIgnoreIndex() || pat == Order.GetInvalidPatIndex() || pat > uint8_max) + if(pat == PATTERNINDEX_SKIP || pat == PATTERNINDEX_INVALID || pat > uint8_max) { changeOrderList = true; } else if(numOrders < orderLimit) Modified: trunk/OpenMPT/soundlib/Loaders.h ============================================================================== --- trunk/OpenMPT/soundlib/Loaders.h Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/soundlib/Loaders.h Sat Oct 19 13:46:07 2024 (r21858) @@ -34,8 +34,8 @@ for(int i = 0; i < readEntries; i++) { PATTERNINDEX pat = static_cast<PATTERNINDEX>(orders[i]); - if(pat == stopIndex) pat = order.GetInvalidPatIndex(); - else if(pat == ignoreIndex) pat = order.GetIgnoreIndex(); + if(pat == stopIndex) pat = PATTERNINDEX_INVALID; + else if(pat == ignoreIndex) pat = PATTERNINDEX_SKIP; order.at(i) = pat; } return true; @@ -59,8 +59,8 @@ { file.ReadStruct(patF); pat = static_cast<PATTERNINDEX>(patF); - if(pat == stopIndex) pat = order.GetInvalidPatIndex(); - else if(pat == ignoreIndex) pat = order.GetIgnoreIndex(); + if(pat == stopIndex) pat = PATTERNINDEX_INVALID; + else if(pat == ignoreIndex) pat = PATTERNINDEX_SKIP; } return true; } Modified: trunk/OpenMPT/soundlib/MODTools.cpp ============================================================================== --- trunk/OpenMPT/soundlib/MODTools.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/soundlib/MODTools.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -459,8 +459,8 @@ } else if(numPatternsIllegal >= 0xFF) { // Patterns FE and FF are used with S3M semantics (e.g. some MODs written with old OpenMPT versions) - Order.Replace(0xFE, Order.GetIgnoreIndex()); - Order.Replace(0xFF, Order.GetInvalidPatIndex()); + Order.Replace(0xFE, PATTERNINDEX_SKIP); + Order.Replace(0xFF, PATTERNINDEX_INVALID); } return numPatterns; Modified: trunk/OpenMPT/soundlib/ModSequence.cpp ============================================================================== --- trunk/OpenMPT/soundlib/ModSequence.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/soundlib/ModSequence.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -71,12 +71,12 @@ // If not supported, remove "+++" separator order items. if(!specs.hasIgnoreIndex) { - RemovePattern(GetIgnoreIndex()); + RemovePattern(PATTERNINDEX_SKIP); } // If not supported, remove "---" items between patterns. if(!specs.hasStopIndex) { - RemovePattern(GetInvalidPatIndex()); + RemovePattern(PATTERNINDEX_INVALID); } } @@ -101,14 +101,14 @@ { if(empty()) return 0; - auto last = std::find_if(rbegin(), rend(), [] (PATTERNINDEX pat) { return pat != GetInvalidPatIndex(); }); + auto last = std::find_if(rbegin(), rend(), [] (PATTERNINDEX pat) { return pat != PATTERNINDEX_INVALID; }); return static_cast<ORDERINDEX>(std::distance(begin(), last.base())); } ORDERINDEX ModSequence::GetLengthFirstEmpty() const noexcept { - return static_cast<ORDERINDEX>(std::distance(begin(), std::find(begin(), end(), GetInvalidPatIndex()))); + return static_cast<ORDERINDEX>(std::distance(begin(), std::find(begin(), end(), PATTERNINDEX_INVALID))); } @@ -131,7 +131,7 @@ return 0; auto length = GetLength(); ORDERINDEX next = std::min(ORDERINDEX(length - 1), ORDERINDEX(start + 1)); - while(next + 1 < length && (*this)[next] == GetIgnoreIndex()) + while(next + 1 < length && (*this)[next] == PATTERNINDEX_SKIP) next++; return next; } @@ -143,7 +143,7 @@ if(start == 0 || last == 0) return 0; ORDERINDEX prev = std::min(ORDERINDEX(start - 1), last); - while(prev > 0 && (*this)[prev] == GetIgnoreIndex()) + while(prev > 0 && (*this)[prev] == PATTERNINDEX_SKIP) prev--; return prev; } @@ -427,12 +427,12 @@ for(ORDERINDEX ord = 0; ord < length; ord++) { // End of subsong? - if(!m_Sequences[0].IsValidPat(ord) && m_Sequences[0][ord] != GetIgnoreIndex()) + if(!m_Sequences[0].IsValidPat(ord) && m_Sequences[0][ord] != PATTERNINDEX_SKIP) { // Remove all separator patterns between current and next subsong first while(ord < length && !m_sndFile.Patterns.IsValidPat(m_Sequences[0][ord])) { - m_Sequences[0][ord] = GetInvalidPatIndex(); + m_Sequences[0][ord] = PATTERNINDEX_INVALID; ord++; modified = true; } @@ -448,11 +448,11 @@ modified = true; // Now, move all following orders to the new sequence - while(ord < length && m_Sequences[0][ord] != GetInvalidPatIndex()) + while(ord < length && m_Sequences[0][ord] != PATTERNINDEX_INVALID) { PATTERNINDEX copyPat = m_Sequences[0][ord]; m_Sequences[newSeq].push_back(copyPat); - m_Sequences[0][ord] = GetInvalidPatIndex(); + m_Sequences[0][ord] = PATTERNINDEX_INVALID; ord++; // Is this a valid pattern? adjust pattern jump commands, if necessary. @@ -594,7 +594,7 @@ { const auto endPat = begin() + GetLengthTailTrimmed(); return std::find_if(begin(), endPat, - [&](PATTERNINDEX pat) { return pat != GetIgnoreIndex() && !m_sndFile.Patterns.IsValidPat(pat); }) != endPat; + [&](PATTERNINDEX pat) { return pat != PATTERNINDEX_SKIP && !m_sndFile.Patterns.IsValidPat(pat); }) != endPat; } #endif // MODPLUG_TRACKER @@ -614,8 +614,10 @@ const PATTERNINDEX pat = (*this)[i]; uint8 temp = static_cast<uint8>(pat); - if(pat == GetInvalidPatIndex()) temp = stopIndex; - else if(pat == GetIgnoreIndex() || pat > 0xFF) temp = ignoreIndex; + if(pat == PATTERNINDEX_INVALID) + temp = stopIndex; + else if(pat == PATTERNINDEX_SKIP || pat > 0xFF) + temp = ignoreIndex; mpt::IO::WriteIntLE<uint8>(f, temp); } // Fill non-existing order items with stop indices Modified: trunk/OpenMPT/soundlib/ModSequence.h ============================================================================== --- trunk/OpenMPT/soundlib/ModSequence.h Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/soundlib/ModSequence.h Sat Oct 19 13:46:07 2024 (r21858) @@ -59,14 +59,14 @@ // Inserts 'count' orders starting from 'pos' using 'fill' as the pattern index for all inserted orders. // Sequence will automatically grow if needed and if it can't grow enough, some tail orders will be discarded. // Return: Number of orders inserted (up to 'count' many). - ORDERINDEX insert(ORDERINDEX pos, ORDERINDEX count) { return insert(pos, count, GetInvalidPatIndex(), true); } + ORDERINDEX insert(ORDERINDEX pos, ORDERINDEX count) { return insert(pos, count, PATTERNINDEX_INVALID, true); } ORDERINDEX insert(ORDERINDEX pos, ORDERINDEX count, PATTERNINDEX fill, bool enforceFormatLimits = true); ORDERINDEX insert(ORDERINDEX pos, const mpt::span<const PATTERNINDEX> orders, bool enforceFormatLimits = true); - void push_back() { push_back(GetInvalidPatIndex()); } + void push_back() { push_back(PATTERNINDEX_INVALID); } void push_back(PATTERNINDEX pat) { if(GetLength() < MAX_ORDERS) std::vector<PATTERNINDEX>::push_back(pat); } - void resize(ORDERINDEX newSize) { resize(newSize, GetInvalidPatIndex()); } + void resize(ORDERINDEX newSize) { resize(newSize, PATTERNINDEX_INVALID); } void resize(ORDERINDEX newSize, PATTERNINDEX pat) { std::vector<PATTERNINDEX>::resize(std::min(MAX_ORDERS, newSize), pat); } // Removes orders from range [posBegin, posEnd]. @@ -88,11 +88,6 @@ void AdjustToNewModType(const MODTYPE oldtype); - // Returns the internal representation of a stop '---' index - static constexpr PATTERNINDEX GetInvalidPatIndex() noexcept { return uint16_max; } - // Returns the internal representation of an ignore '+++' index - static constexpr PATTERNINDEX GetIgnoreIndex() noexcept { return uint16_max - 1; } - // Returns the previous/next order ignoring skip indices (+++). // If no previous/next order exists, return first/last order, and zero // when orderlist is empty. @@ -175,11 +170,6 @@ // Removes given sequence. void RemoveSequence(SEQUENCEINDEX); - // Returns the internal representation of a stop '---' index - static constexpr PATTERNINDEX GetInvalidPatIndex() noexcept { return ModSequence::GetInvalidPatIndex(); } - // Returns the internal representation of an ignore '+++' index - static constexpr PATTERNINDEX GetIgnoreIndex() noexcept { return ModSequence::GetIgnoreIndex(); } - #ifdef MODPLUG_TRACKER // Assigns a new set of sequences. The vector contents indicate which existing sequences to keep / duplicate or if a new sequences should be inserted (SEQUENCEINDEX_INVALID) // The function fails if the vector is empty or contains too many sequences. Modified: trunk/OpenMPT/soundlib/Snd_defs.h ============================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/soundlib/Snd_defs.h Sat Oct 19 13:46:07 2024 (r21858) @@ -27,7 +27,8 @@ inline constexpr ORDERINDEX ORDERINDEX_INVALID = uint16_max; inline constexpr ORDERINDEX ORDERINDEX_MAX = uint16_max - 1; using PATTERNINDEX = uint16; -inline constexpr PATTERNINDEX PATTERNINDEX_INVALID = uint16_max; +inline constexpr PATTERNINDEX PATTERNINDEX_INVALID = uint16_max; // "---" in order list +inline constexpr PATTERNINDEX PATTERNINDEX_SKIP = uint16_max - 1; // "+++" in order list using PLUGINDEX = uint8; inline constexpr PLUGINDEX PLUGINDEX_INVALID = uint8_max; using SAMPLEINDEX = uint16; Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -413,10 +413,10 @@ } // Check if pattern is valid - playState.m_nPattern = playState.m_nCurrentOrder < orderList.size() ? orderList[playState.m_nCurrentOrder] : orderList.GetInvalidPatIndex(); + playState.m_nPattern = playState.m_nCurrentOrder < orderList.size() ? orderList[playState.m_nCurrentOrder] : PATTERNINDEX_INVALID; playState.m_nTickCount = 0; - if(!Patterns.IsValidPat(playState.m_nPattern) && playState.m_nPattern != orderList.GetInvalidPatIndex() && target.mode == GetLengthTarget::SeekPosition && playState.m_nCurrentOrder == target.pos.order) + if(!Patterns.IsValidPat(playState.m_nPattern) && playState.m_nPattern != PATTERNINDEX_INVALID && target.mode == GetLengthTarget::SeekPosition && playState.m_nCurrentOrder == target.pos.order) { // Early test: Target is inside +++ or non-existing pattern retval.targetReached = true; @@ -426,7 +426,7 @@ while(playState.m_nPattern >= Patterns.Size()) { // End of song? - if((playState.m_nPattern == orderList.GetInvalidPatIndex()) || (playState.m_nCurrentOrder >= orderList.size())) + if((playState.m_nPattern == PATTERNINDEX_INVALID) || (playState.m_nCurrentOrder >= orderList.size())) { if(playState.m_nCurrentOrder == orderList.GetRestartPos()) break; @@ -436,7 +436,7 @@ { playState.m_nCurrentOrder++; } - playState.m_nPattern = (playState.m_nCurrentOrder < orderList.size()) ? orderList[playState.m_nCurrentOrder] : orderList.GetInvalidPatIndex(); + playState.m_nPattern = (playState.m_nCurrentOrder < orderList.size()) ? orderList[playState.m_nCurrentOrder] : PATTERNINDEX_INVALID; playState.m_nNextOrder = playState.m_nCurrentOrder; if((!Patterns.IsValidPat(playState.m_nPattern)) && visitedRows.Visit(playState.m_nCurrentOrder, 0, playState.Chn, ignoreRow)) { Modified: trunk/OpenMPT/soundlib/Sndmix.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/soundlib/Sndmix.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -459,12 +459,12 @@ // Check if pattern is valid if(!m_PlayState.m_flags[SONG_PATTERNLOOP]) { - m_PlayState.m_nPattern = (m_PlayState.m_nCurrentOrder < Order().size()) ? Order()[m_PlayState.m_nCurrentOrder] : Order.GetInvalidPatIndex(); - if (m_PlayState.m_nPattern < Patterns.Size() && !Patterns[m_PlayState.m_nPattern].IsValid()) m_PlayState.m_nPattern = Order.GetIgnoreIndex(); + m_PlayState.m_nPattern = (m_PlayState.m_nCurrentOrder < Order().size()) ? Order()[m_PlayState.m_nCurrentOrder] : PATTERNINDEX_INVALID; + if (m_PlayState.m_nPattern < Patterns.Size() && !Patterns[m_PlayState.m_nPattern].IsValid()) m_PlayState.m_nPattern = PATTERNINDEX_SKIP; while (m_PlayState.m_nPattern >= Patterns.Size()) { // End of song? - if ((m_PlayState.m_nPattern == Order.GetInvalidPatIndex()) || (m_PlayState.m_nCurrentOrder >= Order().size())) + if ((m_PlayState.m_nPattern == PATTERNINDEX_INVALID) || (m_PlayState.m_nCurrentOrder >= Order().size())) { ORDERINDEX restartPosOverride = Order().GetRestartPos(); if(restartPosOverride == 0 && m_PlayState.m_nCurrentOrder <= Order().size() && m_PlayState.m_nCurrentOrder > 0) @@ -474,7 +474,7 @@ // (i.e. the first order after the previous "---" item) for(ORDERINDEX ord = m_PlayState.m_nCurrentOrder - 1; ord > 0; ord--) { - if(Order()[ord] == Order.GetInvalidPatIndex()) + if(Order()[ord] == PATTERNINDEX_INVALID) { // Jump back to first order of this subtune restartPosOverride = ord + 1; @@ -536,7 +536,7 @@ m_PlayState.m_nCurrentOrder = restartPosOverride; m_PlayState.m_flags.reset(SONG_BREAKTOROW); //If restart pos points to +++, move along - while(m_PlayState.m_nCurrentOrder < Order().size() && Order()[m_PlayState.m_nCurrentOrder] == Order.GetIgnoreIndex()) + while(m_PlayState.m_nCurrentOrder < Order().size() && Order()[m_PlayState.m_nCurrentOrder] == PATTERNINDEX_SKIP) { m_PlayState.m_nCurrentOrder++; } @@ -555,10 +555,10 @@ if (m_PlayState.m_nCurrentOrder < Order().size()) m_PlayState.m_nPattern = Order()[m_PlayState.m_nCurrentOrder]; else - m_PlayState.m_nPattern = Order.GetInvalidPatIndex(); + m_PlayState.m_nPattern = PATTERNINDEX_INVALID; if (m_PlayState.m_nPattern < Patterns.Size() && !Patterns[m_PlayState.m_nPattern].IsValid()) - m_PlayState.m_nPattern = Order.GetIgnoreIndex(); + m_PlayState.m_nPattern = PATTERNINDEX_SKIP; } m_PlayState.m_nNextOrder = m_PlayState.m_nCurrentOrder; Modified: trunk/OpenMPT/test/test.cpp ============================================================================== --- trunk/OpenMPT/test/test.cpp Fri Oct 18 23:55:25 2024 (r21857) +++ trunk/OpenMPT/test/test.cpp Sat Oct 19 13:46:07 2024 (r21858) @@ -3160,9 +3160,9 @@ VERIFY_EQUAL_NONCONT(sndFile.Order(0).GetLengthTailTrimmed(), 3); VERIFY_EQUAL_NONCONT(sndFile.Order(0).GetName(), U_("First Sequence")); - VERIFY_EQUAL_NONCONT(sndFile.Order(0)[0], sndFile.Order.GetIgnoreIndex()); + VERIFY_EQUAL_NONCONT(sndFile.Order(0)[0], PATTERNINDEX_SKIP); VERIFY_EQUAL_NONCONT(sndFile.Order(0)[1], 0); - VERIFY_EQUAL_NONCONT(sndFile.Order(0)[2], sndFile.Order.GetIgnoreIndex()); + VERIFY_EQUAL_NONCONT(sndFile.Order(0)[2], PATTERNINDEX_SKIP); VERIFY_EQUAL_NONCONT(sndFile.Order(0).GetRestartPos(), 1); VERIFY_EQUAL_NONCONT(sndFile.Order(0).GetDefaultTempo(), TEMPO(139, 999)); VERIFY_EQUAL_NONCONT(sndFile.Order(0).GetDefaultSpeed(), 5); @@ -3370,8 +3370,8 @@ VERIFY_EQUAL_NONCONT(sndFile.Order().GetRestartPos(), 0); VERIFY_EQUAL_NONCONT(sndFile.Order().GetLengthTailTrimmed(), 5); VERIFY_EQUAL_NONCONT(sndFile.Order()[0], 0); - VERIFY_EQUAL_NONCONT(sndFile.Order()[1], sndFile.Order.GetIgnoreIndex()); - VERIFY_EQUAL_NONCONT(sndFile.Order()[2], sndFile.Order.GetInvalidPatIndex()); + VERIFY_EQUAL_NONCONT(sndFile.Order()[1], PATTERNINDEX_SKIP); + VERIFY_EQUAL_NONCONT(sndFile.Order()[2], PATTERNINDEX_INVALID); VERIFY_EQUAL_NONCONT(sndFile.Order()[3], 1); VERIFY_EQUAL_NONCONT(sndFile.Order()[4], 0); |
From: <sv...@op...> - 2024-10-18 21:55:37
|
Author: sagamusix Date: Fri Oct 18 23:55:25 2024 New Revision: 21857 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21857 Log: Merged revision(s) 21856 from trunk/OpenMPT: [Mod] Pattern tab: Rename "Render to Wave" context menu item to "Stream Export". [Imp] Pattern tab: There is now a short for stream export (https://bugs.openmpt.org/view.php?id=1831) ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/mptrack/CommandSet.cpp branches/OpenMPT-1.31/mptrack/CommandSet.h branches/OpenMPT-1.31/mptrack/Ctrl_seq.cpp Modified: branches/OpenMPT-1.31/mptrack/CommandSet.cpp ============================================================================== --- branches/OpenMPT-1.31/mptrack/CommandSet.cpp Fri Oct 18 23:54:00 2024 (r21856) +++ branches/OpenMPT-1.31/mptrack/CommandSet.cpp Fri Oct 18 23:55:25 2024 (r21857) @@ -1374,6 +1374,7 @@ {2098, kcGotoVolumeColumn, _T("Go to volume effect column")}, {2099, kcGotoCommandColumn, _T("Go to effect command column")}, {2100, kcGotoParamColumn, _T("Go to effect parameter column")}, + {2102, kcOrderlistStreamExport, _T("Stream Export")}, }; // Get command descriptions etc.. loaded up. Modified: branches/OpenMPT-1.31/mptrack/CommandSet.h ============================================================================== --- branches/OpenMPT-1.31/mptrack/CommandSet.h Fri Oct 18 23:54:00 2024 (r21856) +++ branches/OpenMPT-1.31/mptrack/CommandSet.h Fri Oct 18 23:55:25 2024 (r21857) @@ -1031,7 +1031,8 @@ kcOrderlistLockPlayback = kcStartOrderlistLock, kcOrderlistUnlockPlayback, kcEndOrderlistLock = kcOrderlistUnlockPlayback, - kcEndOrderlistCommands = kcEndOrderlistLock, + kcOrderlistStreamExport, + kcEndOrderlistCommands = kcOrderlistStreamExport, kcStartChnSettingsCommands, kcChnSettingsPrev = kcStartChnSettingsCommands, Modified: branches/OpenMPT-1.31/mptrack/Ctrl_seq.cpp ============================================================================== --- branches/OpenMPT-1.31/mptrack/Ctrl_seq.cpp Fri Oct 18 23:54:00 2024 (r21856) +++ branches/OpenMPT-1.31/mptrack/Ctrl_seq.cpp Fri Oct 18 23:55:25 2024 (r21857) @@ -560,6 +560,9 @@ OnMergePatterns(); return wParam; case kcNewPattern: OnCreateNewPattern(); return wParam; + + case kcOrderlistStreamExport: + OnRenderOrder(); return wParam; } return kcNull; @@ -1150,7 +1153,7 @@ AppendMenu(hMenu, (sndFile.m_lockOrderStart == ORDERINDEX_INVALID ? (MF_STRING | MF_GRAYED) : MF_STRING), ID_ORDERLIST_UNLOCKPLAYBACK, ih->GetKeyTextFromCommand(kcOrderlistUnlockPlayback, _T("&Unlock Playback"))); AppendMenu(hMenu, MF_SEPARATOR, NULL, _T("")); - AppendMenu(hMenu, MF_STRING | greyed, ID_ORDERLIST_RENDER, _T("Render to &Wave")); + AppendMenu(hMenu, MF_STRING | greyed, ID_ORDERLIST_RENDER, ih->GetKeyTextFromCommand(kcOrderlistStreamExport, _T("Stream E&xport"))); ClientToScreen(&pt); ::TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, m_hWnd, NULL); |
From: <sv...@op...> - 2024-10-18 21:54:07
|
Author: sagamusix Date: Fri Oct 18 23:54:00 2024 New Revision: 21856 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21856 Log: [Mod] Pattern tab: Rename "Render to Wave" context menu item to "Stream Export". [Imp] Pattern tab: There is now a short for stream export (https://bugs.openmpt.org/view.php?id=1831) Modified: trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/CommandSet.h trunk/OpenMPT/mptrack/Ctrl_seq.cpp Modified: trunk/OpenMPT/mptrack/CommandSet.cpp ============================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp Fri Oct 18 22:11:30 2024 (r21855) +++ trunk/OpenMPT/mptrack/CommandSet.cpp Fri Oct 18 23:54:00 2024 (r21856) @@ -1394,6 +1394,7 @@ {2099, kcGotoCommandColumn, _T("Go to effect command column")}, {2100, kcGotoParamColumn, _T("Go to effect parameter column")}, {2101, kcContextMenu, _T("Open Context Menu")}, + {2102, kcOrderlistStreamExport, _T("Stream Export")}, }; // clang-format on Modified: trunk/OpenMPT/mptrack/CommandSet.h ============================================================================== --- trunk/OpenMPT/mptrack/CommandSet.h Fri Oct 18 22:11:30 2024 (r21855) +++ trunk/OpenMPT/mptrack/CommandSet.h Fri Oct 18 23:54:00 2024 (r21856) @@ -1046,7 +1046,8 @@ kcOrderlistQueueAtBeatEnd, kcOrderlistQueueAtRowEnd, kcEndOrderlistQueue = kcOrderlistQueueAtRowEnd, - kcEndOrderlistCommands = kcEndOrderlistQueue, + kcOrderlistStreamExport, + kcEndOrderlistCommands = kcOrderlistStreamExport, kcStartChnSettingsCommands, kcChnSettingsPrev = kcStartChnSettingsCommands, Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp Fri Oct 18 22:11:30 2024 (r21855) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp Fri Oct 18 23:54:00 2024 (r21856) @@ -579,6 +579,9 @@ OnMergePatterns(); return wParam; case kcNewPattern: OnCreateNewPattern(); return wParam; + + case kcOrderlistStreamExport: + OnRenderOrder(); return wParam; } return kcNull; @@ -1177,7 +1180,7 @@ } AppendMenu(hMenu, MF_SEPARATOR, NULL, _T("")); - AppendMenu(hMenu, MF_STRING | greyed, ID_ORDERLIST_RENDER, _T("Render to &Wave")); + AppendMenu(hMenu, MF_STRING | greyed, ID_ORDERLIST_RENDER, ih->GetKeyTextFromCommand(kcOrderlistStreamExport, _T("Stream E&xport"))); ClientToScreen(&pt); ::TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, m_hWnd, NULL); |
From: <sv...@op...> - 2024-10-18 20:11:42
|
Author: sagamusix Date: Fri Oct 18 22:11:30 2024 New Revision: 21855 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21855 Log: [Mod] Increase number of maximum pattern channels from 127 to 192. Now that the only fixed-size structure based on MAX_BASECHANNELS ins a bitset in CSoundFile, the memory overhead does not matter anymore. The only formats that could make use of the extra channels should also not support NNAs, so the low number of remaining NNA channels should not matter. Modified: trunk/OpenMPT/soundlib/Snd_defs.h Modified: trunk/OpenMPT/soundlib/Snd_defs.h ============================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h Fri Oct 18 21:37:05 2024 (r21854) +++ trunk/OpenMPT/soundlib/Snd_defs.h Fri Oct 18 22:11:30 2024 (r21855) @@ -52,7 +52,7 @@ inline constexpr SEQUENCEINDEX MAX_SEQUENCES = 50; -inline constexpr CHANNELINDEX MAX_BASECHANNELS = 127; // Maximum pattern channels. +inline constexpr CHANNELINDEX MAX_BASECHANNELS = 192; // Maximum pattern channels. inline constexpr CHANNELINDEX MAX_CHANNELS = 256; // Maximum number of mixing channels. enum { FREQ_FRACBITS = 4 }; // Number of fractional bits in return value of CSoundFile::GetFreqFromPeriod() |
From: <sv...@op...> - 2024-10-18 19:37:18
|
Author: sagamusix Date: Fri Oct 18 21:37:05 2024 New Revision: 21854 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21854 Log: [Imp] SymMOD: When running out of Zxx macros, try to find the closest macro to use instead. Fixes files like ocean view.symmod with tons of filter sweeps. Modified: trunk/OpenMPT/soundlib/Load_symmod.cpp Modified: trunk/OpenMPT/soundlib/Load_symmod.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_symmod.cpp Fri Oct 18 10:53:08 2024 (r21853) +++ trunk/OpenMPT/soundlib/Load_symmod.cpp Fri Oct 18 21:37:05 2024 (r21854) @@ -985,6 +985,30 @@ } +static uint8 MapToClosestMidiMacro(const SymEvent event, std::map<SymEvent, uint8> ¯oMap) +{ + if(event.command == SymEvent::DSPDelay) + return 0; + uint8 bestMatch = 0; + uint32 bestDistance = uint32_max; + for(const auto &m : macroMap) + { + const auto &mapEvent = m.first; + if(event.command != mapEvent.command || event.note != mapEvent.note) + continue; + const uint32 diff1 = static_cast<uint32>(event.param) - mapEvent.param, diff2 = static_cast<uint32>(event.inst) - mapEvent.inst; + const uint32 distance = diff1 * diff1 + diff2 * diff2; + if(distance >= bestDistance) + continue; + + bestMatch = m.second; + bestDistance = distance; + } + macroMap[event] = bestMatch; + return bestMatch; +} + + CSoundFile::ProbeResult CSoundFile::ProbeFileHeaderSymMOD(MemoryFileReader file, const uint64 *pfilesize) { MPT_UNREFERENCED_PARAMETER(pfilesize); @@ -1640,9 +1664,9 @@ case SymEvent::DSPEcho: case SymEvent::DSPDelay: #endif - if(macroMap.count(event)) + if(auto it = macroMap.find(event); it != macroMap.end() && it->second != 0) { - m.SetEffectCommand(CMD_MIDI, macroMap[event]); + m.SetEffectCommand(CMD_MIDI, it->second); } else if(macroMap.size() < m_MidiCfg.Zxx.size()) { uint8 param = static_cast<uint8>(macroMap.size()); @@ -1653,6 +1677,9 @@ if(event.command == SymEvent::DSPEcho || event.command == SymEvent::DSPDelay) useDSP = true; } + } else if(uint8 param = MapToClosestMidiMacro(event, macroMap)) + { + m.SetEffectCommand(CMD_MIDI, param); } break; |
From: <sv...@op...> - 2024-10-18 08:53:20
|
Author: manx Date: Fri Oct 18 10:53:08 2024 New Revision: 21853 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21853 Log: Merged revision(s) 21852 from trunk/OpenMPT: [Var] build: Autotools: Update ax_cxx_compile_stdcxx.m4 to version 25. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/build/autotools/ax_cxx_compile_stdcxx.m4 Modified: branches/OpenMPT-1.31/build/autotools/ax_cxx_compile_stdcxx.m4 ============================================================================== --- branches/OpenMPT-1.31/build/autotools/ax_cxx_compile_stdcxx.m4 Fri Oct 18 10:52:34 2024 (r21852) +++ branches/OpenMPT-1.31/build/autotools/ax_cxx_compile_stdcxx.m4 Fri Oct 18 10:53:08 2024 (r21853) @@ -44,7 +44,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 24 +#serial 25 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). @@ -191,11 +191,11 @@ dnl Test body for checking C++23 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_23], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_23 + [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_23] ) |
From: <sv...@op...> - 2024-10-18 08:52:47
|
Author: manx Date: Fri Oct 18 10:52:34 2024 New Revision: 21852 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21852 Log: [Var] build: Autotools: Update ax_cxx_compile_stdcxx.m4 to version 25. Modified: trunk/OpenMPT/build/autotools/ax_cxx_compile_stdcxx.m4 Modified: trunk/OpenMPT/build/autotools/ax_cxx_compile_stdcxx.m4 ============================================================================== --- trunk/OpenMPT/build/autotools/ax_cxx_compile_stdcxx.m4 Thu Oct 17 15:14:44 2024 (r21851) +++ trunk/OpenMPT/build/autotools/ax_cxx_compile_stdcxx.m4 Fri Oct 18 10:52:34 2024 (r21852) @@ -44,7 +44,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 24 +#serial 25 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). @@ -191,11 +191,11 @@ dnl Test body for checking C++23 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_23], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_23 + [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_23] ) |
From: <sv...@op...> - 2024-10-17 13:14:57
|
Author: sagamusix Date: Thu Oct 17 15:14:44 2024 New Revision: 21851 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21851 Log: [Ref] Silence warnings. Modified: trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp Modified: trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp ============================================================================== --- trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp Wed Oct 16 22:55:52 2024 (r21850) +++ trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp Thu Oct 17 15:14:44 2024 (r21851) @@ -313,6 +313,9 @@ ResetState(false, false, false, true); } break; + case kNumTabs: + MPT_ASSERT_NOTREACHED(); + break; } ResetState(); @@ -657,6 +660,9 @@ case kReorderRemove: color = state.removed ? redBrush : greenBrush; break; + case kNumTabs: + MPT_ASSERT_NOTREACHED(); + break; } ::SetDCBrushColor(dc, color); ::FillRect(dc, rect, dcBrush); @@ -942,6 +948,9 @@ m_moveRect = true; } break; + case kNumTabs: + MPT_ASSERT_NOTREACHED(); + break; } } |
From: <sv...@op...> - 2024-10-16 20:56:06
|
Author: sagamusix Date: Wed Oct 16 22:55:52 2024 New Revision: 21850 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21850 Log: [Fix] SymMOD: Avoid pattern data mis-alignment when importing less channels than the file contains. Modified: trunk/OpenMPT/soundlib/Load_symmod.cpp Modified: trunk/OpenMPT/soundlib/Load_symmod.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_symmod.cpp Wed Oct 16 22:36:56 2024 (r21849) +++ trunk/OpenMPT/soundlib/Load_symmod.cpp Wed Oct 16 22:55:52 2024 (r21850) @@ -1395,12 +1395,14 @@ { ModCommand *rowBase = Patterns[patternIndex].GetpModCommand(row, 0); bool applySyncPlay = false; - for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++) + for(CHANNELINDEX chn = 0; chn < fileHeader.numChannels; chn++) { - ModCommand &m = rowBase[chn]; const SymEvent &event = (srcEvent != patternData.cend()) ? *srcEvent : emptyEvent; if(srcEvent != patternData.cend()) srcEvent++; + if(chn >= GetNumChannels()) + continue; + ModCommand &m = rowBase[chn]; int8 note = (event.note >= 0 && event.note <= 84) ? event.note + 25 : -1; uint8 origInst = event.inst; |
From: <sv...@op...> - 2024-10-16 20:37:08
|
Author: manx Date: Wed Oct 16 22:36:56 2024 New Revision: 21849 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21849 Log: Merged revision(s) 21847 from branches/OpenMPT-1.30: [Reg] build: CI: GitHub: macOS: Remove macOS 12 because it is being phased out on GitHub. See r21845. ........ Deleted: branches/OpenMPT-1.28/.github/workflows/macOS-12-Makefile.yml Modified: branches/OpenMPT-1.28/ (props changed) |
From: <sv...@op...> - 2024-10-16 20:36:49
|
Author: manx Date: Wed Oct 16 22:36:36 2024 New Revision: 21848 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21848 Log: Merged revision(s) 21847 from branches/OpenMPT-1.30: [Reg] build: CI: GitHub: macOS: Remove macOS 12 because it is being phased out on GitHub. See r21845. ........ Deleted: branches/OpenMPT-1.29/.github/workflows/macOS-12-Makefile.yml Modified: branches/OpenMPT-1.29/ (props changed) |
From: <sv...@op...> - 2024-10-16 20:36:22
|
Author: manx Date: Wed Oct 16 22:36:09 2024 New Revision: 21847 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21847 Log: [Reg] build: CI: GitHub: macOS: Remove macOS 12 because it is being phased out on GitHub. See r21845. Deleted: branches/OpenMPT-1.30/.github/workflows/macOS-12-Makefile.yml |
From: <sv...@op...> - 2024-10-16 20:35:17
|
Author: manx Date: Wed Oct 16 22:35:10 2024 New Revision: 21846 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21846 Log: Merged revision(s) 21845 from trunk/OpenMPT: [Reg] build: CI: GitHub: macOS: Remove macOS 12 because it is being phased out on GitHub. [Reg] build: CI: GitHub: macOS: Remove XCode 13.2 because it is only supported on macOS 12. [New] build: CI: GitHub: macOS: Add XCode 14.1 on macOS 13. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/.github/workflows/macOS-Autotools.yml branches/OpenMPT-1.31/.github/workflows/macOS-Makefile.yml Modified: branches/OpenMPT-1.31/.github/workflows/macOS-Autotools.yml ============================================================================== --- branches/OpenMPT-1.31/.github/workflows/macOS-Autotools.yml Wed Oct 16 22:34:49 2024 (r21845) +++ branches/OpenMPT-1.31/.github/workflows/macOS-Autotools.yml Wed Oct 16 22:35:10 2024 (r21846) @@ -15,8 +15,8 @@ - { host: macos-14, compiler: '15.4' } - { host: macos-14, compiler: '15.3' } - { host: macos-13, compiler: '15.2' } - - { host: macos-12, compiler: '14.2' } - - { host: macos-12, compiler: '13.2' } + - { host: macos-13, compiler: '14.2' } + - { host: macos-13, compiler: '14.1' } concurrency: group: ${{github.ref}}-${{github.workflow}}-${{matrix.host}}-${{matrix.compiler}}-autotools cancel-in-progress: true @@ -25,24 +25,9 @@ - uses: actions/checkout@v4 - name: update Homebrew run: brew update - - name: fixup GitHub Homebrew swiftlint breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew pin swiftlint - - name: fixup GitHub Homebrew xcbeautify breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew pin xcbeautify - - name: fixup GitHub Homebrew go breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew unlink go@1.21 && brew unlink go && brew link --overwrite go - - name: fixup GitHub Homebrew node breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew unlink node@18 && brew unlink node && brew link --overwrite node - name: fixup GitHub Homebrew python breakage - if: ${{ matrix.host == 'macos-12' || matrix.host == 'macos-13' }} + if: ${{ matrix.host == 'macos-13' }} run: brew unlink python@3.11 && brew unlink python@3.12 && brew link --overwrite python@3.11 && brew link --overwrite python@3.12 - - name: upgrade packages - if: ${{ matrix.host != 'macos-12' }} - run: brew upgrade - name: install dependencies run: brew install p7zip help2man doxygen autoconf autoconf-archive automake libtool mpg123 libogg libvorbis portaudio flac libsndfile sdl2 - name: selecting Xcode version Modified: branches/OpenMPT-1.31/.github/workflows/macOS-Makefile.yml ============================================================================== --- branches/OpenMPT-1.31/.github/workflows/macOS-Makefile.yml Wed Oct 16 22:34:49 2024 (r21845) +++ branches/OpenMPT-1.31/.github/workflows/macOS-Makefile.yml Wed Oct 16 22:35:10 2024 (r21846) @@ -67,10 +67,10 @@ - { host: macos-14, compiler: '15.4', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } - { host: macos-14, compiler: '15.3', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } - { host: macos-13, compiler: '15.2', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } - - { host: macos-12, compiler: '14.2', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } - - { host: macos-12, compiler: '14.2', arch: x86_64, target: '10.13', deps: small, check: true , ancient: false } - - { host: macos-12, compiler: '13.2', arch: x86_64, target: '10.13', deps: local, check: true , ancient: true } - - { host: macos-12, compiler: '13.2', arch: x86_64, target: '10.13', deps: small, check: true , ancient: true } + - { host: macos-13, compiler: '14.2', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } + - { host: macos-13, compiler: '14.2', arch: x86_64, target: '10.13', deps: small, check: true , ancient: false } + - { host: macos-13, compiler: '14.1', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } + - { host: macos-13, compiler: '14.1', arch: x86_64, target: '10.13', deps: small, check: true , ancient: false } concurrency: group: ${{github.ref}}-${{github.workflow}}-${{matrix.host}}-${{matrix.compiler}}-${{matrix.arch}}-${{matrix.target}}-${{matrix.deps}} cancel-in-progress: true @@ -79,24 +79,9 @@ - uses: actions/checkout@v4 - name: update Homebrew run: brew update - - name: fixup GitHub Homebrew swiftlint breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew pin swiftlint - - name: fixup GitHub Homebrew xcbeautify breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew pin xcbeautify - - name: fixup GitHub Homebrew go breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew unlink go@1.21 && brew unlink go && brew link --overwrite go - - name: fixup GitHub Homebrew node breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew unlink node@18 && brew unlink node && brew link --overwrite node - name: fixup GitHub Homebrew python breakage - if: ${{ matrix.host == 'macos-12' || matrix.host == 'macos-13' }} + if: ${{ matrix.host == 'macos-13' }} run: brew unlink python@3.11 && brew unlink python@3.12 && brew link --overwrite python@3.11 && brew link --overwrite python@3.12 - - name: upgrade packages - if: ${{ matrix.host != 'macos-12' }} - run: brew upgrade - name: install dependencies run: brew install p7zip help2man doxygen autoconf autoconf-archive automake libtool mpg123 libogg libvorbis portaudio flac libsndfile sdl2 - name: selecting Xcode version |
From: <sv...@op...> - 2024-10-16 20:35:01
|
Author: manx Date: Wed Oct 16 22:34:49 2024 New Revision: 21845 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21845 Log: [Reg] build: CI: GitHub: macOS: Remove macOS 12 because it is being phased out on GitHub. [Reg] build: CI: GitHub: macOS: Remove XCode 13.2 because it is only supported on macOS 12. [New] build: CI: GitHub: macOS: Add XCode 14.1 on macOS 13. Modified: trunk/OpenMPT/.github/workflows/macOS-Autotools.yml trunk/OpenMPT/.github/workflows/macOS-Makefile.yml Modified: trunk/OpenMPT/.github/workflows/macOS-Autotools.yml ============================================================================== --- trunk/OpenMPT/.github/workflows/macOS-Autotools.yml Wed Oct 16 22:10:53 2024 (r21844) +++ trunk/OpenMPT/.github/workflows/macOS-Autotools.yml Wed Oct 16 22:34:49 2024 (r21845) @@ -17,8 +17,8 @@ - { host: macos-14, compiler: '15.4' } - { host: macos-14, compiler: '15.3' } - { host: macos-13, compiler: '15.2' } - - { host: macos-12, compiler: '14.2' } - - { host: macos-12, compiler: '13.2' } + - { host: macos-13, compiler: '14.2' } + - { host: macos-13, compiler: '14.1' } concurrency: group: ${{github.ref}}-${{github.workflow}}-${{matrix.host}}-${{matrix.compiler}}-autotools cancel-in-progress: true @@ -27,24 +27,9 @@ - uses: actions/checkout@v4 - name: update Homebrew run: brew update - - name: fixup GitHub Homebrew swiftlint breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew pin swiftlint - - name: fixup GitHub Homebrew xcbeautify breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew pin xcbeautify - - name: fixup GitHub Homebrew go breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew unlink go@1.21 && brew unlink go && brew link --overwrite go - - name: fixup GitHub Homebrew node breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew unlink node@18 && brew unlink node && brew link --overwrite node - name: fixup GitHub Homebrew python breakage - if: ${{ matrix.host == 'macos-12' || matrix.host == 'macos-13' }} + if: ${{ matrix.host == 'macos-13' }} run: brew unlink python@3.11 && brew unlink python@3.12 && brew link --overwrite python@3.11 && brew link --overwrite python@3.12 - - name: upgrade packages - if: ${{ matrix.host != 'macos-12' }} - run: brew upgrade - name: install dependencies run: brew install p7zip help2man doxygen autoconf autoconf-archive automake libtool mpg123 libogg libvorbis portaudio flac libsndfile sdl2 - name: selecting Xcode version Modified: trunk/OpenMPT/.github/workflows/macOS-Makefile.yml ============================================================================== --- trunk/OpenMPT/.github/workflows/macOS-Makefile.yml Wed Oct 16 22:10:53 2024 (r21844) +++ trunk/OpenMPT/.github/workflows/macOS-Makefile.yml Wed Oct 16 22:34:49 2024 (r21845) @@ -69,10 +69,10 @@ - { host: macos-14, compiler: '15.4', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } - { host: macos-14, compiler: '15.3', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } - { host: macos-13, compiler: '15.2', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } - - { host: macos-12, compiler: '14.2', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } - - { host: macos-12, compiler: '14.2', arch: x86_64, target: '10.13', deps: small, check: true , ancient: false } - - { host: macos-12, compiler: '13.2', arch: x86_64, target: '10.13', deps: local, check: true , ancient: true } - - { host: macos-12, compiler: '13.2', arch: x86_64, target: '10.13', deps: small, check: true , ancient: true } + - { host: macos-13, compiler: '14.2', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } + - { host: macos-13, compiler: '14.2', arch: x86_64, target: '10.13', deps: small, check: true , ancient: false } + - { host: macos-13, compiler: '14.1', arch: x86_64, target: '10.13', deps: local, check: true , ancient: false } + - { host: macos-13, compiler: '14.1', arch: x86_64, target: '10.13', deps: small, check: true , ancient: false } concurrency: group: ${{github.ref}}-${{github.workflow}}-${{matrix.host}}-${{matrix.compiler}}-${{matrix.arch}}-${{matrix.target}}-${{matrix.deps}} cancel-in-progress: true @@ -81,24 +81,9 @@ - uses: actions/checkout@v4 - name: update Homebrew run: brew update - - name: fixup GitHub Homebrew swiftlint breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew pin swiftlint - - name: fixup GitHub Homebrew xcbeautify breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew pin xcbeautify - - name: fixup GitHub Homebrew go breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew unlink go@1.21 && brew unlink go && brew link --overwrite go - - name: fixup GitHub Homebrew node breakage - if: ${{ matrix.host == 'macos-12' }} - run: brew unlink node@18 && brew unlink node && brew link --overwrite node - name: fixup GitHub Homebrew python breakage - if: ${{ matrix.host == 'macos-12' || matrix.host == 'macos-13' }} + if: ${{ matrix.host == 'macos-13' }} run: brew unlink python@3.11 && brew unlink python@3.12 && brew link --overwrite python@3.11 && brew link --overwrite python@3.12 - - name: upgrade packages - if: ${{ matrix.host != 'macos-12' }} - run: brew upgrade - name: install dependencies run: brew install p7zip help2man doxygen autoconf autoconf-archive automake libtool mpg123 libogg libvorbis portaudio flac libsndfile sdl2 - name: selecting Xcode version |
From: <sv...@op...> - 2024-10-16 20:11:05
|
Author: manx Date: Wed Oct 16 22:10:53 2024 New Revision: 21844 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21844 Log: Merged revision(s) 21835 from trunk/OpenMPT: [Var] build: Autotools: Update ax_cxx_compile_stdcxx.m4 to version 24. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/build/autotools/ax_cxx_compile_stdcxx.m4 Modified: branches/OpenMPT-1.31/build/autotools/ax_cxx_compile_stdcxx.m4 ============================================================================== --- branches/OpenMPT-1.31/build/autotools/ax_cxx_compile_stdcxx.m4 Wed Oct 16 22:09:13 2024 (r21843) +++ branches/OpenMPT-1.31/build/autotools/ax_cxx_compile_stdcxx.m4 Wed Oct 16 22:10:53 2024 (r21844) @@ -10,8 +10,8 @@ # # Check for baseline language coverage in the compiler for the specified # version of the C++ standard. If necessary, add switches to CXX and -# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for -# the respective C++ standard version. +# CXXCPP to enable support. VERSION may be '11', '14', '17', '20', or +# '23' for the respective C++ standard version. # # The second argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. @@ -36,14 +36,15 @@ # Copyright (c) 2016, 2018 Krzesimir Nowak <qd...@gm...> # Copyright (c) 2019 Enji Cooper <yan...@gm...> # Copyright (c) 2020 Jason Merrill <ja...@re...> -# Copyright (c) 2021 Jörn Heusipp <os...@pr...> +# Copyright (c) 2021, 2024 Jörn Heusipp <os...@pr...> +# Copyright (c) 2015, 2022, 2023, 2024 Olly Betts # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 14 +#serial 24 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). @@ -53,6 +54,7 @@ [$1], [14], [ax_cxx_compile_alternatives="14 1y"], [$1], [17], [ax_cxx_compile_alternatives="17 1z"], [$1], [20], [ax_cxx_compile_alternatives="20"], + [$1], [23], [ax_cxx_compile_alternatives="23"], [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$2], [], [], [$2], [ext], [], @@ -104,9 +106,18 @@ dnl HP's aCC needs +std=c++11 according to: dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf dnl Cray's crayCC needs "-h std=c++11" + dnl MSVC needs -std:c++NN for C++17 and later (default is C++14) for alternative in ${ax_cxx_compile_alternatives}; do - for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do + if test x"$switch" = xMSVC; then + dnl AS_TR_SH maps both `:` and `=` to `_` so -std:c++17 would collide + dnl with -std=c++17. We suffix the cache variable name with _MSVC to + dnl avoid this. + switch=-std:c++${alternative} + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_${switch}_MSVC]) + else + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + fi AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, [ac_save_CXX="$CXX" @@ -150,31 +161,41 @@ dnl Test body for checking C++11 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11] ) dnl Test body for checking C++14 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14] ) dnl Test body for checking C++17 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 + [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17] ) dnl Test body for checking C++20 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20], + [_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_20] +) + +dnl Test body for checking C++23 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_23], _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_23 ) @@ -189,7 +210,21 @@ #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -480,7 +515,7 @@ #error "This is not a C++ compiler" -#elif __cplusplus < 201402L +#elif __cplusplus < 201402L && !defined _MSC_VER #error "This is not a C++14 compiler" @@ -604,7 +639,7 @@ #error "This is not a C++ compiler" -#elif __cplusplus < 201703L +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L #error "This is not a C++17 compiler" @@ -970,7 +1005,7 @@ } // namespace cxx17 -#endif // __cplusplus < 201703L +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L ]]) @@ -983,7 +1018,7 @@ #error "This is not a C++ compiler" -#elif __cplusplus < 202002L +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L #error "This is not a C++20 compiler" @@ -1000,6 +1035,36 @@ } // namespace cxx20 -#endif // __cplusplus < 202002L +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L + +]]) + + +dnl Tests for new features in C++23 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_23], [[ + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L + +#error "This is not a C++23 compiler" + +#else + +#include <version> + +namespace cxx23 +{ + +// As C++23 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx23 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L ]]) |