浏览代码

cmMidi.h : Added status tests cmMidiIsNoteOn(), cmMidiIsCtl(), etc.

master
kevin 10 年前
父节点
当前提交
ac62d77803
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6
    0
      cmMidi.h

+ 6
- 0
cmMidi.h 查看文件

@@ -82,6 +82,12 @@ extern "C" {
82 82
 #define cmMidiIsStatus( s )   (kNoteOffMdId <= (s) /*&& ((unsigned)(s)) <= kSysRtResetMdId*/ )
83 83
 #define cmMidiIsChStatus( s ) (kNoteOffMdId <= (s) && (s) <  kSysExMdId)
84 84
 
85
+#define cmMidiIsNoteOn( s )      ( kNoteOnMdId <= (s) && (s) <= (kNoteOnMdId + kMidiChCnt) )
86
+#define cmMidiIsNoteOff( s, d1 ) ( cmMidiIsNoteOn(s) && (d1)==0 || kNoteOffMdId <= (s) && (s) <= (kNoteOffMdId + kMidiChCnt) )
87
+#define cmMidiIsCtl( s )         ( kCtlMdId <= (s) && (s) <= (kCtlMdId + kMidiChCnt) )
88
+#define cmMidiIsSustainPedal(     s, d0 )    ( kCtlMdId <= (s) && (s) <= (kCtlMdId + kMidiChCnt) && (d0)== kSustainCtlMdId )
89
+#define cmMidiIsSustainPedalDown( s, d0, d1) ( cmMidiIsSustainPedal(s,d0) && (d1)>=64 )
90
+#define cmMidiIsSustainPedalUp(   s, d0, d1) ( cmMidiIsSustainPedal(s,d0) && (d1)<64 )
85 91
 
86 92
   const char*   cmMidiStatusToLabel(     cmMidiByte_t status );
87 93
   const char*   cmMidiMetaStatusToLabel( cmMidiByte_t metaStatus );

正在加载...
取消
保存