AuElementNotifyEvent(3)
β¨ NAME β¨
okay so bestie, welcome to the AuElementNotifyEvent(3) page from the audiolib manual π β it's all about the element notify event structure. No cap, this is your guide to knowing when audio elements are like βhey, I got bytesβ or βhey, I changed state.β π
π STRUCTURES π
First, include this:
#include <audio/audiolib.h>
Then the union and the struct, exactly like this:
#include <audio/audiolib.h>
typedef union _AuEvent
{
. . .
AuElementNotifyEvent auelementnotify;
. . .
}AuEvent;
typedef struct _AuElementNotifyEvent
{
int type;
AuUint32 serial;
AuBool send_event;
AuServer *server;
AuTime time;
AuFlowID flow;
unsigned char element_num;
unsigned char kind;
unsigned char prev_state;
unsigned char cur_state;
unsigned char reason;
AuUint32 num_bytes;
}AuElementNotifyEvent;
So AuEvent is a union, and one of its members is AuElementNotifyEvent auelementnotify; β thatβs the one weβre obsessed with. π
π MEMBERS π
typeβ the event type, bestie. ElementNotify events are typeAuEventTypeElementNotify. πserialβ the serial ID of the event expanded from the 16 bit value sent by the server. π§send_eventβAuTrueif the event came from aSendEventprotocol request. β¨serverβ the connection to the audio server that the event was read from. π«Άtimeβ the server time in milliseconds when the event was generated. β°flowβ the ID of the flow that caused the event. πelement_numβ the index of the element that caused the event, orAuElementAllto indicate the flow. π―kindβ the kind of notify event. This will be one of these constants:AuElementNotifyKindLowWater,AuElementNotifyKindHighWater, orAuElementNotifyKindState. π₯prev_stateβ the previous state of the element indexed byelement_num. This will be one of these constants:AuStateStop,AuStateStart, orAuStatePause. π¦cur_stateβ the current state of the element indexed byelement_num. This will be one of these constants:AuStateStop,AuStateStart, orAuStatePause. πreasonβ the reason for the notify event. This will be one of these constants:AuReasonUser,AuReasonUnderrun,AuReasonOverrun,AuReasonEOF,AuReasonWatermark, orAuReasonHardware. πnum_bytesβ the number of bytes to send or receive. Only valid if the element indexed byelement_numis anImportClientorExportClient. π¦
π DESCRIPTION π
ElementNotify events are sent to client applications to notify them of a watermark condition or state change. Thatβs the whole vibe. π«
If kind is AuElementNotifyKindLowWater, the ImportClient element indexed by element_num in flow is ready to receive num_bytes of audio data from the client application. π§
If kind is AuElementNotifyKindHighWater, the ExportClient element indexed by element_num in flow is ready to send num_bytes of audio data to the client application. π€
If kind is AuElementNotifyKindState, the element indexed by element_num (or flow if element_num is AuElementAll) has made a state transition from prev_state to cur_state triggering the event. β¨
Reguardless of kind, prev_state and cur_state contain the old and new states, and reason contains the reason for the event. π
π SEE ALSO π
AuAnyEventAuErrorEventAuGrabNotifyEventAuMakeSendNotifyActionAuMonitorNotifyEventaudiolibβ Network Audio System C Language Interface
Mwah π this has been the AuElementNotifyEvent(3) page, from audiolib - events, version 1.9.4. The footer didnβt give a date, bestie π β so no date, just vibes, version 1.9.4, and the manual name AuElementNotifyEvent(3). Stay hydrated and check your watermarks. πβ¨
π¦ where this page comes from
- debian bookworm: libaudio-dev 1.9.4-7
- debian trixie: libaudio-dev 1.9.4-9
- ubuntu jammy: libaudio-dev 1.9.4-7build1
- ubuntu noble: libaudio-dev 1.9.4-8
- ubuntu questing: libaudio-dev 1.9.4-9
- ubuntu resolute: libaudio-dev 1.9.4-9.2
- ubuntu stonking: libaudio-dev 1.9.4-9.2
- copyright 1994 Steven King
- Copyright 1993 Network Computing Devices, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms