From: <sag...@us...> - 2014-02-22 15:38:40
|
Revision: 3749 http://sourceforge.net/p/modplug/code/3749 Author: saga-games Date: 2014-02-22 15:38:33 +0000 (Sat, 22 Feb 2014) Log Message: ----------- [Fix] General tab: Setting the current program for a plugin stopped working a while ago. Modified Paths: -------------- trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/mptrack/View_gen.h Modified: trunk/OpenMPT/mptrack/View_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_gen.cpp 2014-02-22 12:44:39 UTC (rev 3748) +++ trunk/OpenMPT/mptrack/View_gen.cpp 2014-02-22 15:38:33 UTC (rev 3749) @@ -948,23 +948,23 @@ void CViewGlobals::OnProgramChanged() //----------------------------------- { - VstInt32 cursel = m_CbnPreset.GetItemData(m_CbnPreset.GetCurSel()); + VstInt32 curProg = m_CbnPreset.GetItemData(m_CbnPreset.GetCurSel()); CModDoc *pModDoc = GetDocument(); - if ((m_nCurrentPlugin >= MAX_MIXPLUGINS) || (!pModDoc)) return; CVstPlugin *pVstPlugin = GetCurrentPlugin(); if(pVstPlugin != nullptr) { - VstInt32 nParams = pVstPlugin->GetNumPrograms(); - if(cursel <= nParams) + const VstInt32 numProgs = pVstPlugin->GetNumPrograms(); + if(curProg <= numProgs) { - pVstPlugin->SetCurrentProgram(m_nCurrentPreset); + pVstPlugin->SetCurrentProgram(curProg); // Update parameter display OnParamChanged(); + + if(pModDoc->GetrSoundFile().GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); } - if(pModDoc->GetrSoundFile().GetModSpecifications().supportsPlugins) - pModDoc->SetModified(); } } Modified: trunk/OpenMPT/mptrack/View_gen.h =================================================================== --- trunk/OpenMPT/mptrack/View_gen.h 2014-02-22 12:44:39 UTC (rev 3748) +++ trunk/OpenMPT/mptrack/View_gen.h 2014-02-22 15:38:33 UTC (rev 3749) @@ -27,30 +27,16 @@ CSliderCtrl m_sbVolume[4], m_sbPan[4], m_sbValue, m_sbDryRatio; -// -> CODE#0002 -// -> DESC="VST plugins presets" CComboBox m_CbnPreset; -// -! NEW_FEATURE#0002 -// CSliderCtrl m_sbVolume[4], m_sbPan[4], m_sbValue; -// -> CODE#0014 -// -> DESC="vst wet/dry slider" CSliderCtrl m_sbWetDry; -// -! NEW_FEATURE#0014 CSpinButtonCtrl m_spinVolume[4], m_spinPan[4]; CButton m_BtnSelect, m_BtnEdit; int m_nActiveTab, m_nLockCount; PLUGINDEX m_nCurrentPlugin; PlugParamIndex m_nCurrentParam; -// -> CODE#0002 -// -> DESC="VST plugins presets" - UINT m_nCurrentPreset; -// -! NEW_FEATURE#0002 -// -> CODE#0028 -// -> DESC="effect plugin mixing mode combo" CComboBox m_CbnSpecialMixProcessing; CSpinButtonCtrl m_SpinMixGain; // update#02 -// -! NEW_FEATURE#0028 enum {AdjustPattern = true, NoPatternAdjust = false}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |