}
if (!pa_safe_streq(volume_type, MASTER_VOLUME_TYPE)) {
+ /* Get volume value */
if (get_volume_value(m, stream_type, is_hal_volume, volume_type, volume_level, &volume_linear))
return -1;
if (!(volume_type_str = pa_proplist_gets(GET_STREAM_PROPLIST(s, stream_type), PA_PROP_MEDIA_TIZEN_VOLUME_TYPE)))
continue;
+ /* Update volume level of stream if it has requested the volume type */
+ if (!pa_safe_streq(volume_type_str, volume_type))
+ continue;
+
/* Get modifier for gain */
modifier_gain = pa_proplist_gets(GET_STREAM_PROPLIST(s, stream_type), PA_PROP_MEDIA_TIZEN_VOLUME_GAIN_TYPE);
-
- /* Update volume level of stream if it has requested the volume type */
- if (pa_safe_streq(volume_type_str, volume_type)) {
- if (modifier_gain) {
- if (m->volume_modifiers) {
- if ((modifier_gain_value = pa_hashmap_get(m->volume_modifiers, modifier_gain))) {
- volume_linear *= (*modifier_gain_value);
- pa_log_info("apply the modifier for the gain value[%s=>%f], result volume_linear[%f]",
- modifier_gain, *modifier_gain_value, volume_linear);
- }
- }
+ if (modifier_gain && m->volume_modifiers) {
+ if ((modifier_gain_value = pa_hashmap_get(m->volume_modifiers, modifier_gain))) {
+ volume_linear *= (*modifier_gain_value);
+ pa_log_info("apply the modifier for the gain value[%s=>%f], result volume_linear[%f]",
+ modifier_gain, *modifier_gain_value, volume_linear);
}
- pa_cvolume_set(&cv, GET_STREAM_SAMPLE_SPEC(s, stream_type).channels, pa_sw_volume_from_linear(volume_linear));
- if (stream_type == STREAM_SINK_INPUT)
- pa_sink_input_set_volume((pa_sink_input*)s, &cv, true, true);
- else if (stream_type == STREAM_SOURCE_OUTPUT)
- pa_source_output_set_volume((pa_source_output*)s, &cv, true, true);
}
+
+ pa_cvolume_set(&cv, GET_STREAM_SAMPLE_SPEC(s, stream_type).channels, pa_sw_volume_from_linear(volume_linear));
+ if (stream_type == STREAM_SINK_INPUT)
+ pa_sink_input_set_volume((pa_sink_input*)s, &cv, true, true);
+ else if (stream_type == STREAM_SOURCE_OUTPUT)
+ pa_source_output_set_volume((pa_source_output*)s, &cv, true, true);
}
} else {
PA_IDXSET_FOREACH(s, stream_type == STREAM_SINK_INPUT ? m->core->sink_inputs : m->core->source_outputs, idx) {
if (!(volume_type_str = pa_proplist_gets(GET_STREAM_PROPLIST(s, stream_type), PA_PROP_MEDIA_TIZEN_VOLUME_TYPE)))
continue;
- /* Get modifier for gain */
- modifier_gain = pa_proplist_gets(GET_STREAM_PROPLIST(s, stream_type), PA_PROP_MEDIA_TIZEN_VOLUME_GAIN_TYPE);
-
/* Get volume level of this type */
if (!(v = pa_hashmap_get(volumes, volume_type_str)))
continue;
-
volume_level = v->values[stream_type].current_level;
+ /* Get volume value */
if (get_volume_value(m, stream_type, is_hal_volume, volume_type_str, volume_level, &volume_linear))
continue;
- if (modifier_gain) {
- if (m->volume_modifiers) {
- if ((modifier_gain_value = pa_hashmap_get(m->volume_modifiers, modifier_gain))) {
- volume_linear *= (*modifier_gain_value);
- pa_log_info("set_volume_level_by_type() : apply the modifier for the gain value[%s=>%f], result volume_linear[%f]",
- modifier_gain, *modifier_gain_value, volume_linear);
- }
+ /* Get modifier for gain */
+ modifier_gain = pa_proplist_gets(GET_STREAM_PROPLIST(s, stream_type), PA_PROP_MEDIA_TIZEN_VOLUME_GAIN_TYPE);
+ if (modifier_gain && m->volume_modifiers) {
+ if ((modifier_gain_value = pa_hashmap_get(m->volume_modifiers, modifier_gain))) {
+ volume_linear *= (*modifier_gain_value);
+ pa_log_info("set_volume_level_by_type() : apply the modifier for the gain value[%s=>%f], result volume_linear[%f]",
+ modifier_gain, *modifier_gain_value, volume_linear);
}
}
+
pa_cvolume_set(&cv, GET_STREAM_SAMPLE_SPEC(s, stream_type).channels, pa_sw_volume_from_linear(volume_linear));
if (stream_type == STREAM_SINK_INPUT)
pa_sink_input_set_volume((pa_sink_input*)s, &cv, true, true);