]> icculus.org git repositories - btb/d2x.git/blob - arch/win32/include/hmpfile.h
added UDP support for win32
[btb/d2x.git] / arch / win32 / include / hmpfile.h
1 #ifndef _HMPFILE_H
2 #define _HMPFILE_H
3 #include <windows.h>
4 #include <mmsystem.h>
5
6 #define HMP_TRACKS 32
7 #define HMP_BUFFERS 4
8 #define HMP_BUFSIZE 1024
9
10 typedef struct event {
11         unsigned int delta;
12         unsigned char msg[3];
13         unsigned char *data;
14         unsigned int datalen;
15 } event;
16
17 typedef struct hmp_track {
18         unsigned char *data;
19         unsigned int len;
20         unsigned char *cur;
21         unsigned int left;
22         unsigned int cur_time;
23 } hmp_track;
24
25 typedef struct hmp_file {
26         int num_trks;
27         hmp_track trks[HMP_TRACKS];
28         unsigned int cur_time;
29         int tempo;
30         MIDIHDR *evbuf;
31     HMIDISTRM hmidi;
32         UINT devid;
33         unsigned char *pending;
34         unsigned int pending_size;
35         unsigned int pending_event;
36         int stop;               /* 1 -> don't send more data */
37         int bufs_in_mm; /* number of queued buffers */
38 } hmp_file;
39
40
41 #define HMP_INVALID_FILE -1
42 #define HMP_OUT_OF_MEM -2
43 #define HMP_MM_ERR -3
44 #define HMP_EOF 1
45
46 hmp_file *hmp_open(const char *filename);
47 int hmp_play(hmp_file *hmp);
48 void hmp_close(hmp_file *hmp);
49
50 #endif