diff options
author | Kai-Heng Feng <kai.heng.feng@canonical.com> | 2020-12-22 13:39:05 +0800 |
---|---|---|
committer | Arun Raghavan <arun@asymptotic.io> | 2021-01-07 19:18:15 -0500 |
commit | 8903d2ccc0a0e735f0477382a51254a5c24e3560 (patch) | |
tree | 1abd12c465225190fc3c156861740e2cab9d5128 /src/modules/alsa/alsa-mixer.h | |
parent | 0f89157261d032fbf7f9c5e8f94d92730ffea1ad (diff) | |
download | pulseaudio-8903d2ccc0a0e735f0477382a51254a5c24e3560.tar.gz |
alsa-mixer: Handle the index for ALSA mixer jack identifiers
Some systems have two jacks with same name but different index, we need
to take index into consideration to use both jacks.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/272>
Diffstat (limited to 'src/modules/alsa/alsa-mixer.h')
-rw-r--r-- | src/modules/alsa/alsa-mixer.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/alsa/alsa-mixer.h b/src/modules/alsa/alsa-mixer.h index 81519551d..db8310258 100644 --- a/src/modules/alsa/alsa-mixer.h +++ b/src/modules/alsa/alsa-mixer.h @@ -115,6 +115,8 @@ struct pa_alsa_mixer_id { int index; }; +char *pa_alsa_mixer_id_to_string(char *dst, size_t dst_len, pa_alsa_mixer_id *id); + /* An option belongs to an element and refers to one enumeration item * of the element is an enumeration item, or a switch status if the * element is a switch item. */ @@ -179,8 +181,8 @@ struct pa_alsa_jack { snd_mixer_t *mixer_handle; char *mixer_device_name; + struct pa_alsa_mixer_id alsa_id; char *name; /* E g "Headphone" */ - char *alsa_name; /* E g "Headphone Jack" */ bool has_control; /* is the jack itself present? */ bool plugged_in; /* is this jack currently plugged in? */ snd_mixer_elem_t *melem; /* Jack detection handle */ @@ -196,7 +198,7 @@ struct pa_alsa_jack { bool append_pcm_to_name; }; -pa_alsa_jack *pa_alsa_jack_new(pa_alsa_path *path, const char *mixer_device_name, const char *name); +pa_alsa_jack *pa_alsa_jack_new(pa_alsa_path *path, const char *mixer_device_name, const char *name, int index); void pa_alsa_jack_free(pa_alsa_jack *jack); void pa_alsa_jack_set_has_control(pa_alsa_jack *jack, bool has_control); void pa_alsa_jack_set_plugged_in(pa_alsa_jack *jack, bool plugged_in); |