sink-input, source-output: Assign to reference_ratio from a single place

This makes it easy to log a message every time the reference ratio
changes. I also need to add a hook for reference ratio changes, but
that need will go away if the stream relative volume controls will be
created by the core in the future.
This commit is contained in:
Tanu Kaskinen 2014-08-04 21:12:53 +03:00
parent 8a4a4f408c
commit f480fb38a7
6 changed files with 77 additions and 11 deletions

View file

@ -423,6 +423,12 @@ pa_memchunk* pa_sink_input_get_silence(pa_sink_input *i, pa_memchunk *ret);
* and fires change notifications. */
void pa_sink_input_set_volume_direct(pa_sink_input *i, const pa_cvolume *volume);
/* Called from the main thread, from sink.c only. This shouldn't be a public
* function, but the flat volume logic in sink.c currently needs a way to
* directly set the sink input reference ratio. This function simply sets
* i->reference_ratio and logs a message if the value changes. */
void pa_sink_input_set_reference_ratio(pa_sink_input *i, const pa_cvolume *ratio);
#define pa_sink_input_assert_io_context(s) \
pa_assert(pa_thread_mq_get() || !PA_SINK_INPUT_IS_LINKED((s)->state))