73 lines
1.1 KiB
C++
73 lines
1.1 KiB
C++
#ifndef _PUREVENT_HPP_
|
|
#define _PUREVENT_HPP_
|
|
#include <common/windows.hpp>
|
|
|
|
class PureEvent
|
|
{
|
|
public:
|
|
enum EventType{ReleaseNote=0x00,PlayNote=0x01,PitchWheel=0x02,Tempo=0x03,
|
|
ChangeController=0x04,UnknownOne=0x05,ScoreEnd=0x06,UnknownTwo=0x07};
|
|
PureEvent(void);
|
|
PureEvent(BYTE eventByte);
|
|
~PureEvent();
|
|
void setEvent(BYTE eventByte);
|
|
EventType eventType(void)const;
|
|
BYTE hasTimeInfo(void)const;
|
|
WORD channel(void)const;
|
|
void channel(WORD channel);
|
|
private:
|
|
EventType mEventType;
|
|
BYTE mHasTimeInfo;
|
|
WORD mChannel;
|
|
};
|
|
|
|
inline
|
|
PureEvent::PureEvent(void)
|
|
{
|
|
setEvent(0);
|
|
}
|
|
|
|
inline
|
|
PureEvent::PureEvent(BYTE eventByte)
|
|
{
|
|
setEvent(eventByte);
|
|
}
|
|
|
|
inline
|
|
PureEvent::~PureEvent()
|
|
{
|
|
}
|
|
|
|
inline
|
|
void PureEvent::setEvent(BYTE eventByte)
|
|
{
|
|
mHasTimeInfo=(eventByte>>7);
|
|
mEventType=(EventType)((eventByte>>4)&0x07);
|
|
mChannel=eventByte&0x0F;
|
|
}
|
|
|
|
inline
|
|
PureEvent::EventType PureEvent::eventType(void)const
|
|
{
|
|
return mEventType;
|
|
}
|
|
|
|
inline
|
|
BYTE PureEvent::hasTimeInfo(void)const
|
|
{
|
|
return mHasTimeInfo;
|
|
}
|
|
|
|
inline
|
|
WORD PureEvent::channel(void)const
|
|
{
|
|
return mChannel;
|
|
}
|
|
|
|
inline
|
|
void PureEvent::channel(WORD channel)
|
|
{
|
|
mChannel=channel;
|
|
}
|
|
#endif
|