mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-08 13:29:59 -05:00
Add "base volume" field to sinks/sources
This commit is contained in:
parent
3e3c103ed9
commit
6130c5c11b
8 changed files with 48 additions and 7 deletions
|
|
@ -154,6 +154,7 @@ static void context_get_sink_info_callback(pa_pdispatch *pd, uint32_t command, u
|
|||
|
||||
memset(&i, 0, sizeof(i));
|
||||
i.proplist = pa_proplist_new();
|
||||
i.base_volume = PA_VOLUME_NORM;
|
||||
|
||||
if (pa_tagstruct_getu32(t, &i.index) < 0 ||
|
||||
pa_tagstruct_gets(t, &i.name) < 0 ||
|
||||
|
|
@ -170,7 +171,9 @@ static void context_get_sink_info_callback(pa_pdispatch *pd, uint32_t command, u
|
|||
pa_tagstruct_getu32(t, &flags) < 0 ||
|
||||
(o->context->version >= 13 &&
|
||||
(pa_tagstruct_get_proplist(t, i.proplist) < 0 ||
|
||||
pa_tagstruct_get_usec(t, &i.configured_latency) < 0))) {
|
||||
pa_tagstruct_get_usec(t, &i.configured_latency) < 0)) ||
|
||||
(o->context->version >= 14 &&
|
||||
pa_tagstruct_get_volume(t, &i.base_volume) < 0)) {
|
||||
|
||||
pa_context_fail(o->context, PA_ERR_PROTOCOL);
|
||||
pa_proplist_free(i.proplist);
|
||||
|
|
@ -275,6 +278,7 @@ static void context_get_source_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
|
||||
memset(&i, 0, sizeof(i));
|
||||
i.proplist = pa_proplist_new();
|
||||
i.base_volume = PA_VOLUME_NORM;
|
||||
|
||||
if (pa_tagstruct_getu32(t, &i.index) < 0 ||
|
||||
pa_tagstruct_gets(t, &i.name) < 0 ||
|
||||
|
|
@ -291,7 +295,9 @@ static void context_get_source_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
pa_tagstruct_getu32(t, &flags) < 0 ||
|
||||
(o->context->version >= 13 &&
|
||||
(pa_tagstruct_get_proplist(t, i.proplist) < 0 ||
|
||||
pa_tagstruct_get_usec(t, &i.configured_latency) < 0))) {
|
||||
pa_tagstruct_get_usec(t, &i.configured_latency) < 0)) ||
|
||||
(o->context->version >= 14 &&
|
||||
pa_tagstruct_get_volume(t, &i.base_volume) < 0)) {
|
||||
|
||||
pa_context_fail(o->context, PA_ERR_PROTOCOL);
|
||||
pa_proplist_free(i.proplist);
|
||||
|
|
|
|||
|
|
@ -231,6 +231,7 @@ typedef struct pa_sink_info {
|
|||
pa_sink_flags_t flags; /**< Flags */
|
||||
pa_proplist *proplist; /**< Property list \since 0.9.11 */
|
||||
pa_usec_t configured_latency; /**< The latency this device has been configured to. \since 0.9.11 */
|
||||
pa_volume_t base_volume; /**< Some kind of "base" volume that refers to unamplified/unattenuated volume in the context of the output device. \since 0.9.14 */
|
||||
} pa_sink_info;
|
||||
|
||||
/** Callback prototype for pa_context_get_sink_info_by_name() and friends */
|
||||
|
|
@ -286,6 +287,7 @@ typedef struct pa_source_info {
|
|||
pa_source_flags_t flags; /**< Flags */
|
||||
pa_proplist *proplist; /**< Property list \since 0.9.11 */
|
||||
pa_usec_t configured_latency; /**< The latency this device has been configured to. \since 0.9.11 */
|
||||
pa_volume_t base_volume; /**< Some kind of "base" volume that refers to unamplified/unattenuated volume in the context of the input device. \since 0.9.14 */
|
||||
} pa_source_info;
|
||||
|
||||
/** Callback prototype for pa_context_get_source_info_by_name() and friends */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue