From: <sag...@us...> - 2014-10-11 13:50:15
|
Revision: 4420 http://sourceforge.net/p/modplug/code/4420 Author: saga-games Date: 2014-10-11 13:50:02 +0000 (Sat, 11 Oct 2014) Log Message: ----------- [Imp] When previewing instruments with a fadeout value of 0, instantly stop them on key-up instead of letting them play forever. Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2014-10-11 13:48:29 UTC (rev 4419) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2014-10-11 13:50:02 UTC (rev 4420) @@ -583,7 +583,7 @@ std::string defaultExtension = m_SndFile.GetModSpecifications().fileExtension; - switch(m_SndFile.GetType()) + switch(m_SndFile.GetBestSaveFormat()) { case MOD_TYPE_MOD: MsgBoxHidable(ModSaveHint); @@ -1231,16 +1231,17 @@ const ChannelFlags mask = (fade ? CHN_NOTEFADE : (CHN_NOTEFADE | CHN_KEYOFF)); ModChannel *pChn = &m_SndFile.m_PlayState.Chn[stopChn != CHANNELINDEX_INVALID ? stopChn : m_SndFile.m_nChannels]; - for(CHANNELINDEX i = m_SndFile.GetNumChannels(); i < MAX_CHANNELS; i++, pChn++) if (!pChn->nMasterChn) + for(CHANNELINDEX i = m_SndFile.GetNumChannels(); i < MAX_CHANNELS; i++, pChn++) { - - // Fade all channels > m_nChannels which are playing this note. - // Could conflict with NNAs. - if(!pChn->dwFlags[mask] && pChn->nLength && (note == pChn->nNewNote || !note)) + // Fade all channels > m_nChannels which are playing this note and aren't NNA channels. + if(!pChn->nMasterChn && !pChn->dwFlags[mask] && pChn->nLength && (note == pChn->nNewNote || !note)) { m_SndFile.KeyOff(pChn); if (!m_SndFile.m_nInstruments) pChn->dwFlags.reset(CHN_LOOP); // FIXME: If a sample with pingpong loop is playing backwards, stuff before the loop is played again! if (fade) pChn->dwFlags.set(CHN_NOTEFADE); + // Instantly stop samples that would otherwise play forever + if (pChn->pModInstrument && !pChn->pModInstrument->nFadeOut) + pChn->nFadeOutVol = 0; if (note) break; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |