From: <sag...@us...> - 2011-08-09 13:04:19
|
Revision: 971 http://modplug.svn.sourceforge.net/modplug/?rev=971&view=rev Author: saga-games Date: 2011-08-09 13:04:13 +0000 (Tue, 09 Aug 2011) Log Message: ----------- [Fix] Sample playback could be screwed up on channels where an instrument with a plugin assigned was stopped (since rev. 947). [Mod] OpenMPT: Version is now 1.20.00.06 Modified Paths: -------------- trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-08-08 16:00:45 UTC (rev 970) +++ trunk/OpenMPT/mptrack/version.h 2011-08-09 13:04:13 UTC (rev 971) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 20 #define VER_MINOR 00 -#define VER_MINORMINOR 05 +#define VER_MINORMINOR 06 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2011-08-08 16:00:45 UTC (rev 970) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2011-08-09 13:04:13 UTC (rev 971) @@ -1966,8 +1966,9 @@ // Also process envelopes etc. when there's a plugin on this channel, for possible fake automation using volume and pan data. // We only care about master channels, though, since automation only "happens" on them. + const bool samplePlaying = (pChn->nPeriod && pChn->nLength); const bool plugAssigned = (nChn < m_nChannels) && (ChnSettings[nChn].nMixPlugin || (pChn->pModInstrument != nullptr && pChn->pModInstrument->nMixPlug)); - if ((pChn->nPeriod && pChn->nLength) || plugAssigned) + if (samplePlaying || plugAssigned) { int vol = pChn->nVolume; @@ -2001,8 +2002,6 @@ // IMPORTANT: pChn->nRealVolume is 14 bits !!! // -> _muldiv( 14+8, 6+6, 18); => RealVolume: 14-bit result (22+12-20) - //UINT nPlugin = GetBestPlugin(nChn, PRIORITISE_INSTRUMENT, RESPECT_MUTES); - //Don't let global volume affect level of sample if //global volume is going to be applied to master output anyway. if (pChn->dwFlags & CHN_SYNCMUTE) @@ -2042,7 +2041,7 @@ ProcessMacroOnChannel(nChn); // After MIDI macros have been processed, we can also process the pitch / filter envelope and other pitch-related things. - if (pChn->nPeriod && pChn->nLength) + if (samplePlaying) { int nPeriodFrac = 0; @@ -2106,6 +2105,11 @@ if (m_nFreqFactor != 128) ninc = (ninc * m_nFreqFactor) >> 7; if (ninc > 0xFF0000) ninc = 0xFF0000; pChn->nInc = (ninc+1) & ~3; + } else + { + // Avoid nasty noises... + // This could have been != 0 if a plugin was assigned to the channel, for macro purposes. + pChn->nRealVolume = 0; } // Increment envelope positions This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |