如何存储midi :: CShortMsg的消息? [英] How to Store the message of midi::CShortMsg?
本文介绍了如何存储midi :: CShortMsg的消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
void CDemoDlg::OnNoteOn(CPianoCtrl &PianoCtrl, unsigned char NoteId)
{
midi::CShortMsg ShortMsg(midi::NOTE_ON, 0, NoteId, 127, 0);
ShortMsg.SendMsg(m_OutDevice);/* How to store this ShortMsg in another variable what should be the type of variable*/
}
namespace midi{
.........
class CShortMsg : public CMIDIMsg
{......
void SendMsg(midi::CMIDIOutDevice &OutDevice);
.......
}
如何将这个ShortMsg存储在另一个变量中,变量的类型应该是什么?
How to store this ShortMsg in another variable what should be the type of variable?
Is it possible to store the message that we are sending to m_OutDevice?
推荐答案
您已经将其包含在变量中:ShortMsg
,它是该类的变量,是否可以存储我们要发送到m_OutDevice的消息?midi::CShortMsg
.也许您可以尝试改写您的问题.
You already have it in a variable:ShortMsg
, which is a variable of the classmidi::CShortMsg
. Perhaps you could try rephrasing your question.
midi :: CShortMsg没有默认的构造函数.因此,在您的结构中,您将需要对其进行初始化.
midi::CShortMsg doesn''t have a default constructor. So in your struct you''ll need to initialize it.
struct Records
{
midi::CShortMsg Message;
public:
Records(void);
Records(unsigned char Command, unsigned char Channel,
unsigned char Data1, unsigned char Data2, DWORD TimeStamp);
};
inline Records::Records(void)
: Message(midi::NOTE_ON, 0, NoteId, 127, 0)
{
}
inline Records::Records(unsigned char Command, unsigned char Channel,
unsigned char Data1, unsigned char Data2,
DWORD TimeStamp)
: Message(Command, Channel, Data1, Data2, TimeStamp)
{
}
这篇关于如何存储midi :: CShortMsg的消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文