|
From: <sag...@us...> - 2015-05-25 15:35:59
|
Revision: 5176
http://sourceforge.net/p/modplug/code/5176
Author: saga-games
Date: 2015-05-25 15:35:54 +0000 (Mon, 25 May 2015)
Log Message:
-----------
[New] Add support for song-specific resampling mode (not usable form GUI yet)
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndfile.h
trunk/OpenMPT/soundlib/Sndmix.cpp
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2015-05-25 15:33:30 UTC (rev 5175)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2015-05-25 15:35:54 UTC (rev 5176)
@@ -2080,6 +2080,11 @@
WRITEMODULAR(MAGIC4BE('R','P','.','.'), m_nRestartPos);
}
+ if(m_nResampling != SRCMODE_DEFAULT)
+ {
+ WRITEMODULAR(MAGIC4LE('R','S','M','P'), m_nResampling);
+ }
+
// Sample cues
if(GetType() == MOD_TYPE_MPT)
{
@@ -2242,6 +2247,10 @@
case MAGIC4BE('D','G','V','.'): ReadField(chunk, size, m_nDefaultGlobalVolume); break;
case MAGIC4BE('R','P','.','.'): if(modtype != MOD_TYPE_XM) ReadField(chunk, size, m_nRestartPos); break;
case MAGIC4BE('M','S','F','.'): ReadFieldFlagSet(chunk, size, m_ModFlags); break;
+ case MAGIC4LE('R','S','M','P'):
+ ReadField(chunk, size, m_nResampling);
+ if(!IsKnownResamplingMode(m_nResampling)) m_nResampling = SRCMODE_DEFAULT;
+ break;
#ifdef MODPLUG_TRACKER
case MAGIC4BE('M','I','M','A'): GetMIDIMapper().Deserialize(chunk); break;
#endif
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2015-05-25 15:33:30 UTC (rev 5175)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2015-05-25 15:35:54 UTC (rev 5176)
@@ -644,6 +644,7 @@
m_SongFlags.reset();
m_nMinPeriod = 16;
m_nMaxPeriod = 32767;
+ m_nResampling = SRCMODE_DEFAULT;
m_dwLastSavedWithVersion = m_dwCreatedWithVersion = 0;
SetMixLevels(mixLevels_compatible);
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2015-05-25 15:33:30 UTC (rev 5175)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2015-05-25 15:35:54 UTC (rev 5176)
@@ -434,6 +434,7 @@
// Periods in MPT are 4 times as fine as Amiga periods because of extra fine frequency slides (introduced in the S3M format).
int32 m_nMinPeriod, m_nMaxPeriod;
+ uint32 m_nResampling; // Resampling mode (if overriding the globally set resampling)
int32 m_nRepeatCount; // -1 means repeat infinitely.
ORDERINDEX m_nMaxOrderPosition;
ModChannelSettings ChnSettings[MAX_BASECHANNELS]; // Initial channels settings
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2015-05-25 15:33:30 UTC (rev 5175)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2015-05-25 15:35:54 UTC (rev 5176)
@@ -2119,6 +2119,9 @@
{
// for defined resampling modes, use per-instrument resampling mode if set
pChn->resamplingMode = static_cast<uint8>(pChn->pModInstrument->nResampling);
+ } else if(IsKnownResamplingMode(m_nResampling))
+ {
+ pChn->resamplingMode = static_cast<uint8>(m_nResampling);
} else
{
// default to global mixer settings
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|