the useless commit: add copyright messages to all(?) files that need it
[ardour.git] / libs / midi++2 / midi++ / types.h
1 /*
2     Copyright (C) 2000-2007 Paul Davis 
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __midi_types_h__
21 #define __midi_types_h__
22
23 namespace MIDI {
24
25         typedef char           channel_t;
26         typedef float controller_value_t;
27         typedef unsigned char  byte;
28         typedef unsigned short pitchbend_t;
29
30         enum eventType {
31             none = 0x0,
32             raw = 0xF4, /* undefined in MIDI spec */
33             any = 0xF5, /* undefined in MIDI spec */
34             off = 0x80,
35             on = 0x90,
36             controller = 0xB0,
37             program = 0xC0,
38             chanpress = 0xD0,
39             polypress = 0xA0,
40             pitchbend = 0xE0,
41             sysex = 0xF0,
42             mtc_quarter = 0xF1,
43             position = 0xF2,
44             song = 0xF3,
45             tune = 0xF6,
46             eox = 0xF7,
47             timing = 0xF8,
48             start = 0xFA,
49             contineu = 0xFB, /* note spelling */
50             stop = 0xFC,
51             active = 0xFE,
52             reset = 0xFF
53     };
54
55     extern const char *controller_names[];
56         byte decode_controller_name (const char *name);
57
58     struct EventTwoBytes {
59         union {
60             byte note_number;
61             byte controller_number;
62         };
63         union {
64             byte velocity;
65             byte value;
66         };
67     };
68
69     enum MTC_FPS {
70             MTC_24_FPS = 0,
71             MTC_25_FPS = 1,
72             MTC_30_FPS_DROP = 2,
73             MTC_30_FPS = 3
74     };
75
76     enum MTC_Status {
77             MTC_Stopped = 0,
78             MTC_Forward,
79             MTC_Backward
80     };
81
82 } // namespace MIDI
83
84 #endif // __midi_types_h__
85
86
87
88