Create a new mixer switch
#include <audio_driver.h>
ado_dswitch_t *ado_mixer_switch_new
  ( ado_mixer_t *mixer,
    char *name,
    uint32_t type,
    uint32_t subtype,
    int32_t (*read) ( MIXER_CONTEXT_T *context,
                ado_dswitch_t *dswitch,
                snd_switch_t *cswitch,
                void *instance_data ),
    int32_t (*write) ( MIXER_CONTEXT_T *context,
                ado_dswitch_t *dswitch,
                snd_switch_t *cswitch,
                void *instance_data ),
    void *instance_data,
    void (*instance_free) (void *data) );
- 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 switch; one of:
  
- SND_SW_TYPE_BOOLEAN
    
  
 
- SND_SW_TYPE_BYTE
  
 
- SND_SW_TYPE_WORD
  
 
- SND_SW_TYPE_DWORD
  
 
- SND_SW_TYPE_LIST
  
 
 
- subtype
 
- The subtype of the switch; one of:
  
- SND_SW_SUBTYPE_DEC
    
  
 
- SND_SW_SUBTYPE_HEXA
  
 
 
- read()
 
- A callback that reads the state of the switch.
 
- write()
 
- A callback that writes the state of the switch.
 
- instance_data
 
- A pointer to any instance data that the read and
  write() callbacks might need.
  This can be a pointer to allocated memory, in which case you'll need to
  define the instance_free function.
 
- instance_free
 
- A function that must free any allocated instance data.
  It's called when the element is destroyed.
 
The ado_mixer_switch_new() function creates a new mixer switch.
  | 
A mixer switch isn't the same thing as a mixer switch element:
- Mixer switch element
 
- Used for things such as mutes and capture selects.
 
- Mixer switch
 
- Used less frequently, but still important to have available, e.g.
  PCM Loopback.
 
 
 | 
 
A pointer to the newly allocated switch.
QNX Neutrino
| Safety: |  | 
| Cancellation point | 
    No | 
| Interrupt handler | 
    No | 
| Signal handler | 
    No | 
| Thread | 
    No |