From: <sag...@us...> - 2014-03-09 00:47:35
|
Revision: 3849 http://sourceforge.net/p/modplug/code/3849 Author: saga-games Date: 2014-03-09 00:47:29 +0000 (Sun, 09 Mar 2014) Log Message: ----------- [Imp] Sample tab: Use midi note velocity when previewing samples. Modified Paths: -------------- trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/View_smp.h Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2014-03-08 18:23:52 UTC (rev 3848) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2014-03-09 00:47:29 UTC (rev 3849) @@ -2368,8 +2368,8 @@ } -void CViewSample::PlayNote(ModCommand::NOTE note, const SmpLength nStartPos) -//-------------------------------------------------------------------------- +void CViewSample::PlayNote(ModCommand::NOTE note, const SmpLength nStartPos, int volume) +//-------------------------------------------------------------------------------------- { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); CModDoc *pModDoc = GetDocument(); @@ -2392,7 +2392,7 @@ else if(m_nZoom < 0 && loopend - loopstart < 4) loopend = loopstart = 0; - noteChannel[note - NOTE_MIN] = pModDoc->PlayNote(note, 0, m_nSample, false, -1, loopstart, loopend, CHANNELINDEX_INVALID, nStartPos); + noteChannel[note - NOTE_MIN] = pModDoc->PlayNote(note, 0, m_nSample, false, volume, loopstart, loopend, CHANNELINDEX_INVALID, nStartPos); m_dwStatus.set(SMPSTATUS_KEYDOWN); @@ -2737,7 +2737,7 @@ const SmpLength nOldLength = sample.nLength; - if(MAX_SAMPLE_LENGTH - nOldLength < dlg.m_nSamples) + if(MAX_SAMPLE_LENGTH - nOldLength < dlg.m_nSamples && dlg.m_nEditOption != addsilence_resize) { CString str; str.Format(TEXT("Can't add silence because the new sample length would exceed maximum sample length %u."), MAX_SAMPLE_LENGTH); Reporting::Information(str); @@ -2823,8 +2823,7 @@ if(midibyte2 & 0x7F) { nVol = CMainFrame::ApplyVolumeRelatedSettings(dwMidiData, midivolume); - //pModDoc->PlayNote(nNote, 0, m_nSample, FALSE, nVol); - PlayNote(nNote); + PlayNote(nNote, 0, nVol); } break; Modified: trunk/OpenMPT/mptrack/View_smp.h =================================================================== --- trunk/OpenMPT/mptrack/View_smp.h 2014-03-08 18:23:52 UTC (rev 3848) +++ trunk/OpenMPT/mptrack/View_smp.h 2014-03-09 00:47:29 UTC (rev 3849) @@ -63,7 +63,7 @@ BOOL SetZoom(int nZoom, SmpLength centeredSample = SmpLength(-1)); int32 SampleToScreen(SmpLength pos) const; SmpLength ScreenToSample(int32 x) const; - void PlayNote(ModCommand::NOTE note, const SmpLength nStartPos = 0); + void PlayNote(ModCommand::NOTE note, const SmpLength nStartPos = 0, int volume = -1); void NoteOff(ModCommand::NOTE note); void InvalidateSample(); void SetCurSel(SmpLength nBegin, SmpLength nEnd); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |