move flat volume logic into the core. while doing so add n_volume_steps field to sinks/sources

This commit is contained in:
Lennart Poettering 2009-01-27 04:39:07 +01:00
parent 4bfa5d7d13
commit d5f46e824e
32 changed files with 562 additions and 361 deletions

View file

@ -685,15 +685,15 @@ int pa_source_output_start_move(pa_source_output *o) {
origin = o->source;
pa_assert_se(pa_asyncmsgq_send(o->source->asyncmsgq, PA_MSGOBJECT(o->source), PA_SOURCE_MESSAGE_REMOVE_OUTPUT, o, 0, NULL) == 0);
pa_idxset_remove_by_data(o->source->outputs, o, NULL);
if (pa_source_output_get_state(o) == PA_SOURCE_OUTPUT_CORKED)
pa_assert_se(origin->n_corked-- >= 1);
pa_idxset_remove_by_data(o->source->outputs, o, NULL);
o->source = NULL;
pa_assert_se(pa_asyncmsgq_send(o->source->asyncmsgq, PA_MSGOBJECT(o->source), PA_SOURCE_MESSAGE_REMOVE_OUTPUT, o, 0, NULL) == 0);
pa_source_update_status(origin);
pa_source_update_status(o->source);
o->source = NULL;
return 0;
}
@ -707,6 +707,9 @@ int pa_source_output_finish_move(pa_source_output *o, pa_source *dest) {
pa_assert(!o->source);
pa_source_assert_ref(dest);
if (!pa_source_output_may_move_to(o, dest))
return -1;
o->source = dest;
pa_idxset_put(o->source->outputs, o, NULL);