DMXAddInput(3)

πŸ“¦
version 1.1.5 Β· 2 versions
, in epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– DMXAddInput β€” bestie, let's attach a new input πŸ’–

okay so this is a libdmx page, and the whole vibe is: you've got an Xdmx(1) server and you wanna bolt a new input onto it (or re-bolt one you took off earlier). These three functions do exactly that. No cap.


✨ NAME ✨

DMXAddInput, DMXAddBackendInput, DMXAddConsoleInput β€” attach a new input 🫢


🌸 SYNOPSIS 🌸

#include <X11/extensions/dmxext.h>

Bool DMXAddInput(Display *dpy,
                 unsigned int mask,
                 DMXInputAttributes *attr,
                 int *id);
Bool DMXAddBackendInput(Display *dpy,
                        int screen,
                        int sendsCore,
                        int *newId);
Bool DMXAddConsoleInput(Display *dpy,
                        const char *name,
                        int sendsCore,
                        int *newId);

πŸ¦‹ DESCRIPTION πŸ¦‹

So DMXAddInput() is the main character here β€” it attaches a new input (or a previously detached input, we love a comeback arc ✨) to the Xdmx(1) server.

  • mask tells you which fields inside attr are actually active (like, which ones we're paying attention to, bestie).
  • id returns the device id of the first device in the series</... wait no β€” the device id of the first device in the series that gets added. πŸ’…

The value of mask is computed from these values:

  • DMXInputType
  • DMXInputPhysicalScreen
  • DMXInputSendsCore

And here's the DMXInputAttributes structure, in all its glory:

typedef struct {
    DMXInputEnum inputType;
    int          physicalScreen;
    int          physicalId;
    Bool         isCore;
    Bool         sendsCore;
    const char   *name;
    Bool         detached;
} DMXInputAttributes;

inputType can be either DMXConsoleInputType or DMXBackendInputType β€” pick your fighter. 🌈

  • For console devices, name is the one that specifies the display to be used.
  • For back-end devices, physicalScreen specifies the Xdmx(1) screen number.

If sendsCore is True, the new device gets added as a true core device. Iconic.

If a device was removed earlier with DMXRemoveInput(3), then an attempt will be made to reconnect the previous devices β€” and heads up, sendsCore is ignored in that case. 😭


πŸŽ€ the helper functions πŸŽ€

DMXAddBackendInput() is a lil helper that's used to add input from a back-end server. With this one:

  • screen refers to the back-end screen
  • sendsCore is True if the new input should send core events (and it is ignored if the input has been detached)
  • newId will hold the device id of the first device in the series added

DMXAddConsoleInput() is the other helper, used to add input from a console. With this one:

  • name is the name of the console display
  • sendsCore is True if the new input should send core events (and it is ignored if the input has been detached)
  • newId will hold the device id of the first device in the series added

πŸ’… RETURN VALUE πŸ’…

DMXAddInput() returns True on success and False otherwise. That's it, that's the whole thing. ✨

DMXAddInput() can also generate these errors, and ngl you should know them:

  • BadValue β€” if inputType is invalid or physicalScreen is out of range
  • BadAccess β€” if the input has already been attached, or if the backend screen is currently detached

πŸ™ˆ NOTES πŸ™ˆ

  • Local devices cannot be attached or detached. Just not a thing, bestie. πŸ’€
  • Attributes that are not specified will default to 0. This may lead to unintended results β€” so like, actually specify your stuff, fr fr.
🫢 lowkey important: that default-to-zero thing is not a vibe. Set your fields.

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the page!! πŸ’– this was libdmx version 1.1.5, part of X Version 11, and the whole thing is dated the same way that footer always is. stay slay, go attach ur inputs, mwah πŸŽ€πŸ¦‹πŸŒΈ