Lines Matching refs:volume

114 void pa_source_new_data_set_volume(pa_source_new_data *data, const pa_cvolume *volume) {
117 if ((data->volume_is_set = !!volume))
118 data->volume = *volume;
210 * the source volume is allowed to be set, like there is for source outputs. */
214 pa_cvolume_reset(&data->volume, data->sample_spec.channels);
218 pa_return_null_if_fail(pa_cvolume_valid(&data->volume));
219 pa_return_null_if_fail(pa_cvolume_compatible(&data->volume, &data->sample_spec));
278 s->reference_volume = s->real_volume = data->volume;
496 /* The source implementor is responsible for setting decibel volume support */
500 /* See note below in pa_source_put() about volume sharing and decibel volumes */
611 * special exception we allow some volume related flags to be set
624 /* XXX: Currently decibel volume is disabled for all sources that use volume
625 * sharing. When the master source supports decibel volume, it would be good
629 * remove user-visible volume altogether from filter sources when volume
657 * volume they did so in real_volume, because that is the usual
730 * source will sync its volume with the hardware while another user is
731 * active, messing up the volume for that other user. */
1218 * When a source uses volume sharing, it never has the PA_SOURCE_FLAT_VOLUME flag
1219 * set. Instead, flat volume mode is detected by checking whether the root source
1265 pa_cvolume volume;
1267 /* set the volume to NORM */
1271 pa_cvolume_set(&volume, s->sample_spec.channels, PA_MIN(s->base_volume, PA_VOLUME_NORM));
1272 pa_source_set_volume(s, &volume, true, false);
1277 /* Restore source volume to what it was before we entered passthrough mode */
1295 * volume. This basically calculates:
1297 * o->reference_ratio = o->volume / o->source->reference_volume
1307 /* We don't update when the source volume is 0 anyway */
1314 remapped.values[c]) == o->volume.values[c])
1318 o->volume.values[c],
1325 /* Called from main context. Only called for the root source in volume sharing
1345 /* Called from main context. Only called for the root source in volume sharing
1361 /* The origin source uses volume sharing, so this input's real ratio
1376 * i->real_ratio := i->volume / s->real_volume
1397 remapped.values[c]) != o->volume.values[c])
1400 o->volume.values[c],
1434 * If the channel maps don't match we set an all-channel volume on
1435 * the source to ensure that changing a volume on one stream has no
1452 /* Called from main thread. Only called for the root source in volume sharing
1470 /* Ignore this output. The origin source uses volume sharing, so this
1471 * output's volume will be set to be equal to the root source's real
1472 * volume. Obviously this output's current volume must not then
1473 * affect what the root source's real volume will be. */
1477 remapped = o->volume;
1483 /* Called from main thread. Only called for the root source in volume sharing
1499 /* Called from main thread. Only called for the root source in volume sharing
1517 /* Follow the root source's real volume. */
1530 /* Called from main thread. Only called for the root source in shared volume
1539 /* This determines the maximum volume of all streams and sets
1544 * volume unmodified. */
1551 /* First let's determine the new maximum volume of all outputs
1561 /* Called from main thread. Only called for the root source in shared volume
1572 /* This is called whenever the source volume changes that is not
1573 * caused by a source output volume change. We need to fix up the
1583 /* Since the origin source uses volume sharing, this output's volume
1584 * needs to be updated to match the root source's real volume, but
1591 * o->volume := o->reference_volume * o->reference_ratio */
1600 /* Called from main thread. Only called for the root source in volume sharing
1602 * whether any reference volume actually changed. */
1604 pa_cvolume volume;
1615 volume = *v;
1616 pa_cvolume_remap(&volume, channel_map, &s->channel_map);
1618 reference_volume_changed = !pa_cvolume_equal(&volume, &s->reference_volume);
1619 pa_source_set_reference_volume_direct(s, &volume);
1624 /* If the root source's volume doesn't change, then there can't be any
1628 * volume changes slightly, some filter source doesn't change its volume
1630 * the changed root source volume to the sources connected to the
1631 * intermediate source that didn't change its volume. This theoretical
1650 const pa_cvolume *volume,
1660 pa_assert(!volume || pa_cvolume_valid(volume));
1661 pa_assert(volume || pa_source_flat_volume_enabled(s));
1662 pa_assert(!volume || volume->channels == 1 || pa_cvolume_compatible(volume, &s->sample_spec));
1664 /* make sure we don't change the volume in PASSTHROUGH mode ...
1665 * ... *except* if we're being invoked to reset the volume to ensure 0 dB gain */
1666 if (pa_source_is_passthrough(s) && (!volume || !pa_cvolume_is_norm(volume))) {
1667 pa_log_warn("Cannot change volume, source is monitor of a PASSTHROUGH sink");
1671 /* In case of volume sharing, the volume is set for the root source first,
1681 if (volume) {
1682 if (pa_cvolume_compatible(volume, &s->sample_spec))
1683 new_reference_volume = *volume;
1686 pa_cvolume_scale(&new_reference_volume, pa_cvolume_max(volume));
1693 /* OK, propagate this volume change back to the outputs */
1696 /* And now recalculate the real volume */
1703 /* If volume is NULL we synchronize the source's real and
1708 /* Ok, let's determine the new real volume */
1711 /* To propagate the reference volume from the filter to the root source,
1712 * we first take the real volume from the root source and remap it to
1713 * match the filter. Then, we merge in the reference volume from the
1717 /* First we remap root's real volume to filter channel count and map if needed */
1720 /* Then let's 'push' the reference volume if necessary */
1728 /* Now that the reference volume is updated, we can update the streams'
1735 * soft volume by default. However, set_volume() is free to
1743 /* If we have no function set_volume(), then the soft volume
1744 * becomes the real volume */
1747 /* This tells the source that soft volume and/or real volume changed */
1752 /* Called from the io thread if sync volume is used, otherwise from the main thread.
1754 void pa_source_set_soft_volume(pa_source *s, const pa_cvolume *volume) {
1764 if (!volume)
1767 s->soft_volume = *volume;
1775 /* Called from the main thread. Only called for the root source in volume sharing
1786 /* This is called when the hardware's real volume changes due to
1787 * some external event. We copy the real volume into our
1788 * reference volume and then rebuild the stream volumes based on
1795 /* 1. Make the real volume the reference volume */
1807 /* 3. Recalculate the new stream reference volume based on the
1808 * reference ratio and the sink's reference volume.
1812 * o->volume = s->reference_volume * o->reference_ratio
1827 * to save changed hw settings given that hw volume changes not
1866 /* Called from main thread. In volume sharing cases, only the root source may
1876 /* The source implementor may call this if the volume changed to make sure everyone is notified */
2089 /* Called from the IO thread. Only called for the root source in volume sharing
2136 /* In flat volume mode we need to update the volume as
2156 /* In flat volume mode we need to update the volume as
2198 /* In case source implementor reset SW volume. */
2757 * Adding one more volume for HW would get us rid of this, but I am trying
2772 /* If volume is going up let's do it a bit late. If it is going
2805 /* We can ignore volume events that came earlier but should happen later than this. */
2861 pa_log_debug("Next volume change in %lld usec", (long long) (s->thread_info.volume_changes->at - now));
2989 void pa_source_set_reference_volume_direct(pa_source *s, const pa_cvolume *volume) {
2995 pa_assert(volume);
2999 if (pa_cvolume_equal(volume, &old_volume))
3002 s->reference_volume = *volume;
3003 pa_log_debug("The reference volume of source %s changed from %s to %s.", s->name,
3006 pa_cvolume_snprint_verbose(new_volume_str, sizeof(new_volume_str), volume, &s->channel_map,