List of mixer callback functions


typedef struct snd_mixer_callbacks {
    void *private_data; /* should be used with an application */
    void (*rebuild) (void *private_data);
    void (*element) (void *private_data, int cmd,
                     snd_mixer_eid_t *eid);
    void (*group) (void *private_data, int cmd,
                   snd_mixer_gid_t *gid);
    void *reserved[28]; /* reserved for future use - must be NULL!!! */
} snd_mixer_callbacks_t;


The snd_mixer_callbacks_t structure defines a list of callbacks that you can provide to handle events read by snd_mixer_read(). The members include:

Note: Make sure that you zero-fill any members that you aren't interested in. You can zero-fill the entire snd_mixer_callbacks_t structure if you aren't interested in tracking any of these events. The wave.c example does this.

rebuild callback

The rebuild callback is called whenever the mixer is rebuilt. Its only argument is the private_data that you specified in this structure.

element callback

The element callback is called whenever an element event occurs. The arguments to this function are:

A pointer to the arbitrary data that you specified in this structure.
  • SND_MIXER_READ_ELEMENT_VALUE — the element's value changed.
  • SND_MIXER_READ_ELEMENT_CHANGE — the element changed (something other than its value).
  • SND_MIXER_READ_ELEMENT_ADD — the element was added (i.e., created).
  • SND_MIXER_READ_ELEMENT_REMOVE — the element was removed (i.e., destroyed).
  • SND_MIXER_READ_ELEMENT_ROUTE — the element's routing information changed.
A pointer to a snd_mixer_eid_t structure that holds the ID of the element affected by the event.

group callback

The group callback is called whenever a group event occurs. The arguments are:

A pointer to the arbitrary data that you specified in this structure.
A SND_MIXER_READ_GROUP_* event code:
  • SND_MIXER_READ_GROUP_VALUE — the group's value changed.
  • SND_MIXER_READ_GROUP_CHANGE — the group changed (something other than the value).
  • SND_MIXER_READ_GROUP_ADD — the group was added (i.e., created).
  • SND_MIXER_READ_GROUP_REMOVE — the group was removed (i.e., destroyed).
A pointer to a snd_mixer_gid_t structure that holds the ID of the group affected by the event.


QNX Neutrino