home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Large Pack of OldSkool DOS MOD Trackers
/
beaversweeper_v101.zip
/
src
/
MIDIReceptor.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2003-01-06
|
809b
|
47 lines
#include "stdafx.h"
#include <mmsystem.h>
#include "MIDIReceptor.h"
MIDIReceptor::MIDIReceptor()
{
}
MIDIReceptor::~MIDIReceptor()
{
}
void MIDIReceptor::FilterMidiMsg( UINT message, WPARAM wParam, LPARAM lParam )
{
if (message == MM_MIM_DATA) {
unsigned char param1 = lParam & 0xff;
unsigned char param2 = (lParam>>8) & 0xff;
unsigned char param3 = (lParam>>16) & 0xff;
if( ((param1&0xF0)==0x90 && param3==0x00) || (param1&0xF0)==0x80 ) {
// Note OFF
OnMIDIKeyUp( param2 - 36, param3 << 1 );
} else
if( (param1&0xF0)==0x90) {
// Note ON
OnMIDIKeyDown( param2 - 36, param3 << 1 );
}
}
}
void MIDIReceptor::OnMIDIKeyDown( UINT key, UINT velocity )
{
}
void MIDIReceptor::OnMIDIKeyUp( UINT key, UINT velocity )
{
}