snd_ctl_set_filter()

Set the control events filter

Synopsis:

#include <sys/asoundlib.h>

int snd_ctl_set_filter( snd_ctl_t *handle, snd_ctl_filter_t * filter );

Arguments:

handle
The handle for the control connection to the card. This must be a handle created by snd_ctl_open().
filter
A filter that specifies which control events io-audio sends to the client application.

Library:

libasound.so

Use the -l asound option with qcc to link against this library.

Description:

The snd_ctl_set_filter() function sets the control event filter using a snd_ctl_filter_t structure:

typedef struct snd_ctl_filter {
    uint32_t enable;
    uint8_t  reserved[124];
} snd_ctl_filter_t;

This structure includes the following members:

enable
A bitfield that represents a control event type. Use the SND_CTL_EVENT_MASK() macro to translate one of the following control event types to the filter bitmask:
  • SND_CTL_READ_REBUILD
  • SND_CTL_READ_SWITCH_VALUE
  • SND_CTL_READ_SWITCH_ADD
  • SND_CTL_READ_SWITCH_REMOVE
  • SND_CTL_READ_AFM_STATE
  • SND_CTL_READ_AFM_AUDIO_MODE
  • SND_CTL_READ_AFM_DATASET
  • SND_CTL_READ_AFM_DETECT
  • SND_CTL_READ_AUDIOMGMT_STATUS_CHG
reserved
Must be filled with 0 (zero).

Returns:

Zero on success, or a negative value on error.

Errors:

-EINVAL
Invalid handle argument or pointer to filter is NULL.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes