snd_ctl_callbacks_t

Control callback functions

Synopsis:

typedef struct snd_ctl_callbacks {
    void *private_data; /* should be used by an application */
    void (*rebuild) (void *private_data);
    void (*xswitch) (void *private_data, int cmd,
                     int iface, snd_switch_list_item_t *item);
    void (*audiomgmt) (snd_ctl_t *handle, void *private_data, int cmd);
    void (*afm) (void *private_data, int cmd, snd_ctrl_afm_event_t* event);
    void *reserved[27]; /* reserved for future use - must be NULL!!! */
} snd_ctl_callbacks_t;

Description:

Use the snd_ctl_callbacks_t structure to define the callback functions that you need to handle control events. Pass a pointer to an instance of this structure to snd_ctl_read().

The members of the snd_ctl_callbacks_t structure include:

Note: Make sure that you zero-fill any members that you aren't interested in. You can zero-fill the entire snd_ctl_callbacks_t structure if you aren't interested in tracking any of these events.

rebuild callback

The rebuild callback is called whenever the control device is rebuilt. The following is the only argument for the callback:
private_data
A pointer to the arbitrary data that you specified in this structure.

xswitch callback

The xswitch callback is called whenever a switch changes. The following are the arguments for this callback:
private_data
A pointer to the arbitrary data that you specified in this structure.
cmd
One of:
  • SND_CTL_READ_SWITCH_VALUE
  • SND_CTL_READ_SWITCH_CHANGE
  • SND_CTL_READ_SWITCH_ADD
  • SND_CTL_READ_SWITCH_REMOVE
iface
The device interface the switch is natively associated with. The possible values are:
  • SND_CTL_IFACE_CONTROL
  • SND_CTL_IFACE_MIXER
  • SND_CTL_IFACE_PCM_PLAYBACK
  • SND_CTL_IFACE_PCM_CAPTURE
item
A pointer to a snd_switch_list_item_t structure that identifies the specific switch that's been changed. This structure has only a name member.

audiomgmt callback

The audiomgmt callback is called whenever the list of audio types changes. Its arguments include the following:
handle
A handle to control device.
private_data
A pointer to the arbitrary data that you specified in this structure.
cmd
One of:
  • SND_CTL_READ_AUDIOMGMT_CHG (Deprecated)
  • SND_CTL_READ_AUDIOMGMT_STATUS_CHG

afm callback

The afm callback is called whenever there is an AFM event. Its arguments include the following:
private_data
A pointer to the arbitrary data that you specified in this structure.
cmd
The type of event. One of:
  • SND_CTL_READ_AFM_AUDIO_MODE
  • SND_CTL_READ_AFM_DATASET
  • SND_CTL_READ_AFM_DETECT
  • SND_CTL_READ_AFM_STATE
event
A pointer to a snd_ctrl_afm_event_t structure that provides details about the event.

Classification:

QNX Neutrino