From: <sag...@us...> - 2010-03-19 19:38:41
|
Revision: 536 http://modplug.svn.sourceforge.net/modplug/?rev=536&view=rev Author: saga-games Date: 2010-03-19 19:38:33 +0000 (Fri, 19 Mar 2010) Log Message: ----------- [Fix] Pattern Editor: Changing a channel plugin in MOD/S3M files doesn't mark them as modified anymore. [Fix] General Tab: Moving a plugin in MOD/S3M files doesn't mark them as modified anymore. The channel fx dropdown lists are now also disabled for those module types. [Fix] Plugin Editor: Changing a plugin parameter in MOD/S3M files doesn't mark them as modified anymore. [Ref] Added "supportsPlugins" to MOD specifications. Modified Paths: -------------- trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/View_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_gen.cpp 2010-03-19 18:43:47 UTC (rev 535) +++ trunk/OpenMPT/mptrack/View_gen.cpp 2010-03-19 19:38:33 UTC (rev 536) @@ -403,10 +403,10 @@ ::EnableWindow(m_sbPan[ichn].m_hWnd, bEnable && !(pSndFile->GetType() & (MOD_TYPE_XM|MOD_TYPE_MOD))); ::EnableWindow(m_spinPan[ichn], bEnable && !(pSndFile->GetType() & (MOD_TYPE_XM|MOD_TYPE_MOD))); - ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT1+ichn*2), bIT); - ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT2+ichn*2), bEnable && !(pSndFile->GetType() & (MOD_TYPE_XM|MOD_TYPE_MOD))); - ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT9+ichn), ((bEnable) && (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)))); - m_CbnEffects[ichn].EnableWindow(bEnable); + ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT1 + ichn*2), bIT); // channel vol + ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT2 + ichn*2), bEnable && !(pSndFile->GetType() & (MOD_TYPE_XM|MOD_TYPE_MOD))); // channel pan + ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT9 + ichn), ((bEnable) && (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)))); // channel name + m_CbnEffects[ichn].EnableWindow(bEnable & (pSndFile->GetModSpecifications().supportsPlugins ? TRUE : FALSE)); } UnlockControls(); } @@ -707,7 +707,8 @@ wsprintf(s, "(%d%% wet, %d%% dry)", 100-n, n); SetDlgItemText(IDC_STATIC8, s); pPlugin->fDryRatio = static_cast<float>(n)/100.0f; - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); } } } @@ -738,7 +739,8 @@ { pVstPlugin->SetParameter(m_nCurrentParam, fValue); OnParamChanged(); - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); } } } @@ -765,7 +767,8 @@ pSndFile = pModDoc->GetSoundFile(); pPlugin = &pSndFile->m_MixPlugins[m_nCurrentPlugin]; - if(pPlugin->pMixPlugin){ + if(pPlugin->pMixPlugin) + { DWORD gain = nPos; if(gain == 0) gain = 1; @@ -776,7 +779,8 @@ sprintf(s,"Gain: x %1.1f",fValue); SetDlgItemText(IDC_STATIC2, s); - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); } } // -! BEHAVIOUR_CHANGE#0028 @@ -828,7 +832,8 @@ && (pSndFile->ChnSettings[nChn].nMixPlugin != (UINT)nfx)) { pSndFile->ChnSettings[nChn].nMixPlugin = (PLUGINDEX)nfx; - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << HINT_SHIFT_CHNTAB)); } } @@ -856,7 +861,8 @@ if (strcmp(s, pSndFile->m_MixPlugins[m_nCurrentPlugin].Info.szName)) { memcpy(pSndFile->m_MixPlugins[m_nCurrentPlugin].Info.szName, s, 32); - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); pModDoc->UpdateAllViews(NULL, HINT_MODCHANNELS | (m_nActiveTab << HINT_SHIFT_CHNTAB)); } } @@ -930,10 +936,8 @@ CSelectPluginDlg dlg(pModDoc, m_nCurrentPlugin, this); if (dlg.DoModal() == IDOK) { - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) - { + if(pSndFile->GetModSpecifications().supportsPlugins) pModDoc->SetModified(); - } } OnPluginChanged(); OnParamChanged(); @@ -1004,7 +1008,8 @@ if (m_nCurrentPreset > 0 && m_nCurrentPreset <= nParams){ pVstPlugin->SetCurrentProgram(m_nCurrentPreset-1); } - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); } } @@ -1025,10 +1030,13 @@ if(files.abort) return; //TODO: exception handling - if (!(pVstPlugin->LoadProgram(files.first_file.c_str()))) { + if (!(pVstPlugin->LoadProgram(files.first_file.c_str()))) + { ::AfxMessageBox("Error loading preset.Are you sure it is for this plugin?"); - } else { - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + } else + { + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); } //end rewbs.fxpPresets @@ -1080,7 +1088,8 @@ FLOAT fValue = (FLOAT)atof(s); pVstPlugin->SetParameter(m_nCurrentParam, fValue); OnParamChanged(); - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); } } } @@ -1102,7 +1111,8 @@ //CVstPlugin *pVstPlugin = (CVstPlugin *)pPlugin->pMixPlugin; UINT value = GetDlgItemIntEx(IDC_EDIT15); pPlugin->fDryRatio = (float)value / 100.0f; - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); //OnWetDryChanged(); } } @@ -1153,7 +1163,8 @@ pPlugin->Info.dwInputRouting &= ~MIXPLUG_INPUTF_MASTEREFFECT; } - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); } @@ -1175,7 +1186,8 @@ pPlugin->Info.dwInputRouting &= ~MIXPLUG_INPUTF_BYPASS; } - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); } @@ -1199,7 +1211,8 @@ pPlugin->Info.dwInputRouting &= ~MIXPLUG_INPUTF_MIXEXPAND; } - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); } VOID CViewGlobals::OnSpecialMixProcessingChanged() @@ -1211,7 +1224,8 @@ if(!pPlugin) return; pPlugin->Info.dwInputRouting = (pPlugin->Info.dwInputRouting & 0xffff00ff) | (m_CbnSpecialMixProcessing.GetCurSel()<<8); // update#02 (fix) - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); } // -! BEHAVIOUR_CHANGE#0028 @@ -1234,7 +1248,8 @@ pPlugin->Info.dwInputRouting &= ~MIXPLUG_INPUTF_WETMIX; } - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); } @@ -1263,7 +1278,8 @@ { CVstPlugin *pVstPlugin = (CVstPlugin *)pPlugin->pMixPlugin; pVstPlugin->ExecuteCommand(nIndex); - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); } } @@ -1281,7 +1297,8 @@ pPlugin = &pSndFile->m_MixPlugins[m_nCurrentPlugin]; nroute = m_CbnOutput.GetItemData(m_CbnOutput.GetCurSel()); pPlugin->Info.dwOutputRouting = nroute; - if (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); } @@ -1396,7 +1413,8 @@ END_CRITICAL(); - pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); EndWaitCursor(); @@ -1453,7 +1471,8 @@ m_CbnPlugin.SetCurSel(m_nCurrentPlugin); OnPluginChanged(); - pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); } } Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2010-03-19 18:43:47 UTC (rev 535) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-03-19 19:38:33 UTC (rev 536) @@ -4365,7 +4365,7 @@ } void CViewPattern::TempEnterChord(int note) -//--------------------------------------------- +//----------------------------------------- { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); CModDoc *pModDoc = GetDocument(); @@ -4650,7 +4650,8 @@ if (newPlug <= MAX_MIXPLUGINS && newPlug != pSndFile->ChnSettings[m_nMenuOnChan-1].nMixPlugin) { pSndFile->ChnSettings[m_nMenuOnChan-1].nMixPlugin = newPlug; - pModDoc->SetModified(); + if(pSndFile->GetModSpecifications().supportsPlugins) + pModDoc->SetModified(); InvalidateChannelsHeaders(); } } Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2010-03-19 18:43:47 UTC (rev 535) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2010-03-19 19:38:33 UTC (rev 536) @@ -664,8 +664,10 @@ CModDoc* pModDoc = pVstPlugin->GetModDoc(); if (pModDoc) { CAbstractVstEditor *pVstEditor = pVstPlugin->GetEditor(); - if (pVstEditor && pVstEditor->m_hWnd) { //Check GUI is open - CMainFrame::GetMainFrame()->ThreadSafeSetModified(pModDoc); + if (pVstEditor && pVstEditor->m_hWnd) // Check GUI is open + { + if(pModDoc->GetSoundFile() && pModDoc->GetSoundFile()->GetModSpecifications().supportsPlugins) + CMainFrame::GetMainFrame()->ThreadSafeSetModified(pModDoc); } //Could be used to update general tab in real time, but causes flickers in treeview //pModDoc->UpdateAllViews(NULL, HINT_MIXPLUGINS, NULL); @@ -980,11 +982,11 @@ //---from here VST 2.1 extension opcodes------------------------------------------------------ // begin of automation session (when mouse down), parameter index in <index> case audioMasterBeginEdit: - Log("VST plugin to host: Get Directory\n"); + Log("VST plugin to host: Begin Edit\n"); break; // end of automation session (when mouse up), parameter index in <index> case audioMasterEndEdit: - Log("VST plugin to host: Get Directory\n"); + Log("VST plugin to host: End Edit\n"); break; // open a fileselector window with VstFileSelect* in <ptr> case audioMasterOpenFileSelector: Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2010-03-19 18:43:47 UTC (rev 535) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2010-03-19 19:38:33 UTC (rev 536) @@ -47,6 +47,7 @@ char volcommands[MAX_VOLCMDS + 1]; // dito, but for volume column bool hasIgnoreIndex; // Does "+++" pattern exist? bool hasRestartPos; + bool supportsPlugins; }; @@ -91,6 +92,7 @@ " vpcdabuhlrgfe:o", // Supported Volume Column commands true, // Has "+++" pattern true, // Has restart position (order) + true, // Supports plugins }; @@ -130,6 +132,7 @@ " ???????????????", // Supported Volume Column commands false, // Doesn't have "+++" pattern true, // Has restart position (order) + false, // Doesn't support plugins }; // MOD with MPT extensions. @@ -167,6 +170,7 @@ " ???????????????", // Supported Volume Column commands true, // Has "+++" pattern true, // Has restart position (order) + false, // Doesn't support plugins }; const CModSpecifications xm = @@ -203,6 +207,7 @@ " vpcdabuhlrg????", // Supported Volume Column commands false, // Doesn't have "+++" pattern true, // Has restart position (order) + false, // Doesn't support plugins }; // XM with MPT extensions @@ -240,6 +245,7 @@ " vpcdabuhlrgfe:o", // Supported Volume Column commands true, // Has "+++" pattern true, // Has restart position (order) + true, // Supports plugins }; const CModSpecifications s3m = @@ -276,6 +282,7 @@ " vp?????????????", // Supported Volume Column commands true, // Has "+++" pattern false, // Doesn't have restart position (order) + false, // Doesn't support plugins }; // S3M with MPT extensions @@ -313,6 +320,7 @@ " vp?????????????", // Supported Volume Column commands true, // Has "+++" pattern false, // Doesn't have restart position (order) + false, // Doesn't support plugins }; const CModSpecifications it = @@ -349,6 +357,7 @@ " vpcdab?h??gfe??", // Supported Volume Column commands true, // Has "+++" pattern false, // Doesn't have restart position (order) + false, // Doesn't support plugins }; const CModSpecifications itEx = @@ -385,6 +394,7 @@ " vpcdab?h??gfe:o", // Supported Volume Column commands true, // Has "+++" pattern true, // Has restart position (order) + true, // Supports plugins }; } //namespace ModSpecs This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |