|
From: <man...@us...> - 2013-05-20 18:35:10
|
Revision: 2153
http://sourceforge.net/p/modplug/code/2153
Author: manxorist
Date: 2013-05-20 18:35:04 +0000 (Mon, 20 May 2013)
Log Message:
-----------
[Ref] m_nFreqFactor and m_nTempoFactor are old relicts from ModPlug Player. Disable the code #ifdef MODPLUG_TRACKER. Do not remove them completely because this feature might again be useful for libopenmpt_interactive.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndfile.h
trunk/OpenMPT/soundlib/Sndmix.cpp
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-05-20 17:44:53 UTC (rev 2152)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-05-20 18:35:04 UTC (rev 2153)
@@ -416,7 +416,9 @@
m_nMixChannels = 0;
m_nSamples = 0;
m_nInstruments = 0;
+#ifndef MODPLUG_TRACKER
m_nFreqFactor = m_nTempoFactor = 128;
+#endif
m_nMinPeriod = MIN_PERIOD;
m_nMaxPeriod = 0x7FFF;
m_nRepeatCount = 0;
@@ -525,7 +527,9 @@
#endif // MODPLUG_TRACKER
m_nMixChannels = 0;
+#ifndef MODPLUG_TRACKER
m_nFreqFactor = m_nTempoFactor = 128;
+#endif
m_nGlobalVolume = MAX_GLOBAL_VOLUME;
m_nOldGlbVolSlide = 0;
@@ -1690,7 +1694,11 @@
{
case tempo_mode_classic:
default:
+#ifdef MODPLUG_TRACKER
+ m_nSamplesPerTick = (m_MixerSettings.gdwMixingFreq * 5) / (m_nMusicTempo << 1);
+#else // !MODPLUG_TRACKER
m_nSamplesPerTick = (m_MixerSettings.gdwMixingFreq * 5 * m_nTempoFactor) / (m_nMusicTempo << 8);
+#endif
break;
case tempo_mode_modern:
@@ -1712,7 +1720,11 @@
{
case tempo_mode_classic:
default:
+#ifdef MODPLUG_TRACKER
+ return (m_MixerSettings.gdwMixingFreq * 5) / (tempo << 1);
+#else // !MODPLUG_TRACKER
return (m_MixerSettings.gdwMixingFreq * 5 * m_nTempoFactor) / (tempo << 8);
+#endif
case tempo_mode_alternative:
return m_MixerSettings.gdwMixingFreq / tempo;
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2013-05-20 17:44:53 UTC (rev 2152)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2013-05-20 18:35:04 UTC (rev 2153)
@@ -348,7 +348,11 @@
m_nGlobalVolumeDestination, m_nSamplePreAmp, m_nVSTiVolume;
long m_lHighResRampingGlobalVolume;
bool IsGlobalVolumeUnset() const { return IsFirstTick(); }
- UINT m_nFreqFactor, m_nTempoFactor, m_nOldGlbVolSlide;
+#ifndef MODPLUG_TRACKER
+ UINT m_nFreqFactor; // Pitch shift factor (128 = no pitch shifting). Interesting ModPlug Player relict, but unused in OpenMPT.
+ UINT m_nTempoFactor; // Tempo factor (128 = no tempo adjustment). Interesting ModPlug Player relict, but unused in OpenMPT.
+#endif
+ UINT m_nOldGlbVolSlide;
LONG m_nMinPeriod, m_nMaxPeriod; // min period = highest possible frequency, max period = lowest possible frequency
LONG m_nRepeatCount; // -1 means repeat infinitely.
DWORD m_nGlobalFadeSamples, m_nGlobalFadeMaxSamples;
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2013-05-20 17:44:53 UTC (rev 2152)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2013-05-20 18:35:04 UTC (rev 2153)
@@ -1908,7 +1908,9 @@
int32 ninc = Util::muldiv(freq, 0x10000, m_MixerSettings.gdwMixingFreq << FREQ_FRACBITS);
if ((ninc >= 0xFFB0) && (ninc <= 0x10090)) ninc = 0x10000;
+#ifndef MODPLUG_TRACKER
if (m_nFreqFactor != 128) ninc = (ninc * m_nFreqFactor) >> 7;
+#endif // !MODPLUG_TRACKER
Limit(ninc, 3, 0xFF0000);
pChn->nInc = (ninc + 1) & ~3;
} else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|