ado_mixer_element_volume1()

Create a volume (type 1) element

Synopsis:

#include <audio_driver.h>

ado_mixer_delement_t *ado_mixer_element_volume1
  ( ado_mixer_t *mixer,
    char *name,
    uint32_t number_of_voices,
    struct snd_mixer_element_volume1_range *ranges,
    ado_mixer_delement_control_volume1_t *control,
    void *instance_data,
    void (*instance_free) (void *data) );

Arguments:

mixer
A pointer to the ado_mixer_t structure that specifies the mixer to create the element in. This structure was created by ado_mixer_create().
name
The name of the element. Elements are referred to by name, so be careful; for some standard names, see <asound.h>.
number_of_voices
The number of individual gain controls belonging to the element.
ranges
The range of adjustment for each gain control. The snd_mixer_element_volume1_range structure is defined as:
typedef struct snd_mixer_element_volume1_range
{
	int32_t		min, max;
	int32_t		min_dB, max_dB;
	uint8_t	 	reserved[128];      /* must be filled with zero */
}		snd_mixer_element_volume1_range_t;
  
control
A callback function, of type ado_mixer_delement_control_volume1_t, that controls the gains of the analog signals passing through the element.

The prototype is:

int32_t control(
           MIXER_CONTEXT_T *context,
           ado_mixer_delement_t *element,
           uint8_t set,
           uint32_t *volumes,
           void *instance_data );
  
instance_data
A pointer to any instance data that you need to pass to the control callback. This can be a pointer to allocated memory, in which case you'll need to define the instance_free function.

If you need to access this instance data, you have to call ado_mixer_get_element_instance_data() because ado_mixer_delement_t is an opaque data type.

instance_free
A function that must free any allocated instance data. It's called when the element is destroyed.

Description:

The ado_mixer_element_volume1() convenience function automates the creation of a volume (type 1) element.

Returns:

A pointer to the newly allocated volume (type 1) element.

Classification:

QNX Neutrino

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

See also:

ado_mixer_element_vol_range_max(), ado_mixer_element_vol_range_min(), ado_mixer_get_element_instance_data()