ACheckMaskEvent(3X)
NAME
ACheckMaskEvent − get first event in audio event queue that matches mask
SYNOPSIS
#include <Alib.h> Bool
ACheckMaskEvent (
Audio ∗ audio,
AEventMask event_mask,
AEvent ∗ event_return,
long ∗ status_return );
DESCRIPTION
ACheckMaskEvent() dequeues and returns the first event in the queue that matches the mask and returns TRUE. If no match is found, the function returns FALSE immediately. Unlike AMaskEvent(), it does not block if no match is found.
audio is the Audio structure associated with this connection.
event_mask is the mask specifying what type(s) of event to look for. The mask is the bitwise inclusive OR of one or more of the mask values listed in the Structures section.
event_return receives the first event found in the queue.
status_return receives the returned status of the operation, unless this parameter is passed in as a NULL pointer. If status_return is set to NULL, Alib will do the error handling.
RETURN VALUE
Upon successful completion, ACheckMaskEvent() returns TRUE or FALSE.
STRUCTURES
The following are defined in /opt/audio/include/Alib.h.
typedef long AEventMask;
#define ANoEventMask 0
#define AErrorMask ( 1 << AETError )
#define AConnectMask ( 1 << AETConnect )
#define ATransStatusMask ( 1 << AETTransStatus )
#define ATransStartedMask ( 1 << AETTransStarted )
#define ATransCompletedMask ( 1 << AETTransCompleted )
#define ATransStoppedMask ( 1 << AETTransStopped )
#define ATransPausedMask ( 1 << AETTransPaused )
#define ATransResumedMask ( 1 << AETTransResumed )
#define ATransPreemptedMask ( 1 << AETTransPreempted )
#define ALoopStartedMask ( 1 << AETLoopStarted )
#define ALoopStoppedMask ( 1 << AETLoopStopped )
#define ARecordMonitorMask ( 1 << AETRecordMonitor )
#define APlayMonitorMask ( 1 << AETPlayMonitor )
#define ARecordDataMask ( 1 << AETRecordData )
#define ADataNeededMask ( 1 << AETDataNeeded )
#define ADataAvailableMask ( 1 << AETDataAvailable )
#define AGetDataMask ( 1 << AETGetData )
#define ADisconnectMask ( 1 << AETDisconnect )
#define AStereoRecordMonitorMask ( 1 << AETStereoRecordMonitor )
#define AStereoPlayMonitorMask ( 1 << AETStereoPlayMonitor )
#define AHookStateChangedMask ( 1 << AETHookStateChanged )
#define AMediaModeChangedMask ( 1 << AETMediaModeChanged )
#define ADTMFDetectedMask ( 1 << AETDTMFDetected )
#define AIncomingRingDetectedMask ( 1 << AETIncomingRingDetected )
#define AIncomingRingEndedMask ( 1 << AETIncomingRingEnded )
#define AOutgoingRingDetectedMask ( 1 << AETOutgoingRingDetected )
#define ACallerIDReceivedMask ( 1 << AETCallerIDReceived )
#define ALineStateChangedMask ( 1 << AETLineStateChanged )
ERRORS
If status_return is not set to NULL, it can return one of the following values:
0 AENoError No error - the call completed successfully.
2 AEBadAudio The audio structure is invalid. A pointer to a valid audio structure may be missing (use AOpenAudio() to get a valid pointer).
3 AEBadValue The event_mask parameter contains in incorrect value.
17 AEOutofMemory The Audio Library could not allocate space for the event.
EXAMPLE
The following example sets the event mask to check for errors and transaction started events, and sets up event_return to receive event data and status to receive status data.
Boolean first_match; /∗ match found∗/
Audio ∗ audio; /∗ audio connection ∗/
AEventMask emask; /∗ event mask ∗/
AEvent event_return; /∗ event return∗/
long status; /∗ error status ∗/
.
.
.
/∗ check event queue for mask match ∗/
emask = (AErrorMask | ATransStartedMask);
first_match = ACheckEventMask(audio, emask, &event_return, &status);
NOTE
In order to ensure that the compiler finds the Audio Library (libAlib.sl) and the Alib.h header file, you must add the following switches:
-L /opt/audio/lib
-I/opt/audio/include
DEPENDENCIES
This function belongs to the Audio Library of functions that manage connections to an audio server. The audio server must run on a system that has audio hardware. To find out whether or not your system has audio hardware, refer to Using the Audio Developer’s Kit or the online help for the Audio control panel. For information about the audio capabilities of a particular system use the online example audioinfo.c.
AUTHOR
ACheckMaskEvent() was developed by HP.
SEE ALSO
ACheckEvent(3X), AEventsQueued(3X), AMaskEvent(3X), ANextEvent(3X), APeekEvent(3X), APutBackEvent(3X), AQlength(3X), ASelectInput(3X).
Hewlett-Packard Company — Audio Library: February, 1995