mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
when changing volume, store whether it is worth remembering or no
This commit is contained in:
parent
ee17772cea
commit
64b0543588
15 changed files with 70 additions and 41 deletions
|
|
@ -177,7 +177,7 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
|
|||
|
||||
if (inputs) {
|
||||
if (u->sink)
|
||||
pa_sink_move_all_finish(u->sink, inputs);
|
||||
pa_sink_move_all_finish(u->sink, inputs, FALSE);
|
||||
else
|
||||
pa_sink_move_all_fail(inputs);
|
||||
}
|
||||
|
|
@ -200,7 +200,7 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
|
|||
|
||||
if (outputs) {
|
||||
if (u->source)
|
||||
pa_source_move_all_finish(u->source, outputs);
|
||||
pa_source_move_all_finish(u->source, outputs, FALSE);
|
||||
else
|
||||
pa_source_move_all_fail(outputs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ static void callback(pa_core *c, pa_subscription_event_type_t t, uint32_t idx, v
|
|||
pa_cvolume cv;
|
||||
pa_log_debug("changing volume of sink input '%s' to 0x%03x", n, r->volume);
|
||||
pa_cvolume_set(&cv, si->sample_spec.channels, r->volume);
|
||||
pa_sink_input_set_volume(si, &cv);
|
||||
pa_sink_input_set_volume(si, &cv, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ static pa_hook_result_t sink_hook_callback(pa_core *c, pa_sink *sink, void* user
|
|||
}
|
||||
|
||||
while ((i = pa_idxset_first(sink->inputs, NULL))) {
|
||||
if (pa_sink_input_move_to(i, target) < 0) {
|
||||
if (pa_sink_input_move_to(i, target, FALSE) < 0) {
|
||||
pa_log_warn("Failed to move sink input %u \"%s\" to %s.", i->index, pa_proplist_gets(i->proplist, PA_PROP_APPLICATION_NAME), target->name);
|
||||
return PA_HOOK_OK;
|
||||
}
|
||||
|
|
@ -121,7 +121,7 @@ static pa_hook_result_t source_hook_callback(pa_core *c, pa_source *source, void
|
|||
pa_assert(target != source);
|
||||
|
||||
while ((o = pa_idxset_first(source->outputs, NULL))) {
|
||||
if (pa_source_output_move_to(o, target) < 0) {
|
||||
if (pa_source_output_move_to(o, target, FALSE) < 0) {
|
||||
pa_log_warn("Failed to move source output %u \"%s\" to %s.", o->index, pa_proplist_gets(o->proplist, PA_PROP_APPLICATION_NAME), target->name);
|
||||
return PA_HOOK_OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -438,14 +438,14 @@ static void apply_entry(struct userdata *u, const char *name, struct entry *e) {
|
|||
|
||||
if (u->restore_muted) {
|
||||
pa_log_info("Restoring mute state for sink input %s.", name);
|
||||
pa_sink_input_set_mute(si, e->muted);
|
||||
pa_sink_input_set_mute(si, e->muted, TRUE);
|
||||
}
|
||||
|
||||
if (u->restore_device &&
|
||||
(s = pa_namereg_get(u->core, e->device, PA_NAMEREG_SOURCE))) {
|
||||
|
||||
pa_log_info("Restoring device for stream %s.", name);
|
||||
pa_sink_input_move_to(si, s);
|
||||
pa_sink_input_move_to(si, s, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -465,7 +465,7 @@ static void apply_entry(struct userdata *u, const char *name, struct entry *e) {
|
|||
(s = pa_namereg_get(u->core, e->device, PA_NAMEREG_SOURCE))) {
|
||||
|
||||
pa_log_info("Restoring device for stream %s.", name);
|
||||
pa_source_output_move_to(so, s);
|
||||
pa_source_output_move_to(so, s, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue