From: <sag...@us...> - 2011-09-25 22:22:44
|
Revision: 1058 http://modplug.svn.sourceforge.net/modplug/?rev=1058&view=rev Author: saga-games Date: 2011-09-25 22:22:38 +0000 (Sun, 25 Sep 2011) Log Message: ----------- [Imp] For plugins with no custom GUI, "Record Params" is now also working. Modified Paths: -------------- trunk/OpenMPT/mptrack/DefaultVstEditor.cpp trunk/OpenMPT/mptrack/Vstplug.cpp Modified: trunk/OpenMPT/mptrack/DefaultVstEditor.cpp =================================================================== --- trunk/OpenMPT/mptrack/DefaultVstEditor.cpp 2011-09-25 22:10:17 UTC (rev 1057) +++ trunk/OpenMPT/mptrack/DefaultVstEditor.cpp 2011-09-25 22:22:38 UTC (rev 1058) @@ -148,14 +148,22 @@ void CDefaultVstEditor::OnParamSliderChanged() //---------------------------------------------- { - if (m_nControlLock) { // Lock will be set if the GUI change was triggered internally (in UpdateParamDisplays). - return; // We're only interested in handling changes triggered by the user. + if (m_nControlLock) + { + // Lock will be set if the GUI change was triggered internally (in UpdateParamDisplays). + // We're only interested in handling changes triggered by the user. + return; } - //Extract value and notify plug + // Extract value and notify plug int val = PARAM_RESOLUTION-m_slParam.GetPos(); - m_pVstPlugin->SetParameter(m_nCurrentParam, val/static_cast<float>(PARAM_RESOLUTION)); - + m_pVstPlugin->SetParameter(m_nCurrentParam, val / static_cast<float>(PARAM_RESOLUTION)); + + if(m_pVstPlugin->m_bRecordAutomation) + { + m_pVstPlugin->GetModDoc()->RecordParamChange(m_pVstPlugin->GetSlot(), m_nCurrentParam); + } + UpdateParamDisplays(); // update other GUI controls m_pVstPlugin->GetModDoc()->SetModified(); @@ -166,7 +174,9 @@ void CDefaultVstEditor::UpdateParamDisplays() //------------------------------------------- { - if (m_nControlLock) { //Just to make sure we're not here as a consequence of an internal GUI change. + if (m_nControlLock) + { + //Just to make sure we're not here as a consequence of an internal GUI change. return; } @@ -180,11 +190,13 @@ m_pVstPlugin->GetParamDisplay(m_nCurrentParam, sdisplay); wsprintf(label, "%s %s", sdisplay, sunits); - //Update the GUI controls + // Update the GUI controls m_nControlLock++; // Set lock to indicate that the changes to the GUI are internal - no need to notify the plug and re-update GUI. m_statParamLabel.SetWindowText(label); m_slParam.SetPos(PARAM_RESOLUTION-val); - if (&m_editParam != m_editParam.GetFocus()) { //Don't update textbox when it has focus, else this will prevent user from changing the content + if (&m_editParam != m_editParam.GetFocus()) + { + // Don't update textbox when it has focus, else this will prevent user from changing the content m_editParam.SetWindowText(s); } m_nControlLock--; // Unset lock - done with internal GUI updates. Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2011-09-25 22:10:17 UTC (rev 1057) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2011-09-25 22:22:38 UTC (rev 1058) @@ -690,7 +690,7 @@ { CVstPlugin *pVstPlugin = ((CVstPlugin*)effect->resvd1); - //Mark track modified + // Mark track modified CModDoc* pModDoc = pVstPlugin->GetModDoc(); if (pModDoc) { @@ -705,9 +705,10 @@ //pModDoc->UpdateAllViews(NULL, HINT_MIXPLUGINS, NULL); } - //Record param change + // Record param change if (pVstPlugin->m_bRecordAutomation) { + // Note that audioMasterAutomate is not called when using our own plugin GUI. For those plugins, the same mechanism is called from CDefaultVstEditor::OnParamSliderChanged(). pModDoc->RecordParamChange(pVstPlugin->GetSlot(), index); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |