diff options
Diffstat (limited to 'src/modules/alsa/alsa-mixer.h')
-rw-r--r-- | src/modules/alsa/alsa-mixer.h | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/src/modules/alsa/alsa-mixer.h b/src/modules/alsa/alsa-mixer.h index 7fb408a6..c24a8965 100644 --- a/src/modules/alsa/alsa-mixer.h +++ b/src/modules/alsa/alsa-mixer.h @@ -46,6 +46,7 @@ typedef struct pa_alsa_path pa_alsa_path; typedef struct pa_alsa_path_set pa_alsa_path_set; typedef struct pa_alsa_mapping pa_alsa_mapping; typedef struct pa_alsa_profile pa_alsa_profile; +typedef struct pa_alsa_decibel_fix pa_alsa_decibel_fix; typedef struct pa_alsa_profile_set pa_alsa_profile_set; typedef struct pa_alsa_port_data pa_alsa_port_data; @@ -112,11 +113,15 @@ struct pa_alsa_option { char *name; char *description; unsigned priority; + + pa_alsa_required_t required; + pa_alsa_required_t required_any; + pa_alsa_required_t required_absent; }; -/* And element wraps one specific ALSA element. A series of elements * -make up a path (see below). If the element is an enumeration or switch -* element it may includes a list of options. */ +/* An element wraps one specific ALSA element. A series of elements + * make up a path (see below). If the element is an enumeration or switch + * element it may include a list of options. */ struct pa_alsa_element { pa_alsa_path *path; PA_LLIST_FIELDS(pa_alsa_element); @@ -129,6 +134,7 @@ struct pa_alsa_element { pa_alsa_enumeration_use_t enumeration_use; pa_alsa_required_t required; + pa_alsa_required_t required_any; pa_alsa_required_t required_absent; pa_bool_t override_map:1; @@ -136,6 +142,7 @@ struct pa_alsa_element { pa_bool_t has_dB:1; long min_volume, max_volume; + long volume_limit; /* -1 for no configured limit */ double min_dB, max_dB; pa_channel_position_mask_t masks[SND_MIXER_SCHN_LAST][2]; @@ -144,6 +151,8 @@ struct pa_alsa_element { pa_channel_position_mask_t merged_mask; PA_LLIST_HEAD(pa_alsa_option, options); + + pa_alsa_decibel_fix *db_fix; }; /* A path wraps a series of elements into a single entity which can be @@ -164,6 +173,9 @@ struct pa_alsa_path { pa_bool_t has_mute:1; pa_bool_t has_volume:1; pa_bool_t has_dB:1; + /* These two are used during probing only */ + pa_bool_t has_req_any:1; + pa_bool_t req_any_present:1; long min_volume, max_volume; double min_dB, max_dB; @@ -258,9 +270,26 @@ struct pa_alsa_profile { pa_idxset *output_mappings; }; +struct pa_alsa_decibel_fix { + pa_alsa_profile_set *profile_set; + + char *name; /* Alsa volume element name. */ + long min_step; + long max_step; + + /* An array that maps alsa volume element steps to decibels. The steps can + * be used as indices to this array, after substracting min_step from the + * real value. + * + * The values are actually stored as integers representing millibels, + * because that's the format the alsa API uses. */ + long *db_values; +}; + struct pa_alsa_profile_set { pa_hashmap *mappings; pa_hashmap *profiles; + pa_hashmap *decibel_fixes; pa_bool_t auto_profiles; pa_bool_t probed:1; @@ -268,6 +297,7 @@ struct pa_alsa_profile_set { void pa_alsa_mapping_dump(pa_alsa_mapping *m); void pa_alsa_profile_dump(pa_alsa_profile *p); +void pa_alsa_decibel_fix_dump(pa_alsa_decibel_fix *db_fix); pa_alsa_profile_set* pa_alsa_profile_set_new(const char *fname, const pa_channel_map *bonus); void pa_alsa_profile_set_probe(pa_alsa_profile_set *ps, const char *dev_id, const pa_sample_spec *ss, unsigned default_n_fragments, unsigned default_fragment_size_msec); |