本文整理汇总了C++中CEvent::Command方法的典型用法代码示例。如果您正苦于以下问题:C++ CEvent::Command方法的具体用法?C++ CEvent::Command怎么用?C++ CEvent::Command使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEvent
的用法示例。
在下文中一共展示了CEvent::Command方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
CPlaybackTaskGroup::FlushEvents()
{
LOCK_PLAYER;
// Pop all events off of the stack!
// But only execute the note-offs.
CEvent ev;
while (real.stack.Pop(ev))
{
if (ev.Command() == EvtType_NoteOff)
_executeEvent(ev, real);
}
while (metered.stack.Pop(ev))
{
if (ev.Command() == EvtType_NoteOff)
_executeEvent(ev, metered);
}
}
示例2: iter
void
CPlaybackTaskGroup::_flushNotes(
CEventStack &stack)
{
CEventStackIterator iter(stack);
for (;;)
{
CEvent *ev = iter.Current();
if (ev == NULL)
break;
if (ev->Command() == EvtType_NoteOff)
_executeEvent(*ev, real);
iter.Next();
}
}
示例3:
void
DualBendOffsetOp::operator()(
CEvent &ev,
TClockType clockType)
{
if (ev.Command() == EvtType_PitchBend)
{
if (ev.Duration() > 0)
{
ev.pitchBend.startBend =
(uint16)CLAMP(0, ((int16)ev.pitchBend.startBend) + delta,
0x3fff );
ev.pitchBend.targetBend =
(uint16)CLAMP(0, ((int16)ev.pitchBend.targetBend) + delta,
0x3fff);
}
else
{
ev.pitchBend.startBend = ev.pitchBend.targetBend =
(uint16)CLAMP(0, ((int16)ev.pitchBend.targetBend) + delta,
0x3fff );
}
}
}
示例4: message
void
CPlaybackTaskGroup::_executeEvent(
CEvent &ev,
TimeState &tState)
{
D_INTERNAL(("CPlaybackTaskGroup::_executeEvent(%s)\n",
ev.NameText()));
switch (ev.Command())
{
case EvtType_TaskMarker:
{
if (ev.task.taskPtr->flags & CPlaybackTask::Task_Finished)
{
delete ev.task.taskPtr;
if (tasks.Empty())
{
BMessage message(Player_ChangeTransportState);
be_app->PostMessage(&message);
}
}
else
{
ev.task.taskPtr->Play();
}
return;
}
case EvtType_Interpolate:
{
// I was originally supposed to have executed at ev.Start() + timeStep,
// but I may be a bit later than that -- take the difference into account.
// Here's how much time has elapsed since I was dispatched...
int32 elapsed = tState.time - ev.Start()
+ ev.interpolate.timeStep;
// If we went past the end, then clip the time.
if ((unsigned long)elapsed > ev.interpolate.duration)
elapsed = ev.interpolate.duration;
CDestination *dest = ev.common.destination;
if (dest != NULL)
{
if (dest->ReadLock(500))
{
dest->Interpolate(ev, tState.stack, system_time(),
elapsed);
dest->ReadUnlock();
}
}
return;
}
}
CDestination *dest = ev.common.destination;
if (dest != NULL)
{
if (dest->ReadLock(500))
{
dest->Execute(ev, system_time());
dest->ReadUnlock();
}
}
}