FreeWRL / FreeX3D 4.3.0
libmidi.h
1
2typedef struct icset { int p; int d; int ld; int n; int s; int ls; } icset;
3typedef struct ivec3 { int x; int y; int z; } ivec3;
4struct X3D_MidiRep {
5 int itype; //==8, 0 PointRep 1 LineRep 2 PolyRep 3 MeshRep 4 TextureRep 5 LightRep 6 ProjectorRep 7 SoundRep 8 MidiRep
6 int icontext; //map audio_contexts[icontext] = libmidi context
7 int inode; //map nodes[inode] = libmidi node
8 unsigned int iframe; //last frame visited on scenegraph traversal
9 int ibuffer; //just for source nodes with a buffer, like MIDIFileSource
10 void* connections;
11 int last_indexSource[10];
12 int last_indexDestination[10];
13 int last_count;
14};
15typedef unsigned char ubyte;
16
17//MIDI 2 64 bit packet, a few ways to slice it
18typedef union {
19 double packet;
20 unsigned int u32[2];
21 unsigned short u16[4];
22 unsigned char bytes[8];
23} UMP;
24typedef struct timedpacket {
25 double packet;
26 double timestamp;
28int MIDITransport();
29#define MIDI_UMP 2
30#define MIDI_MSG 1
31enum message_type
32{
33 INVALID = 0x0,
34 // Standard Message
35 NOTE_OFF = 0x80,
36 NOTE_ON = 0x90,
37 POLY_PRESSURE = 0xA0,
38 CONTROL_CHANGE = 0xB0,
39 PROGRAM_CHANGE = 0xC0,
40 AFTERTOUCH = 0xD0, //aka CHANNEL_PRESSURE
41 CHANNEL_PRESSURE = 0xD0, //aka AFTERTOUCH
42 PITCH_BEND = 0xE0,
43
44 // System Common Messages
45 SYSTEM_EXCLUSIVE = 0xF0,
46 TIME_CODE = 0xF1,
47 SONG_POS_POINTER = 0xF2,
48 SONG_SELECT = 0xF3,
49 RESERVED1 = 0xF4,
50 RESERVED2 = 0xF5,
51 TUNE_REQUEST = 0xF6,
52 EOX = 0xF7,
53
54 // System Realtime Messages
55 TIME_CLOCK = 0xF8,
56 RESERVED3 = 0xF9,
57 START = 0xFA,
58 CONTINUE = 0xFB,
59 STOP = 0xFC,
60 RESERVED4 = 0xFD,
61 ACTIVE_SENSING = 0xFE,
62 SYSTEM_RESET = 0xFF
63};
64
65/*
66#if !defined(_WIN32)
67#define EXPORT_DLL
68#elif !defined(EXPORT_DLL)
69#if defined(_LIB)
70#define EXPORT_DLL
71#elif defined(_USRDLL)
72#define EXPORT_DLL __declspec(dllexport)
73#else
74#define EXPORT_DLL __declspec(dllimport)
75#endif
76#endif // _WIN32 && EXPORT_DLL
77*/
78#define EXPORT_DLL //UN-DEFINE IT, WE AREN'T USING A LIB AT ALL
79
80EXPORT_DLL extern int libmidi_createContext0();
81EXPORT_DLL extern void libmidi_updateNode3(int icontext, icset connect_parent, struct X3D_Node* node);
82EXPORT_DLL extern void libmidi_pauseContext0(int icontext);
83EXPORT_DLL extern void libmidi_resumeContext0(int icontext);
84EXPORT_DLL extern void libmidi_print_connections();
85EXPORT_DLL extern void libmidi_connect(int icontext, icset iparent);
86EXPORT_DLL extern void libmidi_disconnect(int icontext, icset iparent);
87
88
89 // int libmidi_createContext0();
90 //void libmidi_pauseContext0(int icontext);
91 //void libmidi_resumeContext0(int icontext);
92 //void libmidi_print_connections();
93 //void libmidi_connect(int icontext, icset iparent);
94 //void libmidi_disconnect(int icontext, icset iparent);
95
96//extern int libmidi_createContext0();
Definition libmidi.h:3
Definition libmidi.h:18