forked from Wolf3s/glDoom
-
Notifications
You must be signed in to change notification settings - Fork 1
/
i_midi.h
76 lines (59 loc) · 2.18 KB
/
i_midi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef MIDIDEF
#define MIDIDEF 1
#include "doomtype.h"
typedef enum { midi_nofile, midi_stop, midi_play, midi_pause } midi_state;
typedef struct
{
DWORD MidiPosition;
DWORD MidiDevice;
DWORD MidiStatus;
MCIERROR MidiError;
char szMidiFile[128];
}MIDI_Data_t;
dboolean MidiPlay(HWND hWnd, MIDI_Data_t *mdd);
dboolean MidiReplay(HWND hWnd, MIDI_Data_t *mdd);
dboolean MidiPause(HWND hWnd, MIDI_Data_t *mdd);
dboolean MidiResume(HWND hWnd, MIDI_Data_t *mdd);
void MidiStop(MIDI_Data_t *mdd);
#endif
#ifndef QMUS2MID_H
#define QMUS2MID_H
#define NOTMUSFILE 1 /* Not a MUS file */
#define COMUSFILE 2 /* Can't open MUS file */
#define COTMPFILE 3 /* Can't open TMP file */
#define CWMIDFILE 4 /* Can't write MID file */
#define MUSFILECOR 5 /* MUS file corrupted */
#define TOOMCHAN 6 /* Too many channels */
#define MEMALLOC 7 /* Memory allocation error */
/* some (old) compilers mistake the "MUS\x1A" construct (interpreting
it as "MUSx1A") */
#define MUSMAGIC "MUS\032" /* this seems to work */
#define MIDIMAGIC "MThd\000\000\000\006\000\001"
#define TRACKMAGIC1 "\000\377\003\035"
#define TRACKMAGIC2 "\000\377\057\000"
#define TRACKMAGIC3 "\000\377\002\026"
#define TRACKMAGIC4 "\000\377\131\002\000\000"
#define TRACKMAGIC5 "\000\377\121\003\011\243\032"
#define TRACKMAGIC6 "\000\377\057\000"
typedef struct
{
char ID[4]; /* identifier "MUS" 0x1A */
unsigned short ScoreLength;
unsigned short ScoreStart;
unsigned short channels; /* count of primary channels */
unsigned short SecChannels; /* count of secondary channels (?) */
unsigned short InstrCnt;
unsigned short dummy;
/* variable-length part starts here */
unsigned short *instruments;
}MUSheader;
struct Track
{
unsigned int current;
unsigned char vel;
int DeltaTime;
unsigned char LastEvent;
char *data; /* Primary data */
};
int qmus2mid( const char *mid, int nodisplay, unsigned short division, int BufferSize, int nocomp );
#endif