From: <sag...@us...> - 2013-12-07 20:59:45
|
Revision: 3411 http://sourceforge.net/p/modplug/code/3411 Author: saga-games Date: 2013-12-07 20:59:40 +0000 (Sat, 07 Dec 2013) Log Message: ----------- [Fix] Plugin selection dialog: Clearing the plugin filter broke a while ago. [Fix] VST: ProteusVX no longer breaks OpenMPT's plugin window (http://bugs.openmpt.org/view.php?id=79). Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/SelectPluginDialog.cpp trunk/OpenMPT/mptrack/VSTEditor.cpp trunk/OpenMPT/mptrack/VSTEditor.h Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-12-07 19:38:57 UTC (rev 3410) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-12-07 20:59:40 UTC (rev 3411) @@ -1570,12 +1570,12 @@ ModCommand *m = m_WaveFile.Patterns[0]; if(m) { - if(m_WaveFile.m_nSamples > 0) + if(m_WaveFile.GetNumSamples() > 0) { m[0].note = note; m[0].instr = 1; - if(m_WaveFile.m_nSamples > 1 && m_WaveFile.GetSample(1).uFlags[CHN_LOOP]) + if(m_WaveFile.GetNumInstruments() != 0 || m_WaveFile.GetSample(1).uFlags[CHN_LOOP]) { m[48 * 2].note = NOTE_KEYOFF; m[79 * 2].note = NOTE_NOTECUT; Modified: trunk/OpenMPT/mptrack/SelectPluginDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2013-12-07 19:38:57 UTC (rev 3410) +++ trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2013-12-07 20:59:40 UTC (rev 3411) @@ -264,8 +264,11 @@ HWND hwnd = GetDlgItem(IDC_NAMEFILTER)->m_hWnd; int len = GetWindowTextLengthW(hwnd); m_nameFilter.resize(len); - GetWindowTextW(hwnd, &m_nameFilter[0], len + 1); - for(int i = 0; i < len; i++) m_nameFilter[i] = ::towlower(m_nameFilter[i]); + if(len) + { + GetWindowTextW(hwnd, &m_nameFilter[0], len + 1); + for(int i = 0; i < len; i++) m_nameFilter[i] = ::towlower(m_nameFilter[i]); + } UpdatePluginsList(); } Modified: trunk/OpenMPT/mptrack/VSTEditor.cpp =================================================================== --- trunk/OpenMPT/mptrack/VSTEditor.cpp 2013-12-07 19:38:57 UTC (rev 3410) +++ trunk/OpenMPT/mptrack/VSTEditor.cpp 2013-12-07 20:59:40 UTC (rev 3411) @@ -35,12 +35,15 @@ { Create(IDD_PLUGINEDITOR, parent); + // Some plugins (e.g. ProteusVX) need to be planted into another control or else they will break our window proc, making the window unusable. + plugWindow.Create(nullptr, WS_CHILD | WS_VISIBLE, CRect(0, 0, 100, 100), this); + SetupMenu(); // Set editor window size ERect *pRect = nullptr; m_VstPlugin.Dispatch(effEditGetRect, 0, 0, &pRect, 0); - m_VstPlugin.Dispatch(effEditOpen, 0, 0, m_hWnd, 0); + m_VstPlugin.Dispatch(effEditOpen, 0, 0, plugWindow.m_hWnd, 0); m_VstPlugin.Dispatch(effEditGetRect, 0, 0, &pRect, 0); if((pRect) && (pRect->right > pRect->left) && (pRect->bottom > pRect->top)) { @@ -140,6 +143,9 @@ SetWindowPos(NULL, 0, 0, windowWidth, windowHeight, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); + plugWindow.SetWindowPos(NULL, 0, 0, + contentWidth, contentHeight, + SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); // Check if the height of the menu bar has changed. GetMenuBarInfo(m_hWnd, OBJID_MENU, 0, &mbi); Modified: trunk/OpenMPT/mptrack/VSTEditor.h =================================================================== --- trunk/OpenMPT/mptrack/VSTEditor.h 2013-12-07 19:38:57 UTC (rev 3410) +++ trunk/OpenMPT/mptrack/VSTEditor.h 2013-12-07 20:59:40 UTC (rev 3411) @@ -18,6 +18,9 @@ class COwnerVstEditor: public CAbstractVstEditor //============================================== { +protected: + CStatic plugWindow; + public: COwnerVstEditor(CVstPlugin &plugin); virtual ~COwnerVstEditor(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |