Tabs to spaces, more consistent formatting.
[AROS.git] / workbench / libs / camd / midimsgtype2.c
blob51930c543a7aa5890c39616b3371e9a6cce77ef9
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
10 #include "camd_intern.h"
12 WORD MidiMsgType_status(UBYTE status){
13 switch(status&0xf0){
14 case 0xf0:
15 if(status>=0xf8) return CMB_RealTime;
16 if(status==0xf0) return CMB_SysEx;
17 return CMB_SysCom;
18 case 0x80:
19 case 0x90:
20 return CMB_Note;
21 case 0xa0:
22 return CMB_PolyPress;
23 case 0xb0:
24 return 0xff;
25 case 0xc0:
26 return CMB_Prog;
27 case 0xd0:
28 return CMB_ChanPress;
29 case 0xe0:
30 return CMB_PitchBend;
32 return 0xff; // Never reached. (hopefully)
35 WORD MidiMsgType_CMB_Ctrl(UBYTE data1){
36 if(data1<32) return CMB_CtrlMSB;
37 if(data1<64) return CMB_CtrlLSB;
38 if(data1<80) return CMB_CtrlSwitch;
39 if(data1<96) return CMB_CtrlByte;
40 if(data1<102) return CMB_CtrlParam;
41 if(data1<120) return CMB_CtrlUndef;
42 return CMB_Mode;
45 WORD MidiMsgType_status_data1(UBYTE status,UBYTE data1){
46 WORD ret=MidiMsgType_status(status);
47 if(ret==0xff){
48 return MidiMsgType_CMB_Ctrl(data1);
50 return ret;