From: <sv...@op...> - 2024-11-24 00:38:53
|
Author: sagamusix Date: Sun Nov 24 01:38:47 2024 New Revision: 22275 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22275 Log: Merged revision(s) 22242-22244 from trunk/OpenMPT: [Ref] Silence warning. ........ [Ref] Use new MAX_PREAMP constant in GUI too. ........ [Fix] Use inline instead of static. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/mptrack/Ctrl_gen.cpp branches/OpenMPT-1.31/soundlib/Snd_defs.h branches/OpenMPT-1.31/soundlib/Sndfile.cpp Modified: branches/OpenMPT-1.31/mptrack/Ctrl_gen.cpp ============================================================================== --- branches/OpenMPT-1.31/mptrack/Ctrl_gen.cpp Sun Nov 24 01:37:52 2024 (r22274) +++ branches/OpenMPT-1.31/mptrack/Ctrl_gen.cpp Sun Nov 24 01:38:47 2024 (r22275) @@ -554,8 +554,8 @@ m_EditVSTiVol.GetWindowText(s, mpt::saturate_cast<int>(std::size(s))); if (s[0]) { - UINT n = mpt::parse<UINT>(s); - Limit(n, 0u, 2000u); + uint32 n = mpt::parse<uint32>(s); + Limit(n, uint32(0), MAX_PREAMP); if (n != m_sndFile.m_nVSTiVolume) { m_editsLocked = true; @@ -578,8 +578,8 @@ m_EditSamplePA.GetWindowText(s, mpt::saturate_cast<int>(std::size(s))); if (s[0]) { - UINT n = mpt::parse<UINT>(s); - Limit(n, 0u, 2000u); + uint32 n = mpt::parse<uint32>(s); + Limit(n, uint32(0), MAX_PREAMP); if (n != m_sndFile.m_nSamplePreAmp) { m_editsLocked = true; Modified: branches/OpenMPT-1.31/soundlib/Snd_defs.h ============================================================================== --- branches/OpenMPT-1.31/soundlib/Snd_defs.h Sun Nov 24 01:37:52 2024 (r22274) +++ branches/OpenMPT-1.31/soundlib/Snd_defs.h Sun Nov 24 01:38:47 2024 (r22275) @@ -299,7 +299,8 @@ #define SNDMIX_MUTECHNMODE 0x100000 // Notes are not played on muted channels -#define MAX_GLOBAL_VOLUME 256u +inline constexpr uint32 MAX_GLOBAL_VOLUME = 256; +inline constexpr uint32 MAX_PREAMP = 2000; // Resampling modes enum ResamplingMode : uint8 Modified: branches/OpenMPT-1.31/soundlib/Sndfile.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Sndfile.cpp Sun Nov 24 01:37:52 2024 (r22274) +++ branches/OpenMPT-1.31/soundlib/Sndfile.cpp Sun Nov 24 01:38:47 2024 (r22275) @@ -664,8 +664,8 @@ LimitMax(m_nDefaultRowsPerBeat, MAX_ROWS_PER_BEAT); LimitMax(m_nDefaultRowsPerMeasure, MAX_ROWS_PER_BEAT); LimitMax(m_nDefaultGlobalVolume, MAX_GLOBAL_VOLUME); - LimitMax(m_nSamplePreAmp, 2000); - LimitMax(m_nVSTiVolume, 2000); + LimitMax(m_nSamplePreAmp, MAX_PREAMP); + LimitMax(m_nVSTiVolume, MAX_PREAMP); if(!m_tempoSwing.empty()) m_tempoSwing.resize(m_nDefaultRowsPerBeat); |