From cbf22b4ccaab14a7c8cb62137ea09b58a001e13a Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 24 Sep 2021 18:45:33 -0400 Subject: improved initial waveform display when making a clipping. --- src/client/views/AudioWaveform.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/views/AudioWaveform.tsx b/src/client/views/AudioWaveform.tsx index f7b117130..0a441552e 100644 --- a/src/client/views/AudioWaveform.tsx +++ b/src/client/views/AudioWaveform.tsx @@ -42,7 +42,8 @@ export class AudioWaveform extends React.Component { ({ clipStart, clipEnd, fieldKey }) => { if (!this.props.layoutDoc[fieldKey]) { // setting these values here serves as a "lock" to prevent multiple attempts to create the waveform at nerly the same time. - this.props.layoutDoc[fieldKey] = new List(numberRange(AudioWaveform.NUMBER_OF_BUCKETS)); + const waveform = Cast(this.props.layoutDoc[this.audioBucketField(0, this.props.rawDuration)], listSpec("number"), []); + this.props.layoutDoc[fieldKey] = new List(waveform.slice(clipStart / this.props.rawDuration * waveform.length, clipEnd / this.props.rawDuration * waveform.length)); setTimeout(() => this.createWaveformBuckets(fieldKey, clipStart, clipEnd)); } }, { fireImmediately: true }); -- cgit v1.2.3-70-g09d2