AudRecordLib
Typedefs | Functions
messages.cpp File Reference

Implements the message processing functions for AudRecord's sampling thread. More...

#include "stdafx.h"
#include "messages.h"
#include <mmdeviceapi.h>
#include <audioclient.h>

Typedefs

typedef void DispatchFunction (PVOID pParam)

Functions

 C_ASSERT (ARRAYSIZE(g_dispatchFns)==(LAST_THREAD_MESSAGE-FIRST_THREAD_MESSAGE))
BOOL SendThreadMessage (DWORD threadId, UINT msg, PVOID pParam)
void ActOnMessage (const MSG &msg)

Detailed Description

Implements the message processing functions for AudRecord's sampling thread.


Typedef Documentation

typedef void DispatchFunction(PVOID pParam)

The type of all functions which are called in response to messages


Function Documentation

void ActOnMessage ( const MSG &  msg)

Responds to a thread message by calling the appropriate callback and then signals the event to enable the calling thread to continue.

If the message is a standard Windows message, Translate/DispatchMessage are called instead and no event is set

Parameters:
msgThe message to act on
BOOL SendThreadMessage ( DWORD  threadId,
UINT  msg,
PVOID  pParam 
)

A blocking equivalent of PostThreadMessage

Creates a Windows event, posts the message to thread using PostThreadMessage and waits for the event to be signalled by the processing thread. If the message is out of the range delimited by the ThreadMessage enumeration the function fails trivially.

Parameters:
threadIdThread to send the message to
msgMessage id to send
pParamAdditional message data
Returns:
Nonzero if the message was processed, zero if it wasn't
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Defines