mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-21 14:16:31 +01:00
Prepare for region polarity inversion (using negative gain)
This commit is contained in:
parent
37d6f1026a
commit
5b52aa956f
2 changed files with 8 additions and 2 deletions
|
|
@ -447,7 +447,13 @@ AudioRegion::read_peaks (PeakData *buf, samplecnt_t npeaks, samplecnt_t offset,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_scale_amplitude != 1.0f) {
|
if (_scale_amplitude < 0.f) {
|
||||||
|
for (samplecnt_t n = 0; n < npeaks; ++n) {
|
||||||
|
const float tmp = buf[n].max;
|
||||||
|
buf[n].max = _scale_amplitude * buf[n].min;
|
||||||
|
buf[n].min = _scale_amplitude * tmp;
|
||||||
|
}
|
||||||
|
} else if (_scale_amplitude != 1.0f) {
|
||||||
for (samplecnt_t n = 0; n < npeaks; ++n) {
|
for (samplecnt_t n = 0; n < npeaks; ++n) {
|
||||||
buf[n].max *= _scale_amplitude;
|
buf[n].max *= _scale_amplitude;
|
||||||
buf[n].min *= _scale_amplitude;
|
buf[n].min *= _scale_amplitude;
|
||||||
|
|
|
||||||
|
|
@ -483,7 +483,7 @@ WaveView::draw_image (Cairo::RefPtr<Cairo::ImageSurface>& image, PeakData* peaks
|
||||||
has been scaled by scale_amplitude() already.
|
has been scaled by scale_amplitude() already.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const double clip_level = _global_clip_level * req->image->props.amplitude;
|
const double clip_level = _global_clip_level * fabs (req->image->props.amplitude);
|
||||||
|
|
||||||
const Shape shape = req->image->props.shape;
|
const Shape shape = req->image->props.shape;
|
||||||
const bool logscaled = req->image->props.logscaled;
|
const bool logscaled = req->image->props.logscaled;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue