From: <sag...@us...> - 2015-06-28 23:45:39
|
Revision: 5379 http://sourceforge.net/p/modplug/code/5379 Author: saga-games Date: 2015-06-28 23:45:33 +0000 (Sun, 28 Jun 2015) Log Message: ----------- [Fix] Tempo swing: Crash when using the reset button in combination with enabled edit groups. [Mod] When converting sampels to instruments, don't bother doing any conversion if all sample slots are empty. Modified Paths: -------------- trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2015-06-28 22:07:51 UTC (rev 5378) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2015-06-28 23:45:33 UTC (rev 5379) @@ -549,6 +549,18 @@ const INSTRUMENTINDEX instrumentMax = m_SndFile.GetModSpecifications().instrumentsMax; if(GetNumInstruments() > 0 || instrumentMax == 0) return false; + // If there is no actual sample data, don't bother creating any instruments + bool anySamples = false; + for(SAMPLEINDEX smp = 1; smp <= m_SndFile.m_nSamples; smp++) + { + if(m_SndFile.GetSample(smp).HasSampleData()) + { + anySamples = true; + break; + } + } + if(!anySamples) return true; + m_SndFile.m_nInstruments = std::min(m_SndFile.GetNumSamples(), instrumentMax); for(SAMPLEINDEX smp = 1; smp <= m_SndFile.m_nInstruments; smp++) { Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2015-06-28 22:07:51 UTC (rev 5378) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2015-06-28 23:45:33 UTC (rev 5379) @@ -447,6 +447,11 @@ case IDC_CHK_FT2VOLRAMP: text = _T("Use Fasttracker 2 style super soft volume ramping (recommended for true compatible playback)"); break; + case IDC_BUTTON1: + if(!GetDlgItem(IDC_BUTTON1)->IsWindowEnabled()) + { + text = _T("Tempo swing is only available in modern tempo mode."); + } } mpt::String::CopyN(pTTT->szText, text); @@ -1296,7 +1301,7 @@ SetDlgItemInt(IDC_EDIT1, m_groupSize); OnToggleGroup(); - OnHScroll(0, 0, nullptr); + OnHScroll(0, 0, reinterpret_cast<CScrollBar *>(&m_controls[0]->valueSlider)); rect.MoveToY(rect.top + m.paddingY); { CRect buttonRect; @@ -1360,7 +1365,7 @@ { m_controls[i]->valueSlider.SetPos(0); } - OnHScroll(0, 0, nullptr); + OnHScroll(0, 0, reinterpret_cast<CScrollBar *>(&m_controls[0]->valueSlider)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |