Lines Matching refs:volume
88 void pa_source_output_new_data_set_volume(pa_source_output_new_data *data, const pa_cvolume *volume) {
92 if ((data->volume_is_set = !!volume))
93 data->volume = *volume;
321 /* If volume is set, we need to save the original data->channel_map,
322 * so that we can remap the volume from the original channel map to the
325 r = pa_stream_get_volume_channel_map(&data->volume, data->channel_map_is_set ? &data->channel_map : NULL, data->format, &volume_map);
330 * determine if volume remapping is needed. */
341 /* Don't restore (or save) stream volume for passthrough streams and
345 pa_cvolume_reset(&data->volume, data->sample_spec.channels);
351 pa_cvolume_reset(&data->volume, data->sample_spec.channels);
360 /* The original volume channel map may be different than the final
362 pa_cvolume_remap(&data->volume, &volume_map, &data->channel_map);
459 /* When the 'absolute' bool is not set then we'll treat the volume
460 * as relative to the source volume even in flat volume mode */
463 pa_sw_cvolume_multiply(&o->volume, &data->volume, &remapped);
465 o->volume = data->volume;
469 o->real_ratio = o->reference_ratio = data->volume;
620 /* We might need to update the source's volume if we are in flat volume mode. */
696 /* We might need to update the source's volume if we are in flat volume mode. */
701 pa_assert(pa_cvolume_is_norm(&o->volume));
705 set_real_ratio(o, &o->volume);
811 /* It might be necessary to adjust the volume here */
823 * post and the pre volume adjustment into one */
997 void pa_source_output_set_volume(pa_source_output *o, const pa_cvolume *volume, bool save, bool absolute) {
1003 pa_assert(volume);
1004 pa_assert(pa_cvolume_valid(volume));
1005 pa_assert(volume->channels == 1 || pa_cvolume_compatible(volume, &o->sample_spec));
1012 if (pa_cvolume_compatible(volume, &o->sample_spec))
1013 volume = pa_sw_cvolume_multiply(&v, &v, volume);
1015 volume = pa_sw_cvolume_multiply_scalar(&v, &v, pa_cvolume_max(volume));
1017 if (!pa_cvolume_compatible(volume, &o->sample_spec)) {
1018 v = o->volume;
1019 volume = pa_cvolume_scale(&v, pa_cvolume_max(volume));
1023 if (pa_cvolume_equal(volume, &o->volume)) {
1028 pa_source_output_set_volume_direct(o, volume);
1032 /* We are in flat volume mode, so let's update all source input
1033 * volumes and update the flat volume of the source */
1038 /* OK, we are in normal volume mode. The volume only affects
1040 set_real_ratio(o, volume);
1046 /* The volume changed, let's tell people so */
1050 /* The virtual volume changed, let's tell people so */
1097 pa_cvolume *pa_source_output_get_volume(pa_source_output *o, pa_cvolume *volume, bool absolute) {
1104 *volume = o->volume;
1106 *volume = o->reference_ratio;
1108 return volume;
1407 /* We might need to update the source's volume if we are in flat
1408 * volume mode. */
1425 /* Called from main context. If it has an origin source that uses volume sharing,
1427 * their volume - this function does all that by using recursion. */
1446 /* Ok, so the origin source uses volume sharing, and flat volume is
1447 * enabled. The volume will have to be updated as follows:
1449 * o->volume := o->source->real_volume
1451 * o->reference_ratio := o->volume / o->source->reference_volume
1454 * (streams whose origin source uses volume sharing should
1457 * (streams whose origin source uses volume sharing should
1467 /* Ok, so the origin source uses volume sharing, and flat volume is
1468 * disabled. The volume will have to be updated as follows:
1470 * o->volume := 0 dB
1473 * (streams whose origin source uses volume sharing should
1476 * (streams whose origin source uses volume sharing should
1480 pa_cvolume_reset(&new_volume, o->volume.channels);
1487 /* Additionally, the origin source volume needs updating:
1492 * (sources that use volume sharing should always have
1506 * volume sharing shouldn't have any internal volume that set_volume()
1517 /* Ok, so this is a regular stream, and flat volume is enabled. The
1518 * volume will have to be updated as follows:
1520 * o->volume := o->reference_ratio * o->source->reference_volume
1522 * o->real_ratio := o->volume / o->source->real_volume
1533 /* Ok, so this is a regular stream, and flat volume is disabled.
1534 * The volume will have to be updated as follows:
1536 * o->volume := o->reference_ratio
1545 /* If this is a virtual source stream, we have to apply the source volume
1912 void pa_source_output_set_volume_direct(pa_source_output *o, const pa_cvolume *volume) {
1918 pa_assert(volume);
1920 old_volume = o->volume;
1922 if (pa_cvolume_equal(volume, &old_volume))
1925 o->volume = *volume;
1926 pa_log_debug("The volume of source output %u changed from %s to %s.", o->index,
1928 pa_cvolume_snprint_verbose(new_volume_str, sizeof(new_volume_str), volume, &o->channel_map, true));