sink-input: New volume_factor system

Implement setting of more than one volume factor.  The
real value of the volume_factor will be the multiplication of these
values.
This commit is contained in:
Flavio Ceolin 2012-11-29 11:04:11 -02:00 committed by Tanu Kaskinen
parent bf962a2600
commit 9e2b6a0b5c
3 changed files with 164 additions and 34 deletions

View file

@ -52,6 +52,7 @@ static const char* const valid_modargs[] = {
struct userdata {
pa_hook_slot *sink_input_fixate_hook_slot;
const char *name;
};
static int parse_pos(const char *pos, double *f) {
@ -132,7 +133,7 @@ static pa_hook_result_t sink_input_fixate_hook_callback(pa_core *core, pa_sink_i
}
pa_log_debug("Final volume factor %s.", pa_cvolume_snprint(t, sizeof(t), &v));
pa_sink_input_new_data_apply_volume_factor_sink(data, &v);
pa_sink_input_new_data_add_volume_factor_sink(data, u->name, &v);
return PA_HOOK_OK;
}
@ -152,6 +153,7 @@ int pa__init(pa_module*m) {
u->sink_input_fixate_hook_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_FIXATE], PA_HOOK_EARLY, (pa_hook_cb_t) sink_input_fixate_hook_callback, u);
pa_modargs_free(ma);
u->name = m->name;
return 0;