mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-08 13:29:59 -05:00
move flat volume logic into the core. while doing so add n_volume_steps field to sinks/sources
This commit is contained in:
parent
4bfa5d7d13
commit
d5f46e824e
32 changed files with 562 additions and 361 deletions
|
|
@ -600,9 +600,13 @@ typedef enum pa_sink_flags {
|
|||
PA_SINK_HW_MUTE_CTRL = 0x0010U,
|
||||
/**< Supports hardware mute control \since 0.9.11 */
|
||||
|
||||
PA_SINK_DECIBEL_VOLUME = 0x0020U
|
||||
PA_SINK_DECIBEL_VOLUME = 0x0020U,
|
||||
/**< Volume can be translated to dB with pa_sw_volume_to_dB()
|
||||
* \since 0.9.11 */
|
||||
|
||||
PA_SINK_FLAT_VOLUME = 0x0040U
|
||||
/**< This sink is in flat volume mode, i.e. always the maximum of
|
||||
* the volume of all connected inputs. \since 0.9.15 */
|
||||
} pa_sink_flags_t;
|
||||
|
||||
/** \cond fulldocs */
|
||||
|
|
@ -612,6 +616,7 @@ typedef enum pa_sink_flags {
|
|||
#define PA_SINK_NETWORK PA_SINK_NETWORK
|
||||
#define PA_SINK_HW_MUTE_CTRL PA_SINK_HW_MUTE_CTRL
|
||||
#define PA_SINK_DECIBEL_VOLUME PA_SINK_DECIBEL_VOLUME
|
||||
#define PA_SINK_FLAT_VOLUME PA_SINK_FLAT_VOLUME
|
||||
/** \endcond */
|
||||
|
||||
/** Sink state. \since 0.9.15 */
|
||||
|
|
|
|||
|
|
@ -159,6 +159,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;
|
||||
i.n_volume_steps = PA_VOLUME_NORM+1;
|
||||
mute = FALSE;
|
||||
state = PA_SINK_INVALID_STATE;
|
||||
|
||||
|
|
@ -180,7 +181,8 @@ static void context_get_sink_info_callback(pa_pdispatch *pd, uint32_t command, u
|
|||
pa_tagstruct_get_usec(t, &i.configured_latency) < 0)) ||
|
||||
(o->context->version >= 15 &&
|
||||
(pa_tagstruct_get_volume(t, &i.base_volume) < 0 ||
|
||||
pa_tagstruct_getu32(t, &state) < 0))) {
|
||||
pa_tagstruct_getu32(t, &state) < 0 ||
|
||||
pa_tagstruct_getu32(t, &i.n_volume_steps) < 0))) {
|
||||
|
||||
pa_context_fail(o->context, PA_ERR_PROTOCOL);
|
||||
pa_proplist_free(i.proplist);
|
||||
|
|
@ -288,6 +290,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;
|
||||
i.n_volume_steps = PA_VOLUME_NORM+1;
|
||||
mute = FALSE;
|
||||
state = PA_SOURCE_INVALID_STATE;
|
||||
|
||||
|
|
@ -309,7 +312,8 @@ static void context_get_source_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
pa_tagstruct_get_usec(t, &i.configured_latency) < 0)) ||
|
||||
(o->context->version >= 15 &&
|
||||
(pa_tagstruct_get_volume(t, &i.base_volume) < 0 ||
|
||||
pa_tagstruct_getu32(t, &state) < 0))) {
|
||||
pa_tagstruct_getu32(t, &state) < 0 ||
|
||||
pa_tagstruct_getu32(t, &i.n_volume_steps) < 0))) {
|
||||
|
||||
pa_context_fail(o->context, PA_ERR_PROTOCOL);
|
||||
pa_proplist_free(i.proplist);
|
||||
|
|
|
|||
|
|
@ -214,6 +214,7 @@ typedef struct pa_sink_info {
|
|||
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.15 */
|
||||
pa_sink_state_t state; /**< State \since 0.9.15 */
|
||||
uint32_t n_volume_steps; /**< Number of volume steps for sinks which do not support arbitrary volumes. \since 0.9.15 */
|
||||
} pa_sink_info;
|
||||
|
||||
/** Callback prototype for pa_context_get_sink_info_by_name() and friends */
|
||||
|
|
@ -269,8 +270,9 @@ 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.15 */
|
||||
pa_source_state_t state; /**< State \since 0.9.15 */
|
||||
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.15 */
|
||||
pa_source_state_t state; /**< State \since 0.9.15 */
|
||||
uint32_t n_volume_steps; /**< Number of volume steps for sources which do not support arbitrary volumes. \since 0.9.15 */
|
||||
} 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