From: <sag...@us...> - 2014-03-03 21:02:34
|
Revision: 3819 http://sourceforge.net/p/modplug/code/3819 Author: saga-games Date: 2014-03-03 21:02:26 +0000 (Mon, 03 Mar 2014) Log Message: ----------- [Fix] Tentative fix for samples not playing completely in sample preview while song is playing (http://bugs.openmpt.org/view.php?id=209) - we check the available virtual channels backwards now, which should minimize the risk of a clash with a legit virtual channel (and is faster). This seems to improve things a lot, but I don't understand why. [Fix] VSTi arpeggio continued in case of NNA=continue. Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2014-03-03 18:51:12 UTC (rev 3818) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2014-03-03 21:02:26 UTC (rev 3819) @@ -1077,14 +1077,13 @@ // reset channel properties; in theory the chan is completely unused anyway. chn.Reset(ModChannel::resetTotal, m_SndFile, CHANNELINDEX_INVALID); chn.nMasterChn = 0; // remove NNA association - chn.nNewNote = static_cast<uint8>(note); + chn.nNewNote = chn.nLastNote = static_cast<uint8>(note); if (nins) { // Set instrument chn.ResetEnvelopes(); m_SndFile.InstrumentChange(&chn, nins); - chn.nFadeOutVol = 0x10000; // Needed for XM files, as the nRowInstr check in NoteChange() will fail. } else if ((nsmp) && (nsmp < MAX_SAMPLES)) // Or set sample { ModSample &sample = m_SndFile.GetSample(nsmp); @@ -1097,10 +1096,10 @@ chn.nLoopEnd = sample.nLoopEnd; chn.dwFlags = static_cast<ChannelFlags>(sample.uFlags) & (CHN_SAMPLEFLAGS & ~CHN_MUTE); chn.nPan = 128; - if (sample.uFlags & CHN_PANNING) chn.nPan = sample.nPan; + if (sample.uFlags[CHN_PANNING]) chn.nPan = sample.nPan; chn.nInsVol = sample.nGlobalVol; - chn.nFadeOutVol = 0x10000; } + chn.nFadeOutVol = 0x10000; m_SndFile.NoteChange(&chn, note, false, true, true); if (nVol >= 0) chn.nVolume = nVol; @@ -2666,7 +2665,7 @@ { CHANNELINDEX nStoppedChannel = CHANNELINDEX_INVALID; // Search for available channel - for(CHANNELINDEX j = m_SndFile.m_nChannels; j < MAX_CHANNELS; j++) + for(CHANNELINDEX j = MAX_CHANNELS - 1; j >= m_SndFile.m_nChannels; j--) { const ModChannel &chn = m_SndFile.m_PlayState.Chn[j]; if(!chn.nLength) Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-03-03 18:51:12 UTC (rev 3818) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-03-03 21:02:26 UTC (rev 3819) @@ -1520,6 +1520,7 @@ chn.dwFlags.reset(CHN_VIBRATO | CHN_TREMOLO | CHN_PANBRELLO | CHN_MUTE | CHN_PORTAMENTO); chn.nMasterChn = nChn + 1; chn.nCommand = CMD_NONE; + chn.rowCommand.Clear(); // Cut the note chn.nFadeOutVol = 0; chn.dwFlags.set(CHN_NOTEFADE | CHN_FASTVOLRAMP); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |