Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

ado_mixer_element_sw3()

Create a switch (type 3) element

Synopsis:

#include <audio_driver.h>

ado_mixer_delement_t *ado_mixer_element_sw3
  ( ado_mixer_t *mixer,
    char *name,
    uint32_t type,
    uint32_t number_of_voices,
    snd_mixer_voice_t *voices,
    ado_mixer_delement_control_sw3_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>.
type
The type of the switch; one of:
number_of_voices
The number of voices passing through the element.
voices
An array of snd_mixer_voice_t structures. Each entry describes one of the voices. For information about the snd_mixer_voice_t structure, see ado_mixer_element_io().
control
A callback function, of type ado_mixer_delement_control_sw3_t, that controls the routing of the signals.

The prototype is:

int32_t control(
           MIXER_CONTEXT_T *context,
           ado_mixer_delement_t *element,
           uint8_t set,
           uint32_t *bitmap,
           void *instance_data );
  
instance_data
A pointer to any instance data that the control callback might need. 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_sw3() convenience function automates the creation of a switch (type 3) element. A switch type 3 element represents a switch with one or more inputs and outputs that can be routed to each other.

Returns:

A pointer to the newly allocated switch (type 3) element.

Classification:

QNX Neutrino

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

See also:

ado_mixer_create(), ado_mixer_element_sw1(), ado_mixer_element_sw2(), ado_mixer_get_element_instance_data()