AMaskEvent(3X)
NAME
AMaskEvent − get first matching event in audio event queue
SYNOPSIS
#include <Alib.h> void
AMaskEvent (
Audio ∗ audio,
AEventMask event_mask,
AEvent ∗ event_return,
long ∗ status_return);
DESCRIPTION
AMaskEvent() dequeues and returns the first event in the queue that matches the mask. If no match is found, this function blocks until a matching event is received. This behavior is unlike ACheckMaskEvent(), which does not block and returns FALSE immediately if a match is not 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.
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.
17 AEOutofMemory The Audio Library could not allocate space for the event.
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 contains an invalid value.
EXAMPLE
The following example sets the event mask to select errors and transaction started events, and sets up event_return to receive event data and status to receive status data.
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);
AMaskEvent(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
AMaskEvent() was developed by HP.
SEE ALSO
ACheckEvent(3X), ACheckMaskEvent(3X), AEventsQueued(3X), ANextEvent(3X), APeekEvent(3X), APutBackEvent(3X), AQlength(3X), ASelectInput(3X).
Hewlett-Packard Company — Audio Library: February, 1995