AuSetDeviceAttributes(3)

✨ AuSetDeviceAttributes ✨

okay bestie, so this is a page from the Library Functions Manual for AuSetDeviceAttributes(3) β€” yes the whole name is giving very much "I have a long government name but you can call me by my function" πŸ’… and honestly? iconic.


🌸 Name 🌸

AuSetDeviceAttributes β€” set device attributes. that's it. that's the whole job. she sets the attributes. no cap. πŸŽ€


πŸ¦‹ Synopsis πŸ¦‹

#include <audio/audiolib.h>

void AuSetDeviceAttributes(server, device, valuemask, attributes, status)
    AuServer *server;
    AuDeviceID device;
    AuMask valuemask;
    AuDeviceAttributes *attributes;
    AuStatus *status; /* RETURN */

like, look at her. five arguments. a void return. absolutely no drama, all business. periodt. πŸ’–


πŸ’œ Arguments πŸ’œ

  • server β€” the connection to the audio server. your lil hotline to the server, basically. she needs to know who she's talking to fr fr.
  • device β€” the ID of the device. which one are we messing with? give her the ID, bestie. 🫢
  • valuemask β€” this one is the main character ngl. it says which values inside attributes are actually gonna get used. and listen β€” it must be a bitwise inclusive OR of one or more of these constants, no substitutes allowed:
    • AuCompCommonIDMask
    • AuCompCommonKindMask
    • AuCompCommonUseMask
    • AuCommonFormatMask
    • AuCommonNumTracksMask
    • AuCommonAccessMask
    • AuCommonDescriptionMask
    • AuCompDeviceGainMask
    • AuCompDeviceLineModeMask

pick at least one. OR them together. that's the vibe check. ✨

  • attributes β€” the structure where the values come from. and which values? only the ones valuemask pointed at. it's giving very "we only take what's on the list" energy. πŸŽ€
  • status β€” if this isn't NULL, she flushes the output buffer and returns the status straight from the server. if it is NULL? nothing comes back. your call, bestie. /* RETURN */ btw, in case the comment didn't already scream it. πŸ’…

πŸ’– Description πŸ’–

so AuSetDeviceAttributes sets the attributes of device, and the way it does that is only using the values in attributes that valuemask told her to use. surgical. selective. lowkey perfect. 🌸

⚠️ but here's the thing β€” if you try to change attributes that are not marked as changable, it will fail with a AuBadValue error. so like… don't do that. she will not be flexible about it. not even a little. 😭

πŸ’€ Errors πŸ’€

  • AuBadDevice
  • AuBadLength
  • AuBadValue

three ways to ruin her day. avoid them. πŸ™ˆ


🌈 See Also 🌈

  • AuGetDeviceAttributes β€” the other half of the duo. she sets, that one gets. balance. 🧚
  • audiolib β€” Network Audio System C Language Interface. the whole universe this function lives in. πŸ‘‘

and that's the page, bestie!! this one shipped as part of audiolib - device attributes, version 1.9.4, and she's filed under AuSetDeviceAttributes(3). go forth and set those attributes responsibly, mwah πŸ“πŸ’–βœ¨

πŸ“¦ where this page comes from