Pārlūkot izejas kodu

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

master
kevin 10 gadus atpakaļ
vecāks
revīzija
ac62d77803
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. 6
    0
      cmMidi.h

+ 6
- 0
cmMidi.h Parādīt failu

@@ -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 );

Notiek ielāde…
Atcelt
Saglabāt