AuScanEvents(3)
β¨ AuScanEvents β¨ (from the audiolib library functions manual, bestie)
okay so picture this: you're drowning in audio events and you just want the ONE that matches your vibe check. that's AuScanEvents. she returns the first event that satisfies the predicate. periodt. π
πΈ SYNOPSIS πΈ
#include <audio/audiolib.h>
AuBool AuScanEvents(server, mode, dequeue, predicate, arg, event)
AuServer *server;
int mode;
AuBool dequeue;
AuBool (*predicate)(AuServer *,AuEvent *, AuPointer);
AuPointer arg;
AuEvent *event; /* RETURN */
π¦ ARGUMENTS π¦
serverβ the connection to the audio server. your whole lil link to the audio world fr fr.modeβ how far she's allowed to look for a match π. this needs to be one of these constants:AuEventsQueuedAlready,AuEventsQueuedAfterReading, orAuEventsQueuedAfterFlush.dequeueβ if a matching event gets found, should it be yeeted out of the queue? that's what this decides.predicateβ the procedure that gets called to figure out if an event matches the criteria. this is the vibe check, literally.argβ any extra arguments you wanna pass along to the predicate procedure. lil care package for your callback πeventβ returns the matching event if one gets found. the main character reveal π
π DESCRIPTION π
AuScanEvents scans the event queue looking for the first event that satisfies the caller-supplied predicate. she's on a mission and she will not be distracted.
here's the mode breakdown, bestie, listen up:
- if
modeisAuEventsQueuedAlready,AuScanEventsonly checks for events already in the queue. no extra effort, no reaching, she's just looking at what's right there π - if
modeisAuEventsQueuedAfterReading, and a matching event isn't found already in the queue,AuScanEventsattempts to read more events out of the application's connection. like okay, she'll go look a lil further for you π«Ά - if
modeisAuEventsQueuedAfterFlushand a matching event isn't already in the queue or isn't waiting to be read,AuScanEventsflushes the output queue and attempts to read more events out of the application's connection. she's doing the MOST and honestly? iconic.
and then: if dequeue is AuTrue, and a matching event is found, it is removed from the queue. gone. bye. not your problem anymore β¨
the predicate procedure is called with the arguments server, event, and arg and should return AuTrue to indicate a match. so like, AuTrue = "yes bestie this is the one", anything else = "not it, keep scrolling" π
π SEE ALSO π
AuEventsQueuedAuScanForTypedEventAuNextEventaudiolibβ Network Audio System C Language Interface
and that's the whole page, no cap!! this beauty lives in the audiolib - event handling docs, version 1.9.4, dated for AuScanEvents(3). go forth and scan those events, you absolute legend π§π
π¦ 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