From: <sag...@us...> - 2012-03-04 23:19:58
|
Revision: 1202 http://modplug.svn.sourceforge.net/modplug/?rev=1202&view=rev Author: saga-games Date: 2012-03-04 23:19:51 +0000 (Sun, 04 Mar 2012) Log Message: ----------- [Int] VS08 SoundTouch project was slightly broken. [Fix] Sample Editor: When cleaning up samples, the sample spin button is now updated instantly. [Imp] Pattern Editor: Slightly improved PC Event handling in the Note Properties. Modified Paths: -------------- trunk/OpenMPT/common/misc_util.h trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp trunk/OpenMPT/mptrack/PatternEditorDialogs.h trunk/OpenMPT/soundtouch/soundtouch.vcproj trunk/OpenMPT/soundtouch/soundtouch_08.vcproj Modified: trunk/OpenMPT/common/misc_util.h =================================================================== --- trunk/OpenMPT/common/misc_util.h 2012-03-03 15:14:35 UTC (rev 1201) +++ trunk/OpenMPT/common/misc_util.h 2012-03-04 23:19:51 UTC (rev 1202) @@ -63,17 +63,6 @@ // Copy given object to other location. template <class T> -inline void MemCopy(T &destination, T &source) -//-------------------------------------------- -{ -#if _HAS_TR1 - static_assert(std::tr1::is_pointer<T>::value == false, "Won't copy pointers."); - static_assert(std::tr1::is_pod<T>::value == true, "Won't copy non-pods."); -#endif - memcpy(&destination, &source, sizeof(T)); -} - -template <class T> inline void MemCopy(T &destination, const T &source) //-------------------------------------------------- { Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp =================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp 2012-03-03 15:14:35 UTC (rev 1201) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2012-03-04 23:19:51 UTC (rev 1202) @@ -160,7 +160,7 @@ if(m_bCheckBoxes[CU_RESET_VARIABLES]) bModified |= ResetVariables(); if(bModified) m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_MODTYPE|HINT_MODSEQUENCE|HINT_MODGENERAL); + m_pModDoc->UpdateAllViews(NULL, HINT_MODTYPE | HINT_MODSEQUENCE | HINT_MODGENERAL | HINT_SMPNAMES | HINT_INSNAMES); m_pModDoc->ShowLog("Cleanup", this); CDialog::OnOK(); } Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2012-03-03 15:14:35 UTC (rev 1201) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2012-03-04 23:19:51 UTC (rev 1202) @@ -326,12 +326,13 @@ bool CCtrlSamples::SetCurrentSample(SAMPLEINDEX nSmp, LONG lZoom, bool bUpdNum) //----------------------------------------------------------------------------- { - CModDoc *pModDoc = GetDocument(); - CSoundFile *pSndFile; - if (!pModDoc) return false; - pSndFile = pModDoc->GetSoundFile(); - if (pSndFile->m_nSamples < 1) pSndFile->m_nSamples = 1; - if ((nSmp < 1) || (nSmp > pSndFile->m_nSamples)) return FALSE; + if (m_pSndFile == nullptr) + { + return false; + } + + if (m_pSndFile->GetNumSamples() < 1) m_pSndFile->m_nSamples = 1; + if ((nSmp < 1) || (nSmp > m_pSndFile->GetNumSamples())) return FALSE; LockControls(); if (m_nSample != nSmp) @@ -342,7 +343,7 @@ if (bUpdNum) { SetDlgItemInt(IDC_EDIT_SAMPLE, m_nSample); - m_SpinSample.SetRange(1, pSndFile->m_nSamples); + m_SpinSample.SetRange(1, m_pSndFile->GetNumSamples()); } if (lZoom < 0) lZoom = m_ComboZoom.GetCurSel(); @@ -655,6 +656,8 @@ const ModSample &sample = m_pSndFile->GetSample(m_nSample); CHAR s[128]; DWORD d; + + m_SpinSample.SetRange(1, m_pSndFile->GetNumSamples()); // Length / Type wsprintf(s, "%d-bit %s, len: %d", sample.GetElementarySampleSize() * 8, (sample.uFlags & CHN_STEREO) ? "stereo" : "mono", sample.nLength); @@ -3258,4 +3261,4 @@ } } -} +} \ No newline at end of file Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2012-03-03 15:14:35 UTC (rev 1201) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2012-03-04 23:19:51 UTC (rev 1202) @@ -1069,12 +1069,12 @@ void CPageEditEffect::UpdateDialog() //---------------------------------- { - CHAR s[128]; CComboBox *combo; CSoundFile *pSndFile; if ((!m_pModDoc) || (!m_bInitialized)) return; pSndFile = m_pModDoc->GetSoundFile(); + if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL) { combo->ResetContent(); @@ -1083,6 +1083,7 @@ // plugin param control note if(m_nPlugin > 0 && m_nPlugin <= MAX_MIXPLUGINS) { + combo->ModifyStyle(CBS_SORT, 0); // Y U NO WORK? AddPluginParameternamesToCombobox(*combo, pSndFile->m_MixPlugins[m_nPlugin - 1]); combo->SetCurSel(m_nPluginParam); } @@ -1091,8 +1092,11 @@ // process as effect UINT numfx = effectInfo.GetNumEffects(); UINT fxndx = effectInfo.GetIndexFromEffect(m_nCommand, m_nParam); + combo->ModifyStyle(0, CBS_SORT); combo->SetItemData(combo->AddString(" None"), (DWORD)-1); - if (!m_nCommand) combo->SetCurSel(0); + if (m_nCommand == CMD_NONE) combo->SetCurSel(0); + + CHAR s[128]; for (UINT i=0; i<numfx; i++) { if (effectInfo.GetEffectInfo(i, s, true)) @@ -1102,6 +1106,7 @@ if (i == fxndx) combo->SetCurSel(k); } } + combo->ModifyStyle(CBS_SORT, 0); } } UpdateRange(FALSE); @@ -1114,22 +1119,35 @@ CSliderCtrl *slider = (CSliderCtrl *)GetDlgItem(IDC_SLIDER1); if ((slider) && (m_pModDoc)) { - DWORD rangeMin = 0, rangeMax = 0; - LONG fxndx = effectInfo.GetIndexFromEffect(m_nCommand, m_nParam); - bool bEnable = ((fxndx >= 0) && (effectInfo.GetEffectInfo(fxndx, NULL, false, &rangeMin, &rangeMax))); - if (bEnable) + DWORD rangeMin = 0, rangeMax = 0, pos; + bool enable = true; + + if(m_bIsParamControl) { + // plugin param control note + rangeMax = ModCommand::maxColumnValue; + pos = ModCommand::GetValueEffectCol(m_nCommand, m_nParam); + } else + { + // process as effect + LONG fxndx = effectInfo.GetIndexFromEffect(m_nCommand, m_nParam); + enable = ((fxndx >= 0) && (effectInfo.GetEffectInfo(fxndx, NULL, false, &rangeMin, &rangeMax))); + + pos = effectInfo.MapValueToPos(fxndx, m_nParam); + if (pos > rangeMax) pos = rangeMin | (pos & 0x0F); + if (pos < rangeMin) pos = rangeMin; + if (pos > rangeMax) pos = rangeMax; + } + + if (enable) + { slider->EnableWindow(TRUE); slider->SetPageSize(1); slider->SetRange(rangeMin, rangeMax); - DWORD pos = effectInfo.MapValueToPos(fxndx, m_nParam); - if (pos > rangeMax) pos = rangeMin | (pos & 0x0F); - if (pos < rangeMin) pos = rangeMin; - if (pos > rangeMax) pos = rangeMax; slider->SetPos(pos); } else { - slider->SetRange(0,0); + slider->SetRange(0, 0); slider->EnableWindow(FALSE); } UpdateValue(bSet); @@ -1141,8 +1159,17 @@ //------------------------------------------ { CHAR s[128] = ""; - LONG fxndx = effectInfo.GetIndexFromEffect(m_nCommand, m_nParam); - if (fxndx >= 0) effectInfo.GetEffectNameEx(s, fxndx, m_nParam * m_nMultiplier + m_nXParam); + + if(m_bIsParamControl) + { + // plugin param control note + wsprintf(s, "Value: %u", ModCommand::GetValueEffectCol(m_nCommand, m_nParam)); + } else + { + // process as effect + LONG fxndx = effectInfo.GetIndexFromEffect(m_nCommand, m_nParam); + if (fxndx >= 0) effectInfo.GetEffectNameEx(s, fxndx, m_nParam * m_nMultiplier + m_nXParam); + } SetDlgItemText(IDC_TEXT1, s); if ((m_pParent) && (bSet)) m_pParent->UpdateEffect(m_nCommand, m_nParam); @@ -1156,16 +1183,29 @@ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL) { - BOOL bSet = FALSE; int n = combo->GetCurSel(); - if (n >= 0) + + if(m_bIsParamControl) { - int param = -1, ndx = combo->GetItemData(n); - m_nCommand = (ndx >= 0) ? effectInfo.GetEffectFromIndex(ndx, param) : 0; - if (param >= 0) m_nParam = static_cast<ModCommand::PARAM>(param); - bSet = TRUE; + // plugin param control note + if(n >= 0) + { + // TODO update in pattern + m_nPluginParam = n; + } + } else + { + // process as effect + BOOL bSet = FALSE; + if (n >= 0) + { + int param = -1, ndx = combo->GetItemData(n); + m_nCommand = (ndx >= 0) ? effectInfo.GetEffectFromIndex(ndx, param) : 0; + if (param >= 0) m_nParam = static_cast<ModCommand::PARAM>(param); + bSet = TRUE; + } + UpdateRange(bSet); } - UpdateRange(bSet); } } @@ -1177,15 +1217,28 @@ CSliderCtrl *slider = (CSliderCtrl *)GetDlgItem(IDC_SLIDER1); if (slider != nullptr) { - LONG fxndx = effectInfo.GetIndexFromEffect(m_nCommand, m_nParam); - if (fxndx >= 0) + if(m_bIsParamControl) { - int pos = slider->GetPos(); - UINT param = effectInfo.MapPosToValue(fxndx, pos); - if (param != m_nParam) + // plugin param control note + // HACK + ModCommand m; + m.SetValueEffectCol(static_cast<int16>(slider->GetPos())); + m_nCommand = m.command; + m_nParam = m.param; + UpdateValue(TRUE); + } else + { + // process as effect + LONG fxndx = effectInfo.GetIndexFromEffect(m_nCommand, m_nParam); + if (fxndx >= 0) { - m_nParam = static_cast<ModCommand::PARAM>(param); - UpdateValue(TRUE); + int pos = slider->GetPos(); + UINT param = effectInfo.MapPosToValue(fxndx, pos); + if (param != m_nParam) + { + m_nParam = static_cast<ModCommand::PARAM>(param); + UpdateValue(TRUE); + } } } } Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.h =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.h 2012-03-03 15:14:35 UTC (rev 1201) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.h 2012-03-04 23:19:51 UTC (rev 1202) @@ -214,7 +214,7 @@ CPageEditEffect(CModDoc *pModDoc, CEditCommand *parent):CPageEditCommand(pModDoc, parent, IDD_PAGEEDITEFFECT) {} // -> CODE#0010 // -> DESC="add extended parameter mechanism to pattern effects" - void Init(ModCommand &m) { m_nCommand = m.command; m_nParam = m.param; m_pModcommand = &m; m_bIsParamControl = m.IsPcNote(); m_nPlugin = m.instr; m_nPluginParam = ModCommand::GetValueVolCol(m.volcmd, m.vol);} + void Init(ModCommand &m) { m_nCommand = m.command; m_nParam = m.param; m_pModcommand = &m; m_bIsParamControl = m.IsPcNote(); m_nPlugin = m.instr; m_nPluginParam = m.GetValueVolCol();} void XInit(UINT xparam = 0, UINT multiplier = 1) { m_nXParam = xparam; m_nMultiplier = multiplier; } // -! NEW_FEATURE#0010 void UpdateDialog(); Modified: trunk/OpenMPT/soundtouch/soundtouch.vcproj =================================================================== --- trunk/OpenMPT/soundtouch/soundtouch.vcproj 2012-03-03 15:14:35 UTC (rev 1201) +++ trunk/OpenMPT/soundtouch/soundtouch.vcproj 2012-03-04 23:19:51 UTC (rev 1202) @@ -123,9 +123,6 @@ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> <File - RelativePath=".\3dnow_win.cpp"> - </File> - <File RelativePath=".\AAFilter.cpp"> </File> <File Modified: trunk/OpenMPT/soundtouch/soundtouch_08.vcproj =================================================================== --- trunk/OpenMPT/soundtouch/soundtouch_08.vcproj 2012-03-03 15:14:35 UTC (rev 1201) +++ trunk/OpenMPT/soundtouch/soundtouch_08.vcproj 2012-03-04 23:19:51 UTC (rev 1202) @@ -187,10 +187,6 @@ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > <File - RelativePath=".\3dnow_win.cpp" - > - </File> - <File RelativePath=".\AAFilter.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |