Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #pragma once
00015 #include "coreexp.h"
00016 #include <WTypes.h>
00017 #include <mmsystem.h>
00018 #include <mmreg.h>
00019
00020
00021
00022
00023 typedef DWORD(*MIDI_IN_PROC)(HMIDIIN hMidiIn,UINT wMsg, DWORD dwInstance,DWORD dwParam1, DWORD dwParam2);
00024
00025
00026 #define MIDIPROC_PROCESSED 1 // The message was processed and so no other callbacks should be called.
00027 #define MIDIPROC_NOTPROCESSED 0 // The message was not processed.
00028
00029
00030
00031
00032 CoreExport MMRESULT MIDIMan_Open(MIDI_IN_PROC proc,DWORD dwInstance,int priority=0);
00033 CoreExport MMRESULT MIDIMan_Close(MIDI_IN_PROC proc,DWORD dwInstance);
00034 CoreExport MMRESULT MIDIMan_Start();
00035 CoreExport MMRESULT MIDIMan_Stop();
00036 CoreExport BOOL MIDIMan_IsOpened();
00037 CoreExport BOOL MIDIMan_IsStarted();
00038
00039
00040
00041 CoreExport void MIDIMan_Suspend();
00042 CoreExport void MIDIMan_Resume();
00043
00044
00045 #define MIDI_CHANNEL(a) ((a)&0x0f)
00046 #define MIDI_EVENT(a) ((a)&0xf0)
00047 #define MIDI_NOTENUMBER(a) (((a)&0xff00)>>8)
00048 #define MIDI_VELOCITY(a) (((a)&0xff0000)>>16)
00049 #define MIDI_PITCHBEND(a) (((a)&0xff0000)>>16)
00050 #define MIDI_NOTEFLOAT(a,low,high) (float((a)-(low))/float((high)-(low)))
00051 #define MIDI_VELFLOAT(a) (float(a)/127.0f)
00052 #define MIDI_BENDFLOAT(a) (float(a)/127.0f)
00053
00054
00055 #define MIDI_NOTE_ON 0x90
00056 #define MIDI_NOTE_OFF 0x80
00057 #define MIDI_PITCH_BEND 0xe0
00058 #define MIDI_CONTROLCHANGE 0xb0
00059
00060
00061