mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-14 06:59:53 -05:00
sink-input, source-output: Remove redundant get_mute() functions
The functions just return the muted value. Callers can as well read the struct field directly, it's simpler that way.
This commit is contained in:
parent
e4a7625ba8
commit
ef4ae785aa
9 changed files with 12 additions and 33 deletions
|
|
@ -536,7 +536,7 @@ char *pa_source_output_list_to_string(pa_core *c) {
|
|||
state_table[pa_source_output_get_state(o)],
|
||||
o->source->index, o->source->name,
|
||||
volume_str,
|
||||
pa_yes_no(pa_source_output_get_mute(o)),
|
||||
pa_yes_no(o->muted),
|
||||
(double) pa_source_output_get_latency(o, NULL) / PA_USEC_PER_MSEC,
|
||||
clt,
|
||||
pa_sample_spec_snprint(ss, sizeof(ss), &o->sample_spec),
|
||||
|
|
@ -634,7 +634,7 @@ char *pa_sink_input_list_to_string(pa_core *c) {
|
|||
state_table[pa_sink_input_get_state(i)],
|
||||
i->sink->index, i->sink->name,
|
||||
volume_str,
|
||||
pa_yes_no(pa_sink_input_get_mute(i)),
|
||||
pa_yes_no(i->muted),
|
||||
(double) pa_sink_input_get_latency(i, NULL) / PA_USEC_PER_MSEC,
|
||||
clt,
|
||||
pa_sample_spec_snprint(ss, sizeof(ss), &i->sample_spec),
|
||||
|
|
|
|||
|
|
@ -3366,7 +3366,7 @@ static void sink_input_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t,
|
|||
pa_tagstruct_puts(t, pa_resample_method_to_string(pa_sink_input_get_resample_method(s)));
|
||||
pa_tagstruct_puts(t, s->driver);
|
||||
if (c->version >= 11)
|
||||
pa_tagstruct_put_boolean(t, pa_sink_input_get_mute(s));
|
||||
pa_tagstruct_put_boolean(t, s->muted);
|
||||
if (c->version >= 13)
|
||||
pa_tagstruct_put_proplist(t, s->proplist);
|
||||
if (c->version >= 19)
|
||||
|
|
@ -3413,7 +3413,7 @@ static void source_output_fill_tagstruct(pa_native_connection *c, pa_tagstruct *
|
|||
pa_tagstruct_put_boolean(t, (pa_source_output_get_state(s) == PA_SOURCE_OUTPUT_CORKED));
|
||||
if (c->version >= 22) {
|
||||
pa_tagstruct_put_cvolume(t, &v);
|
||||
pa_tagstruct_put_boolean(t, pa_source_output_get_mute(s));
|
||||
pa_tagstruct_put_boolean(t, s->muted);
|
||||
pa_tagstruct_put_boolean(t, has_volume);
|
||||
pa_tagstruct_put_boolean(t, s->volume_writable);
|
||||
pa_tagstruct_put_format_info(t, s->format);
|
||||
|
|
|
|||
|
|
@ -1426,15 +1426,6 @@ void pa_sink_input_set_mute(pa_sink_input *i, bool mute, bool save) {
|
|||
pa_subscription_post(i->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
|
||||
}
|
||||
|
||||
/* Called from main context */
|
||||
bool pa_sink_input_get_mute(pa_sink_input *i) {
|
||||
pa_sink_input_assert_ref(i);
|
||||
pa_assert_ctl_context();
|
||||
pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
|
||||
|
||||
return i->muted;
|
||||
}
|
||||
|
||||
/* Called from main thread */
|
||||
void pa_sink_input_update_proplist(pa_sink_input *i, pa_update_mode_t mode, pa_proplist *p) {
|
||||
pa_sink_input_assert_ref(i);
|
||||
|
|
|
|||
|
|
@ -375,7 +375,6 @@ int pa_sink_input_remove_volume_factor(pa_sink_input *i, const char *key);
|
|||
pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i, pa_cvolume *volume, bool absolute);
|
||||
|
||||
void pa_sink_input_set_mute(pa_sink_input *i, bool mute, bool save);
|
||||
bool pa_sink_input_get_mute(pa_sink_input *i);
|
||||
|
||||
void pa_sink_input_update_proplist(pa_sink_input *i, pa_update_mode_t mode, pa_proplist *p);
|
||||
|
||||
|
|
|
|||
|
|
@ -1084,15 +1084,6 @@ void pa_source_output_set_mute(pa_source_output *o, bool mute, bool save) {
|
|||
pa_subscription_post(o->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_CHANGE, o->index);
|
||||
}
|
||||
|
||||
/* Called from main context */
|
||||
bool pa_source_output_get_mute(pa_source_output *o) {
|
||||
pa_source_output_assert_ref(o);
|
||||
pa_assert_ctl_context();
|
||||
pa_assert(PA_SOURCE_OUTPUT_IS_LINKED(o->state));
|
||||
|
||||
return o->muted;
|
||||
}
|
||||
|
||||
/* Called from main thread */
|
||||
void pa_source_output_update_proplist(pa_source_output *o, pa_update_mode_t mode, pa_proplist *p) {
|
||||
pa_source_output_assert_ref(o);
|
||||
|
|
|
|||
|
|
@ -318,7 +318,6 @@ void pa_source_output_set_volume(pa_source_output *o, const pa_cvolume *volume,
|
|||
pa_cvolume *pa_source_output_get_volume(pa_source_output *o, pa_cvolume *volume, bool absolute);
|
||||
|
||||
void pa_source_output_set_mute(pa_source_output *o, bool mute, bool save);
|
||||
bool pa_source_output_get_mute(pa_source_output *o);
|
||||
|
||||
void pa_source_output_update_proplist(pa_source_output *o, pa_update_mode_t mode, pa_proplist *p);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue