浏览代码

cmTimeLine.c : durSmpCnt is now set for pedal up/down in _cmTlProcMidiFile().

master
kevin 10 年前
父节点
当前提交
e581d54cc0
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      app/cmTimeLine.c

+ 4
- 1
app/cmTimeLine.c 查看文件

@@ -668,12 +668,15 @@ cmTlRC_t _cmTlProcMidiFile( _cmTl_t* p,  _cmTlObj_t* op, cmMidiFileH_t mfH )
668 668
     //  printf("%s: bsi:%9i acc:%f smp acc:%f min %s\n", mp->status == kNoteOnMdId?"non":"   ", begSmpIdx, accum, accum / (p->srate * 60),cmStringNullGuard(mfp->obj.name));
669 669
 
670 670
     // count the note-on messages
671
-    if( mp->status == kNoteOnMdId )
671
+    if( cmMidiIsNoteOn(mp->status) )
672 672
     {
673 673
       durSmpCnt = mp->u.chMsgPtr->durTicks;
674 674
       ++mfp->noteOnCnt;
675 675
     }
676 676
 
677
+    if( cmMidiIsCtl(mp->status) && cmMidiIsSustainPedal(mp->status,mp->u.chMsgPtr->d0) )
678
+      durSmpCnt = mp->u.chMsgPtr->durTicks;
679
+
677 680
     // allocate the generic time-line object record
678 681
     if((rc = _cmTlAllocRecd2(p, NULL, refOp, begSmpIdx, durSmpCnt, kMidiEvtTlId, mfp->obj.seqId, recdByteCnt, &meop)) != kOkTlRC )
679 682
       goto errLabel;

正在加载...
取消
保存