From: <sag...@us...> - 2011-02-26 19:22:35
|
Revision: 803 http://modplug.svn.sourceforge.net/modplug/?rev=803&view=rev Author: saga-games Date: 2011-02-26 19:22:28 +0000 (Sat, 26 Feb 2011) Log Message: ----------- [Fix] The EnergyXT GUI does now also work after closing and re-opening the VST editor. (tx Nahkranoth, http://forum.openmpt.org/index.php?topic=2307.0) [Fix] Pattern Editor: Automation data is not written to the pattern if the current module format does not support smooth midi macros. [Mod] OpenMPT: Version is now 1.19.00.26 Modified Paths: -------------- trunk/OpenMPT/mptrack/VSTEditor.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/version.h Modified: trunk/OpenMPT/mptrack/VSTEditor.cpp =================================================================== --- trunk/OpenMPT/mptrack/VSTEditor.cpp 2011-02-20 15:28:53 UTC (rev 802) +++ trunk/OpenMPT/mptrack/VSTEditor.cpp 2011-02-26 19:22:28 UTC (rev 803) @@ -97,7 +97,7 @@ { #ifdef VST_LOG Log("CVstEditor::DoClose()\n"); -#endif +#endif // VST_LOG if ((m_pVstPlugin) && (m_hWnd)) { CRect rect; @@ -105,20 +105,23 @@ m_pVstPlugin->m_nEditorX = rect.left; m_pVstPlugin->m_nEditorY = rect.top; } + if (m_pVstPlugin) + { +#ifdef VST_LOG + Log("Dispatching effEditClose...\n"); +#endif // VST_LOG + m_pVstPlugin->Dispatch(effEditClose, 0, 0, NULL, 0); + } if (m_hWnd) { - #ifdef VST_LOG +#ifdef VST_LOG Log("Destroying window...\n"); - #endif +#endif // VST_LOG + // Initially, this was called before the last Dispatch() call. + // Now it's done after that call so that energyXT's GUI still works after re-opening the VST editor. + // Let's hope that other plugins don't break... DestroyWindow(); } - if (m_pVstPlugin) - { - #ifdef VST_LOG - Log("Dispatching effEditClose...\n"); - #endif - m_pVstPlugin->Dispatch(effEditClose, 0, 0, NULL, 0); - } } #endif // NO_VST Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2011-02-20 15:28:53 UTC (rev 802) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-02-26 19:22:28 UTC (rev 803) @@ -3065,11 +3065,13 @@ { CModDoc *pModDoc = GetDocument(); //if (!m_bRecord || !pModDoc) { - if (!IsEditingEnabled() || !pModDoc) { + if (!IsEditingEnabled() || !pModDoc) + { return 0; } CSoundFile *pSndFile = pModDoc->GetSoundFile(); - if (!pSndFile) { + if (!pSndFile) + { return 0; } @@ -3081,8 +3083,6 @@ if(bUsePlaybackPosition == true) SetEditPos(*pSndFile, nRow, nPattern, pSndFile->m_nRow, pSndFile->m_nPattern); - pModDoc->GetPatternUndo()->PrepareUndo(nPattern, nChn, nRow, 1, 1); - MODCOMMAND *pRow = pSndFile->Patterns[nPattern].GetpModCommand(nRow, nChn); // TODO: Is the right plugin active? Move to a chan with the right plug @@ -3098,10 +3098,12 @@ // only overwrite existing PC Notes if(pRow->IsEmpty() || pRow->IsPcNote()) { + pModDoc->GetPatternUndo()->PrepareUndo(nPattern, nChn, nRow, 1, 1); + pRow->Set(NOTE_PCS, plugSlot + 1, paramIndex, static_cast<uint16>(pPlug->GetParameter(paramIndex) * MODCOMMAND::maxColumnValue)); InvalidateRow(nRow); } - } else + } else if(pSndFile->GetModSpecifications().HasCommand(CMD_SMOOTHMIDI)) { // Other formats: Use MIDI macros @@ -3109,17 +3111,23 @@ long activePlugParam = -1; BYTE activeMacro = pSndFile->Chn[nChn].nActiveMacro; CString activeMacroString = &(pSndFile->m_MidiCfg.szMidiSFXExt[activeMacro*32]); - if (pModDoc->GetMacroType(activeMacroString) == sfx_plug) { + if (pModDoc->GetMacroType(activeMacroString) == sfx_plug) + { activePlugParam = pModDoc->MacroToPlugParam(activeMacroString); } //If the wrong macro is active, see if we can find the right one. //If we can, activate it for this chan by writing appropriate SFx command it. - if (activePlugParam != paramIndex) { + if (activePlugParam != paramIndex) + { int foundMacro = pModDoc->FindMacroForParam(paramIndex); - if (foundMacro >= 0) { + if (foundMacro >= 0) + { pSndFile->Chn[nChn].nActiveMacro = foundMacro; - if (pRow->command == 0 || pRow->command == CMD_SMOOTHMIDI || pRow->command == CMD_MIDI) { //we overwrite existing Zxx and \xx only. - pRow->command = (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT))?CMD_S3MCMDEX:CMD_MODCMDEX;; + if (pRow->command == CMD_NONE || pRow->command == CMD_SMOOTHMIDI || pRow->command == CMD_MIDI) //we overwrite existing Zxx and \xx only. + { + pModDoc->GetPatternUndo()->PrepareUndo(nPattern, nChn, nRow, 1, 1); + + pRow->command = (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) ? CMD_S3MCMDEX : CMD_MODCMDEX;; pRow->param = 0xF0 + (foundMacro&0x0F); InvalidateRow(nRow); } @@ -3128,7 +3136,10 @@ } //Write the data, but we only overwrite if the command is a macro anyway. - if (pRow->command == CMD_NONE || pRow->command == CMD_SMOOTHMIDI || pRow->command == CMD_MIDI) { + if (pRow->command == CMD_NONE || pRow->command == CMD_SMOOTHMIDI || pRow->command == CMD_MIDI) + { + pModDoc->GetPatternUndo()->PrepareUndo(nPattern, nChn, nRow, 1, 1); + pRow->command = CMD_SMOOTHMIDI; pRow->param = pPlug->GetZxxParameter(paramIndex); InvalidateRow(nRow); Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-02-20 15:28:53 UTC (rev 802) +++ trunk/OpenMPT/mptrack/version.h 2011-02-26 19:22:28 UTC (rev 803) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #define VER_MINOR 00 -#define VER_MINORMINOR 25 +#define VER_MINORMINOR 26 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |