AuMakeChangeStateAction(3)

✨ AuMakeChangeStateAction ✨

okay bestie, welcome to the Library Functions Manual entry for AuMakeChangeStateAction(3) β€” the little function that sets up an action for you πŸ’… this one's a macro, it's giving "I do one thing and I do it flawlessly", and we're gonna walk through it together 🫢


🌸 NAME 🌸

AuMakeChangeStateAction β€” initialize an action, bestie. that's it. that's the job. iconic


πŸŽ€ SYNOPSIS πŸŽ€

#include <audio/audiolib.h>

AuMakeChangeStateAction(action, trigger_state, trigger_prev_state,
trigger_reason, flow, element_num, new_state)
    AuElementAction action; /* RETURN */
    unsigned char trigger_state;
    unsigned char trigger_prev_state;
    unsigned char trigger_reason;
    AuFlowID flow;
    unsigned char element_num;
    unsigned char new_state;

like. look at that signature. seven whole arguments. she's thriving ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • action β€” this one's the RETURN, so she's the output 🎁 β€” she returns the initialized action. you hand her an AuElementAction and she fills her in.
  • trigger_state β€” specifies the state that triggers the action. no vibes-based guessing allowed, it must be one of these constants: AuStateStop, AuStateStart, AuStatePause, or AuStateAny. periodt.
  • trigger_prev_state β€” specifies the previous state for the trigger. again, must be one of: AuStateStop, AuStateStart, AuStatePause, or AuStateAny. the duality of states, we love to see it πŸ’œ
  • trigger_reason β€” specifies the reason for the action. must be one of these constants: AuReasonUser, AuReasonUnderrun, AuReasonOverrun, AuReasonEOF, AuReasonWatermark, AuReasonHardware, or AuReasonAny. seven options, so many reasons to be dramatic, lowkey obsessed 😭
  • flow β€” specifies the ID of the flow to affect. the flow. the main character. we're affecting her πŸ’–
  • element_num β€” specifies the index of the element to affect. yes bestie, the index, not the element itself. iykyk.
  • new_state β€” specifies the new state for the flow. and listen, it must be one of thses constants β€” okay the original literally says thses, i'm not fixing it, that's a typo and it's now part of the lore πŸ™ˆ β€” so: AuStateStop, AuStateStart, or AuStatePause. note there is no AuStateAny here. she has to pick a real state, no "any" cop-out. slay.

🌈 DESCRIPTION 🌈

so what does she actually do? AuMakeChangeStateAction sets the action field of action to AuElementActionChangeState β€” cute, on brand β€” and then initializes the other fields with the remaining arguments. that's the whole thing. no cap.

🧚 heads up bestie: AuMakeChangeStateAction is implemented as a macro. so don't come for her about function pointers, she's not that girl.

πŸ‘‘ SEE ALSO πŸ‘‘

  • AuMakeSendNotifyAction
  • AuMakeNoopAction
  • audiolib β€” Network Audio System C Language Interface

πŸ’« SIGN-OFF πŸ’«

and that's the whole page!! this came from the audiolib docs β€” action initialization, version 1.9.4 β€” shoutout to everyone who maintains this stuff, you're doing amazing sweetie πŸ’œ

go make some actions, bestie. you got this. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from