AuScanForTypedEvent(3)

πŸ’… AuScanForTypedEvent(3) β€” bestie edition

okay so this is a page from the Library Functions Manual, and today's main character is AuScanForTypedEvent β€” she's a libaudiolib girlie and she's here to find you the event. the one. the specific type. periodt. πŸ’–


✨ NAME ✨

AuScanForTypedEvent β€” return the first event of a specific type 🎯


🌸 SYNOPSIS 🌸

#include <audio/audiolib.h>

AuBool AuScanForTypedEvent(server, mode, dequeue, type, event)
    AuServer *server;
    int mode;
    AuBool dequeue;
    int type;
    AuEvent *event; /* RETURN */

like. she takes five things and gives you back an AuBool. we love a functional queen πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • server β€” the connection to the audio server, bestie. that's your line to the whole operation. 🫢
  • mode β€” how far you're willing to look for a match. it's gotta be one of these constants, no substitutions: AuEventsQueuedAlready, AuEventsQueuedAfterReading, or AuEventsQueuedAfterFlush. ✨
  • dequeue β€” if a matching event gets found, do we yank it out of the queue or not. yes or no, that's the whole vibe. πŸ’…
  • type β€” the type of event you're matching. it should be one of these constants: AuEventTypeElementNotify, AuEventTypeGrabNotify, or AuEventTypeMonitorNotify. pick your fighter. πŸ”₯
  • event β€” returns the matching event if found. that's the prize, the trophy, the return value moment. πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

okay so AuScanForTypedEvent scans the event queue looking for the first event that matches type. that's the whole job. that's her purpose. she's locked in. πŸ”

the mode is what decides how hard she's willing to look, and honestly the way that she escalates?? iconic. let's break it down:

  • if mode is AuEventsQueuedAlready, AuScanForTypedEvent only checks for events already in the queue. low effort, lowkey. she's just peeking. πŸ™ˆ
  • if mode is AuEventsQueuedAfterReading, and a matching event isn't found already in the queue, AuScanForTypedEvent attempts to read more events out of the application's connection. she goes and looks for it. main character energy fr fr. 🌈
  • if mode is AuEventsQueuedAfterFlush and a matching event isn't already in the queue or isn't waiting to be read, AuScanForTypedEvent flushes the output queue and attempts to read more events out of the application's connection. that's the full send. she flushes the output queue. she reads more. she does not give up. ⭐

and then: if dequeue is AuTrue, and a matching event is found, it is removed from the queue. gone. dequeued. she took it. πŸ’€


πŸ¦‹ SEE ALSO πŸ¦‹

  • AuEventsQueued
  • AuScanEvents
  • AuNextEvent
  • audiolib β€” Network Audio System C Language Interface

and that's the whole page, bestie. πŸ’– this is all from audiolib, section event handling, version 1.9.4 β€” go forth and find your event. slay. πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from