当前位置: 首页>>代码示例>>C++>>正文


C++ CEvent::Command方法代码示例

本文整理汇总了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);
	}
}
开发者ID:HaikuArchives,项目名称:MeV,代码行数:19,代码来源:PlaybackTaskGroup.cpp

示例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();
	}
}
开发者ID:HaikuArchives,项目名称:MeV,代码行数:15,代码来源:PlaybackTaskGroup.cpp

示例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 );
		}
	}
}
开发者ID:HaikuArchives,项目名称:MeV,代码行数:24,代码来源:PitchBendEditor.cpp

示例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();
		}
	}
}
开发者ID:HaikuArchives,项目名称:MeV,代码行数:63,代码来源:PlaybackTaskGroup.cpp


注:本文中的CEvent::Command方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。