本文整理汇总了C++中Msg::Process方法的典型用法代码示例。如果您正苦于以下问题:C++ Msg::Process方法的具体用法?C++ Msg::Process怎么用?C++ Msg::Process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Msg
的用法示例。
在下文中一共展示了Msg::Process方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AudioThread
void DriverAlsa::AudioThread()
{
try
{
for (;;)
{
Msg* msg = iPipeline.Pull();
msg = msg->Process(*this);
if (msg != NULL)
{
msg->RemoveRef();
}
AutoMutex am(iMutex);
if (iQuit)
break;
}
}
catch (ThreadKill&) {}
}
示例2: AudioThread
void AudioDriver::AudioThread()
{
HANDLE mmcssHandle = NULL;
DWORD mmcssTaskIndex = 0;
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (hr != S_OK)
{
Log::Print("Unable to initialize COM in render thread: %x\n", hr);
return;
}
// Gain access to the system multimedia audio endpoint and associate an
// audio client object with it.
if (InitializeAudioClient() == false)
{
goto Exit;
}
// Hook up to the Multimedia Class Scheduler Service to prioritise
// our render activities.
mmcssHandle = AvSetMmThreadCharacteristics(L"Audio", &mmcssTaskIndex);
if (mmcssHandle == NULL)
{
Log::Print("Unable to enable MMCSS on render thread: %d\n",
GetLastError());
goto Exit;
}
// Native events waited on in this thread.
HANDLE waitArray[2] = {iAudioSessionDisconnectedEvent,
iAudioSamplesReadyEvent};
// Pipeline processing loop.
try {
for (;;) {
#ifdef _TIMINGS_DEBUG
LARGE_INTEGER StartingTime, EndingTime, ElapsedMicroseconds;
LARGE_INTEGER Frequency;
QueryPerformanceFrequency(&Frequency);
QueryPerformanceCounter(&StartingTime);
#endif /* _TIMINGS_DEBUG */
TUint32 padding = 0;
//
// Calculate the number of bytes in the render buffer
// for this period.
//
// This is the maximum we will pull from the pipeline.
//
// If the Audio Engine has not been initialized yet stick with
// the default value.
//
if (iAudioEngineInitialised && ! iAudioSessionDisconnected)
{
hr = iAudioClient->GetCurrentPadding(&padding);
if (hr == S_OK)
{
iRenderBytesThisPeriod = (iBufferSize - padding) *
iFrameSize;
}
else
{
Log::Print("ERROR: Couldn't read render buffer padding\n");
iRenderBytesThisPeriod = 0;
}
iRenderBytesRemaining = iRenderBytesThisPeriod;
}
//
// Process pipeline messages until we've reached the maximum for
// this period.
//
// The pull will block if there are no messages.
//
for(;;)
{
if (iPlayable != NULL) {
ProcessAudio(iPlayable);
}
else {
Msg* msg = iPipeline.Pull();
ASSERT(msg != NULL);
msg = msg->Process(*this);
ASSERT(msg == NULL);
}
//
// Have we reached the data limit for this period or been told
// to exit ?
//
if (iPlayable != NULL || iQuit)
{
break;
}
}
//.........这里部分代码省略.........