1c72fcc34Sopenharmony_ci#ifndef MIXER_CONTROLS_H_INCLUDED 2c72fcc34Sopenharmony_ci#define MIXER_CONTROLS_H_INCLUDED 3c72fcc34Sopenharmony_ci 4c72fcc34Sopenharmony_ci#include <alsa/asoundlib.h> 5c72fcc34Sopenharmony_ci 6c72fcc34Sopenharmony_cistruct control { 7c72fcc34Sopenharmony_ci snd_mixer_elem_t *elem; 8c72fcc34Sopenharmony_ci char *name; 9c72fcc34Sopenharmony_ci unsigned int flags; 10c72fcc34Sopenharmony_ci#define TYPE_PVOLUME (1u << 4) 11c72fcc34Sopenharmony_ci#define TYPE_CVOLUME (1u << 5) 12c72fcc34Sopenharmony_ci#define TYPE_PSWITCH (1u << 6) 13c72fcc34Sopenharmony_ci#define TYPE_CSWITCH (1u << 7) 14c72fcc34Sopenharmony_ci#define TYPE_ENUM (1u << 8) 15c72fcc34Sopenharmony_ci#define HAS_VOLUME_0 (1u << 9) 16c72fcc34Sopenharmony_ci#define HAS_VOLUME_1 (1u << 10) 17c72fcc34Sopenharmony_ci#define HAS_PSWITCH_0 (1u << 11) 18c72fcc34Sopenharmony_ci#define HAS_PSWITCH_1 (1u << 12) 19c72fcc34Sopenharmony_ci#define HAS_CSWITCH_0 (1u << 13) 20c72fcc34Sopenharmony_ci#define HAS_CSWITCH_1 (1u << 14) 21c72fcc34Sopenharmony_ci#define IS_MULTICH (1u << 15) 22c72fcc34Sopenharmony_ci#define IS_ACTIVE (1u << 16) 23c72fcc34Sopenharmony_ci#define MULTICH_MASK (0x0000f) 24c72fcc34Sopenharmony_ci snd_mixer_selem_channel_id_t volume_channels[2]; 25c72fcc34Sopenharmony_ci snd_mixer_selem_channel_id_t pswitch_channels[2]; 26c72fcc34Sopenharmony_ci snd_mixer_selem_channel_id_t cswitch_channels[2]; 27c72fcc34Sopenharmony_ci unsigned int enum_channel_bits; 28c72fcc34Sopenharmony_ci}; 29c72fcc34Sopenharmony_ci 30c72fcc34Sopenharmony_ciextern struct control *controls; 31c72fcc34Sopenharmony_ciextern unsigned int controls_count; 32c72fcc34Sopenharmony_ci 33c72fcc34Sopenharmony_cibool are_there_any_controls(void); 34c72fcc34Sopenharmony_civoid create_controls(void); 35c72fcc34Sopenharmony_civoid free_controls(void); 36c72fcc34Sopenharmony_ci 37c72fcc34Sopenharmony_ci#endif 38