Lines Matching defs:volume

124 void pa_sink_new_data_set_volume(pa_sink_new_data *data, const pa_cvolume *volume) {
127 if ((data->volume_is_set = !!volume))
128 data->volume = *volume;
224 * the sink volume is allowed to be set, like there is for sink inputs. */
228 pa_cvolume_reset(&data->volume, data->sample_spec.channels);
232 pa_return_null_if_fail(pa_cvolume_valid(&data->volume));
233 pa_return_null_if_fail(pa_cvolume_compatible(&data->volume, &data->sample_spec));
291 s->reference_volume = s->real_volume = data->volume;
548 /* The sink implementor is responsible for setting decibel volume support */
552 /* See note below in pa_sink_put() about volume sharing and decibel volumes */
663 * special exception we allow some volume related flags to be set
676 /* XXX: Currently decibel volume is disabled for all sinks that use volume
677 * sharing. When the master sink supports decibel volume, it would be good
681 * remove user-visible volume altogether from filter sinks when volume
709 * volume they did so in real_volume, because that is the usual
796 * will sync its volume with the hardware while another user is
797 * active, messing up the volume for that other user. */
1115 pa_sink_input_peek(i, *length, &info->chunk, &info->volume);
1192 pa_volume_memchunk(&c, &s->sample_spec, &m->volume);
1283 pa_cvolume volume;
1291 pa_sw_cvolume_multiply(&volume, &s->thread_info.soft_volume, &info[0].volume);
1293 if (s->thread_info.soft_muted || pa_cvolume_is_muted(&volume)) {
1300 } else if (!pa_cvolume_is_norm(&volume)) {
1302 pa_volume_memchunk(result, &s->sample_spec, &volume);
1363 pa_cvolume volume;
1368 pa_sw_cvolume_multiply(&volume, &s->thread_info.soft_volume, &info[0].volume);
1370 if (s->thread_info.soft_muted || pa_cvolume_is_muted(&volume))
1381 if (!pa_cvolume_is_norm(&volume)) {
1383 pa_volume_memchunk(&vchunk, &s->sample_spec, &volume);
1659 * When a sink uses volume sharing, it never has the PA_SINK_FLAT_VOLUME flag
1660 * set. Instead, flat volume mode is detected by checking whether the root sink
1736 pa_cvolume volume;
1748 /* set the volume to NORM */
1752 pa_cvolume_set(&volume, s->sample_spec.channels, PA_MIN(s->base_volume, PA_VOLUME_NORM));
1753 pa_sink_set_volume(s, &volume, true, false);
1766 /* Restore sink volume to what it was before we entered passthrough mode */
1785 * volume. This basically calculates:
1787 * i->reference_ratio = i->volume / i->sink->reference_volume
1797 /* We don't update when the sink volume is 0 anyway */
1804 remapped.values[c]) == i->volume.values[c])
1808 i->volume.values[c],
1815 /* Called from main context. Only called for the root sink in volume sharing
1835 /* Called from main context. Only called for the root sink in volume sharing
1851 /* The origin sink uses volume sharing, so this input's real ratio
1866 * i->real_ratio := i->volume / s->real_volume
1887 remapped.values[c]) != i->volume.values[c])
1890 i->volume.values[c],
1924 * If the channel maps don't match we set an all-channel volume on
1925 * the sink to ensure that changing a volume on one stream has no
1942 /* Called from main thread. Only called for the root sink in volume sharing
1960 /* Ignore this input. The origin sink uses volume sharing, so this
1961 * input's volume will be set to be equal to the root sink's real
1962 * volume. Obviously this input's current volume must not then
1963 * affect what the root sink's real volume will be. */
1967 remapped = i->volume;
1973 /* Called from main thread. Only called for the root sink in volume sharing
1989 /* Called from main thread. Only called for the root sink in volume sharing
2007 /* Follow the root sink's real volume. */
2020 /* Called from main thread. Only called for the root sink in shared volume
2029 /* This determines the maximum volume of all streams and sets
2034 * volume unmodified. */
2041 /* First let's determine the new maximum volume of all inputs
2051 /* Called from main thread. Only called for the root sink in shared volume
2062 /* This is called whenever the sink volume changes that is not
2063 * caused by a sink input volume change. We need to fix up the
2073 /* Since the origin sink uses volume sharing, this input's volume
2074 * needs to be updated to match the root sink's real volume, but
2081 * i->volume := s->reference_volume * i->reference_ratio */
2090 /* Called from main thread. Only called for the root sink in volume sharing
2092 * whether any reference volume actually changed. */
2094 pa_cvolume volume;
2105 volume = *v;
2106 pa_cvolume_remap(&volume, channel_map, &s->channel_map);
2108 reference_volume_changed = !pa_cvolume_equal(&volume, &s->reference_volume);
2109 pa_sink_set_reference_volume_direct(s, &volume);
2114 /* If the root sink's volume doesn't change, then there can't be any
2118 * volume changes slightly, some filter sink doesn't change its volume
2120 * the changed root sink volume to the sinks connected to the
2121 * intermediate sink that didn't change its volume. This theoretical
2140 const pa_cvolume *volume,
2150 pa_assert(!volume || pa_cvolume_valid(volume));
2151 pa_assert(volume || pa_sink_flat_volume_enabled(s));
2152 pa_assert(!volume || volume->channels == 1 || pa_cvolume_compatible(volume, &s->sample_spec));
2154 /* make sure we don't change the volume when a PASSTHROUGH input is connected ...
2155 * ... *except* if we're being invoked to reset the volume to ensure 0 dB gain */
2156 if (pa_sink_is_passthrough(s) && (!volume || !pa_cvolume_is_norm(volume))) {
2157 pa_log_warn("Cannot change volume, Sink is connected to PASSTHROUGH input");
2161 /* In case of volume sharing, the volume is set for the root sink first,
2171 if (volume) {
2172 if (pa_cvolume_compatible(volume, &s->sample_spec))
2173 new_reference_volume = *volume;
2176 pa_cvolume_scale(&new_reference_volume, pa_cvolume_max(volume));
2183 /* OK, propagate this volume change back to the inputs */
2186 /* And now recalculate the real volume */
2193 /* If volume is NULL we synchronize the sink's real and
2198 /* Ok, let's determine the new real volume */
2201 /* Let's 'push' the reference volume if necessary */
2208 /* Now that the reference volume is updated, we can update the streams'
2215 * soft volume by default. However, set_volume() is free to
2223 /* If we have no function set_volume(), then the soft volume
2224 * becomes the real volume */
2227 /* This tells the sink that soft volume and/or real volume changed */
2232 /* Called from the io thread if sync volume is used, otherwise from the main thread.
2234 void pa_sink_set_soft_volume(pa_sink *s, const pa_cvolume *volume) {
2244 if (!volume)
2247 s->soft_volume = *volume;
2255 /* Called from the main thread. Only called for the root sink in volume sharing
2266 /* This is called when the hardware's real volume changes due to
2267 * some external event. We copy the real volume into our
2268 * reference volume and then rebuild the stream volumes based on
2275 /* 1. Make the real volume the reference volume */
2288 /* 3. Recalculate the new stream reference volume based on the
2289 * reference ratio and the sink's reference volume.
2293 * i->volume = s->reference_volume * i->reference_ratio
2308 * to save changed hw settings given that hw volume changes not
2347 /* Called from main thread. In volume sharing cases, only the root sink may
2357 /* The sink implementor may call this if the volume changed to make sure everyone is notified */
2594 /* Called from the IO thread. Only called for the root sink in volume sharing
2706 /* In flat volume mode we need to update the volume as
2743 /* In flat volume mode we need to update the volume as
2787 /* In flat volume mode we need to update the volume as
2906 /* In case sink implementor reset SW volume. */
3749 * Adding one more volume for HW would get us rid of this, but I am trying
3764 /* If volume is going up let's do it a bit late. If it is going
3797 /* We can ignore volume events that came earlier but should happen later than this. */
3853 pa_log_debug("Next volume change in %lld usec", (long long) (s->thread_info.volume_changes->at - now));
3865 /* All the queued volume events later than current latency are shifted to happen earlier. */
4023 void pa_sink_set_reference_volume_direct(pa_sink *s, const pa_cvolume *volume) {
4029 pa_assert(volume);
4033 if (pa_cvolume_equal(volume, &old_volume))
4036 s->reference_volume = *volume;
4037 pa_log_debug("The reference volume of sink %s changed from %s to %s.", s->name,
4040 pa_cvolume_snprint_verbose(new_volume_str, sizeof(new_volume_str), volume, &s->channel_map,