[Previous] [Contents] [Next]

snd_mixer_group_read()

Read the snd_mixer_group_t structure

Synopsis:

#include <sys/asoundlib.h>

int snd_mixer_group_read( snd_mixer_t * handle, 
                          snd_mixer_group_t * group );

Library:

libasound.so

Description:

The snd_mixer_group_read() function reads the snd_mixer_group_t structure for the group identified by the gid substructure.

This structure contains the volume levels and mutes associated with the group:

typedef struct snd_mixer_group_s
{
    snd_mixer_gid_t gid;
    uint32_tcaps;
    uint32_tchannels;
    int32_tmin, max;
    union
    {
        int32_tvalues[32];
        struct
        {
            int32_t    front_left;
            int32_t    front_right;
            int32_t    front_center;
            int32_t    rear_left;
            int32_t    rear_right;
            int32_t    woofer;
            uint8_t    reserved[128];
        }          names;
    }        volume;
    uint32_t        mute;
    uint32_t        capture;
    int32_t         capture_group;

    int32_t         elements_size, elements, elements_over;
    snd_mixer_eid_t *pelements;
    void        *pzero;             /* align pointers on 64-bits --> point to NULL */
    uint8_t     reserved[128];      /* must be filled with zero */
}       snd_mixer_group_t;

Returns:

Zero on success, or a negative error value on error.

Errors:

-EINVAL
Invalid handle argument.
-ENXIO
The group wasn't found.

Examples:

See the example in Registering your application in the Controlling volume and balance chapter.

Classification:

ALSA

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

Caveats:

The group struct may be initialized to a known state before making the call: use memset() to set the struct to zero, and then set the gid substructure.

See also:

snd_mixer_group_write(), snd_mixer_groups()


[Previous] [Contents] [Next]