Lines Matching refs:volume

54     pa_cvolume volume;
117 static struct volume_factor_entry *volume_factor_entry_new(const char *key, const pa_cvolume *volume) {
121 pa_assert(volume);
126 entry->volume = *volume;
144 pa_sw_cvolume_multiply(v, v, &entry->volume);
207 void pa_sink_input_new_data_set_volume(pa_sink_input_new_data *data, const pa_cvolume *volume) {
211 if ((data->volume_is_set = !!volume))
212 data->volume = *volume;
441 /* If volume is set, we need to save the original data->channel_map,
442 * so that we can remap the volume from the original channel map to the
445 r = pa_stream_get_volume_channel_map(&data->volume, data->channel_map_is_set ? &data->channel_map : NULL, data->format, &volume_map);
450 * determine if volume remapping is needed. */
465 /* Don't restore (or save) stream volume for passthrough streams and
469 pa_cvolume_reset(&data->volume, data->sample_spec.channels);
475 pa_cvolume_reset(&data->volume, data->sample_spec.channels);
484 /* The original volume channel map may be different than the final
486 pa_cvolume_remap(&data->volume, &volume_map, &data->channel_map);
574 /* When the 'absolute' bool is not set then we'll treat the volume
575 * as relative to the sink volume even in flat volume mode */
578 pa_sw_cvolume_multiply(&i->volume, &data->volume, &remapped);
580 i->volume = data->volume;
590 i->real_ratio = i->reference_ratio = data->volume;
807 /* We might need to update the sink's volume if we are in flat volume mode. */
904 /* We might need to update the sink's volume if we are in flat volume mode. */
909 pa_assert(pa_cvolume_is_norm(&i->volume));
913 set_real_ratio(i, &i->volume);
959 void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink bytes */, pa_memchunk *chunk, pa_cvolume *volume) {
971 pa_assert(volume);
1006 * to adjust the volume *before* we resample. Otherwise we can do
1052 /* It might be necessary to adjust the volume here */
1064 * post and the pre volume adjustment into one */
1126 /* Let's see if we had to apply the volume adjustment ourselves,
1131 pa_cvolume_reset(volume, i->sink->sample_spec.channels);
1134 pa_cvolume_mute(volume, i->sink->sample_spec.channels);
1136 *volume = i->thread_info.soft_volume;
1417 void pa_sink_input_set_volume(pa_sink_input *i, const pa_cvolume *volume, bool save, bool absolute) {
1423 pa_assert(volume);
1424 pa_assert(pa_cvolume_valid(volume));
1425 pa_assert(volume->channels == 1 || pa_cvolume_compatible(volume, &i->sample_spec));
1432 if (pa_cvolume_compatible(volume, &i->sample_spec))
1433 volume = pa_sw_cvolume_multiply(&v, &v, volume);
1435 volume = pa_sw_cvolume_multiply_scalar(&v, &v, pa_cvolume_max(volume));
1437 if (!pa_cvolume_compatible(volume, &i->sample_spec)) {
1438 v = i->volume;
1439 volume = pa_cvolume_scale(&v, pa_cvolume_max(volume));
1443 if (pa_cvolume_equal(volume, &i->volume)) {
1448 pa_sink_input_set_volume_direct(i, volume);
1452 /* We are in flat volume mode, so let's update all sink input
1453 * volumes and update the flat volume of the sink */
1458 /* OK, we are in normal volume mode. The volume only affects
1460 set_real_ratio(i, volume);
1461 pa_sink_input_set_reference_ratio(i, &i->volume);
1481 pa_cvolume_set(&v->volume, i->sample_spec.channels, volume_factor->values[0]);
1485 i->volume_factor = v->volume;
1487 pa_sw_cvolume_multiply(&i->volume_factor, &i->volume_factor, &v->volume);
1514 i->volume_factor = v->volume;
1571 pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i, pa_cvolume *volume, bool absolute) {
1578 *volume = i->volume;
1580 *volume = i->reference_ratio;
1582 return volume;
1903 /* We might need to update the sink's volume if we are in flat
1904 * volume mode. */
1912 pa_cvolume_remap(&v->volume, &i->sink->channel_map, &i->channel_map);
1929 /* Called from main context. If i has an origin sink that uses volume sharing,
1931 * their volume - this function does all that by using recursion. */
1948 /* Ok, so the origin sink uses volume sharing, and flat volume is
1949 * enabled. The volume will have to be updated as follows:
1951 * i->volume := i->sink->real_volume
1953 * i->reference_ratio := i->volume / i->sink->reference_volume
1956 * (streams whose origin sink uses volume sharing should
1959 * (streams whose origin sink uses volume sharing should
1969 /* Ok, so the origin sink uses volume sharing, and flat volume is
1970 * disabled. The volume will have to be updated as follows:
1972 * i->volume := 0 dB
1975 * (streams whose origin sink uses volume sharing should
1978 * (streams whose origin sink uses volume sharing should
1982 pa_cvolume_reset(&new_volume, i->volume.channels);
1989 /* Additionally, the origin sink volume needs updating:
1994 * (sinks that use volume sharing should always have
2007 * somewhere, that's not the case, because sinks that use volume
2008 * sharing shouldn't have any internal volume that set_volume() would
2019 /* Ok, so this is a regular stream, and flat volume is enabled. The
2020 * volume will have to be updated as follows:
2022 * i->volume := i->reference_ratio * i->sink->reference_volume
2024 * i->real_ratio := i->volume / i->sink->real_volume
2035 /* Ok, so this is a regular stream, and flat volume is disabled.
2036 * The volume will have to be updated as follows:
2038 * i->volume := i->reference_ratio
2205 pa_cvolume_remap(&v->volume, &i->channel_map, &i->sink->channel_map);
2675 void pa_sink_input_set_volume_direct(pa_sink_input *i, const pa_cvolume *volume) {
2681 pa_assert(volume);
2683 old_volume = i->volume;
2685 if (pa_cvolume_equal(volume, &old_volume))
2688 i->volume = *volume;
2689 pa_log_debug("The volume of sink input %u changed from %s to %s.", i->index,
2691 pa_cvolume_snprint_verbose(new_volume_str, sizeof(new_volume_str), volume, &i->channel_map, true));