AuElementNotifyEvent(3)

๐Ÿ“ฆ version 1.9.5, in fedora 43, fedora 44

โœจ AuElementNotifyEvent(3) โœจ

okay bestie, welcome to the Library Functions Manual corner of the group chat ๐Ÿ’– This page is all about AuElementNotifyEvent, the element notify event structure. It's giving "the audio server is texting your app" energy, and we're gonna read every single field together. No skipping, periodt ๐Ÿซถ


๐ŸŒธ Name ๐ŸŒธ

AuElementNotifyEvent โ€” element notify event structure. That's the whole name tea. โœจ

๐Ÿงš Structures ๐Ÿงš

Here's the C shape of it, exactly as the page lays it out:

       #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;

๐Ÿ‘‘ Members ๐Ÿ‘‘

  • type โ€” the event type. ElementNotify events are type AuEventTypeElementNotify. That's the event's whole genre. โœจ
  • serial โ€” the serial ID of the event, expanded from the 16 bit value sent by the server. It's the event's lil ID number ๐Ÿ’…
  • send_event โ€” AuTrue if the event came from a SendEvent protocol request. So if it's a send event, it says true. ๐Ÿ‘€
  • server โ€” the connection to the audio server that the event was read from. The server link, the source, the plug. ๐Ÿ”Œ
  • time โ€” the server time in milliseconds when the event was generated. Timestamped, no cap. โฐ
  • flow โ€” the ID of the flow that caused the event. The flow is the main character here. ๐ŸŒŠ
  • element_num โ€” the index of the element that caused the event, or AuElementAll to indicate the flow. So either one specific element or the whole flow vibe. ๐Ÿ’ซ
  • kind โ€” the kind of notify event. This will be one of these constants: AuElementNotifyKindLowWater, AuElementNotifyKindHighWater, or AuElementNotifyKindState. Pick your fighter. ๐ŸŽ€
  • prev_state โ€” the previous state of the element indexed by element_num. This will be one of these constants: AuStateStop, AuStateStart, or AuStatePause. The before pic. ๐Ÿ“ธ
  • cur_state โ€” the current state of the element indexed by element_num. This will be one of these constants: AuStateStop, AuStateStart, or AuStatePause. The after pic. โœจ
  • reason โ€” the reason for the notify event. This will be one of these constants: AuReasonUser, AuReasonUnderrun, AuReasonOverrun, AuReasonEOF, AuReasonWatermark, or AuReasonHardware. The why, the tea. โ˜•
  • num_bytes โ€” the number of bytes to send or receive. Only valid if the element indexed by element_num is an ImportClient or ExportClient. Byte count only when it's one of those two, bestie. ๐Ÿงฎ

๐Ÿฆ‹ Description ๐Ÿฆ‹

ElementNotify events are sent to client applications to notify them of a watermark condition or state change. That's the whole point, bestie ๐Ÿ’–

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. Low water = ready to receive, periodt. ๐ŸŒŠ

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. High water = ready to send, slay. โœจ

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. State change, main character energy. ๐Ÿ‘‘

Reguardless of kind โ€” yes, that's the spelling on the page, iconic ๐Ÿ˜ญ โ€” prev_state and cur_state contain the old and new states, and reason contains the reason for the event. Every time, no exceptions. ๐Ÿ’…

๐ŸŒˆ See Also ๐ŸŒˆ

  • AuAnyEvent
  • AuErrorEvent
  • AuGrabNotifyEvent
  • AuMakeSendNotifyAction
  • AuMonitorNotifyEvent

Also: audiolib โ€” Network Audio System C Language Interface. That's the whole family, go read them. ๐Ÿ“š


And that's the page, bestie! The footer vibe is audiolib - events, version 1.9.5, AuElementNotifyEvent(3). Mwah ๐Ÿ’‹โœจ

๐Ÿ“ฆ where this page comes from