Timeline: Fix normalization of multi-channel regions.

This commit is contained in:
Jonathan Moore Liles 2013-09-26 22:54:06 -07:00
parent 7c71faab1c
commit 8856216d86
1 changed files with 11 additions and 1 deletions

View File

@ -912,9 +912,19 @@ Audio_Region::normalize ( void )
const nframes_t npeaks = _loop ? _loop : length();
if ( _clip->read_peaks( npeaks, offset(), offset() + npeaks, &peaks, &pbuf, &channels ) &&
peaks )
_scale = pbuf->normalization_factor();
{
_scale = 1000.0f;
for ( int i = 0; i < channels; i++ )
{
float f = (pbuf + i)->normalization_factor();
if ( f < _scale )
_scale = f;
}
}
/* FIXME: wrong place for this? */
sequence()->handle_widget_change( start(), length() );