00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _NATIVE_MIDI_H_
00027 #define _NATIVE_MIDI_H_
00028
00029
00030 #if defined(_MSC_VER)
00031 #define WIN32_LEAN_AND_MEAN
00032 #include <windows.h>
00033 #include <windowsx.h>
00034 #include <mmsystem.h>
00035
00036 #pragma comment (lib, "winmm.lib")
00037
00038 #define MIDI_TRACKS 32
00039
00040 typedef unsigned char byte;
00041 typedef struct MIDI
00042 {
00043 int divisions;
00044 struct {
00045 unsigned char *data;
00046 int len;
00047 } track[MIDI_TRACKS];
00048 int loaded;
00049 } MIDI;
00050
00051 struct _NativeMidiSong {
00052 MIDI mididata;
00053 int MusicLoaded;
00054 int MusicPlaying;
00055 MIDIEVENT *MidiEvents[MIDI_TRACKS];
00056 MIDIHDR MidiStreamHdr;
00057 MIDIEVENT *NewEvents;
00058 int NewSize;
00059 int NewPos;
00060 int BytesRecorded[MIDI_TRACKS];
00061 int BufferSize[MIDI_TRACKS];
00062 int CurrentTrack;
00063 int CurrentPos;
00064 };
00065 #endif
00066
00067 typedef struct _NativeMidiSong NativeMidiSong;
00068
00069 int native_midi_init ();
00070 NativeMidiSong *native_midi_loadsong ( char *midifile );
00071 void native_midi_freesong ( NativeMidiSong *song );
00072 void native_midi_start ( NativeMidiSong *song );
00073 void native_midi_stop ();
00074 int native_midi_active ();
00075 void native_midi_setvolume( int volume);
00076 char *native_midi_error ();
00077
00078 #endif