Initial
This commit is contained in:
51
midiwrt/MIDIPTCH.HPP
Normal file
51
midiwrt/MIDIPTCH.HPP
Normal file
@@ -0,0 +1,51 @@
|
||||
#ifndef _MIDIPITCH_HPP_
|
||||
#define _MIDIPITCH_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#include <common/fileio.hpp>
|
||||
|
||||
class MidiPitchBend
|
||||
{
|
||||
public:
|
||||
enum {PitchBendDataLength=2};
|
||||
MidiPitchBend(void);
|
||||
MidiPitchBend(BYTE musPitchBend);
|
||||
void setPitchBend(BYTE musPitchBend);
|
||||
operator BYTE*(void);
|
||||
private:
|
||||
void operator=(const MidiPitchBend &someMidiPitchBend);
|
||||
BYTE mlpMidiPitchBend[PitchBendDataLength];
|
||||
};
|
||||
|
||||
inline
|
||||
MidiPitchBend::MidiPitchBend(void)
|
||||
{
|
||||
setPitchBend(0);
|
||||
}
|
||||
|
||||
inline
|
||||
MidiPitchBend::MidiPitchBend(BYTE musPitchBend)
|
||||
{
|
||||
setPitchBend(musPitchBend);
|
||||
}
|
||||
|
||||
inline
|
||||
void MidiPitchBend::setPitchBend(BYTE musPitchBend)
|
||||
{
|
||||
WORD midiPitchBend(musPitchBend*64);
|
||||
|
||||
*(mlpMidiPitchBend)=(BYTE)(midiPitchBend&0x7F);
|
||||
*(mlpMidiPitchBend+1)=(BYTE)((midiPitchBend>>7)&0x7F);
|
||||
}
|
||||
|
||||
inline
|
||||
MidiPitchBend::operator BYTE*(void)
|
||||
{
|
||||
return mlpMidiPitchBend;
|
||||
}
|
||||
|
||||
inline
|
||||
void MidiPitchBend::operator=(const MidiPitchBend &someMidiPitchBend)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user