|
From: <man...@us...> - 2013-06-16 12:32:59
|
Revision: 2389
http://sourceforge.net/p/modplug/code/2389
Author: manxorist
Date: 2013-06-16 12:32:51 +0000 (Sun, 16 Jun 2013)
Log Message:
-----------
[Ref] Remove ancient and unused GlobalFadeSong and IsSongFinished.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Snd_defs.h
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndfile.h
trunk/OpenMPT/soundlib/Sndmix.cpp
Modified: trunk/OpenMPT/soundlib/Snd_defs.h
===================================================================
--- trunk/OpenMPT/soundlib/Snd_defs.h 2013-06-16 12:05:44 UTC (rev 2388)
+++ trunk/OpenMPT/soundlib/Snd_defs.h 2013-06-16 12:32:51 UTC (rev 2389)
@@ -255,7 +255,7 @@
SONG_PAUSED = 0x0080, // Song is paused
SONG_FADINGSONG = 0x0100, // Song is fading out
SONG_ENDREACHED = 0x0200, // Song is finished
- SONG_GLOBALFADE = 0x0400, // Song is fading out
+ //SONG_GLOBALFADE = 0x0400, // Song is fading out
//SONG_CPUVERYHIGH = 0x0800, // High CPU usage
SONG_FIRSTTICK = 0x1000, // Is set when the current tick is the first tick of the row
SONG_MPTFILTERMODE = 0x2000, // Local filter mode (reset filter on each note)
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-06-16 12:05:44 UTC (rev 2388)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-06-16 12:32:51 UTC (rev 2389)
@@ -4402,17 +4402,6 @@
void CSoundFile::SetSpeed(UINT param)
//-----------------------------------
{
- // ModPlug Tracker and Mod-Plugin don't do this check
-#ifdef MODPLUG_PLAYER
- // Big Hack!!!
- if ((!param) || (param >= 0x80) || ((GetType() & (MOD_TYPE_MOD|MOD_TYPE_XM|MOD_TYPE_MT2)) && (param >= 0x1E)))
- {
- if ((!m_nRepeatCount) && (IsSongFinished(m_nCurrentOrder, m_nRow+1)))
- {
- GlobalFadeSong(1000);
- }
- }
-#endif // MODPLUG_PLAYER
// Allow high speed values here for VBlank MODs. (Maybe it would be better to have a "VBlank MOD" flag somewhere? Is it worth the effort?)
if ((param) && (param <= GetModSpecifications().speedMax || (GetType() & MOD_TYPE_MOD))) m_nMusicSpeed = param;
}
@@ -4551,43 +4540,6 @@
}
-DWORD CSoundFile::IsSongFinished(UINT nStartOrder, UINT nStartRow) const
-//----------------------------------------------------------------------
-{
- UINT nOrd;
-
- for (nOrd=nStartOrder; nOrd<Order.size(); nOrd++)
- {
- UINT nPat = Order[nOrd];
- if (nPat != Order.GetIgnoreIndex())
- {
- if (nPat >= Patterns.Size()) break;
- const MODPATTERN& p = Patterns[nPat];
- if (p)
- {
- UINT len = Patterns[nPat].GetNumRows() * m_nChannels;
- UINT pos = (nOrd == nStartOrder) ? nStartRow : 0;
- pos *= m_nChannels;
- while (pos < len)
- {
- UINT cmd;
- if ((p[pos].note) || (p[pos].volcmd)) return 0;
- cmd = p[pos].command;
- if (cmd == CMD_MODCMDEX)
- {
- UINT cmdex = p[pos].param & 0xF0;
- if ((!cmdex) || (cmdex == 0x60) || (cmdex == 0xE0) || (cmdex == 0xF0)) cmd = 0;
- }
- if ((cmd) && (cmd != CMD_SPEED) && (cmd != CMD_TEMPO)) return 0;
- pos++;
- }
- }
- }
- }
- return (nOrd < Order.size()) ? nOrd : Order.size()-1;
-}
-
-
//////////////////////////////////////////////////////
// Note/Period/Frequency functions
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-06-16 12:05:44 UTC (rev 2388)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-06-16 12:32:51 UTC (rev 2389)
@@ -1075,7 +1075,7 @@
visitedSongRows.Initialize(true);
}
- m_SongFlags.reset(SONG_FADINGSONG | SONG_ENDREACHED | SONG_GLOBALFADE);
+ m_SongFlags.reset(SONG_FADINGSONG | SONG_ENDREACHED);
for (nPattern = 0; nPattern < Order.size(); nPattern++)
{
UINT ord = Order[nPattern];
@@ -1172,7 +1172,7 @@
m_nNextPatStartRow = 0;
}
- m_SongFlags.reset(SONG_FADINGSONG | SONG_ENDREACHED | SONG_GLOBALFADE);
+ m_SongFlags.reset(SONG_FADINGSONG | SONG_ENDREACHED);
}
//rewbs.VSTCompliance
@@ -1259,7 +1259,7 @@
void CSoundFile::ResetChannels()
//------------------------------
{
- m_SongFlags.reset(SONG_FADINGSONG | SONG_ENDREACHED | SONG_GLOBALFADE);
+ m_SongFlags.reset(SONG_FADINGSONG | SONG_ENDREACHED);
m_nBufferCount = 0;
for (UINT i=0; i<MAX_CHANNELS; i++)
{
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2013-06-16 12:05:44 UTC (rev 2388)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2013-06-16 12:32:51 UTC (rev 2389)
@@ -411,7 +411,6 @@
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;
UINT m_nMaxOrderPosition;
CHANNELINDEX ChnMix[MAX_CHANNELS]; // Channels to be mixed
ModChannel Chn[MAX_CHANNELS]; // Mixing channels... First m_nChannel channels are master channels (i.e. they are never NNA channels)!
@@ -644,7 +643,6 @@
void CreateStereoMix(int count);
public:
BOOL FadeSong(UINT msec);
- BOOL GlobalFadeSong(UINT msec);
private:
void ProcessDSP(std::size_t countChunk);
void ProcessPlugins(UINT nCount);
@@ -755,7 +753,6 @@
// Low-Level effect processing
void DoFreqSlide(ModChannel *pChn, LONG nFreqSlide);
void GlobalVolSlide(UINT param, UINT &nOldGlobalVolSlide);
- DWORD IsSongFinished(UINT nOrder, UINT nRow) const;
void UpdateTimeSignature();
UINT GetNumTicksOnCurrentRow() const
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2013-06-16 12:05:44 UTC (rev 2388)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2013-06-16 12:32:51 UTC (rev 2389)
@@ -154,17 +154,6 @@
}
-BOOL CSoundFile::GlobalFadeSong(UINT msec)
-//----------------------------------------
-{
- if(m_SongFlags[SONG_GLOBALFADE]) return FALSE;
- m_nGlobalFadeMaxSamples = Util::muldiv(msec, m_MixerSettings.gdwMixingFreq, 1000);
- m_nGlobalFadeSamples = m_nGlobalFadeMaxSamples;
- m_SongFlags.set(SONG_GLOBALFADE);
- return TRUE;
-}
-
-
CSoundFile::samplecount_t CSoundFile::ReadInterleaved(void *outputBuffer, samplecount_t count)
//--------------------------------------------------------------------------------------------
{
@@ -1710,11 +1699,6 @@
mastervol = m_nSamplePreAmp;
}
- if(m_SongFlags[SONG_GLOBALFADE] && m_nGlobalFadeMaxSamples != 0)
- {
- mastervol = Util::muldiv(mastervol, m_nGlobalFadeSamples, m_nGlobalFadeMaxSamples);
- }
-
if (m_PlayConfig.getUseGlobalPreAmp())
{
UINT attenuation =
@@ -2118,18 +2102,6 @@
}
}
}
- if(m_SongFlags[SONG_GLOBALFADE])
- {
- if (!m_nGlobalFadeSamples)
- {
- m_SongFlags.set(SONG_ENDREACHED);
- return FALSE;
- }
- if (m_nGlobalFadeSamples > m_nBufferCount)
- m_nGlobalFadeSamples -= m_nBufferCount;
- else
- m_nGlobalFadeSamples = 0;
- }
return TRUE;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|