moved visual waveforms to block
This should be nicer, however it has a bug that I need to fix
This commit is contained in:
@@ -233,6 +233,29 @@ void AudioVisualWaveform::Shift(const rational &from, const rational &to)
|
||||
length_ += (to-from);
|
||||
}
|
||||
|
||||
void AudioVisualWaveform::TrimIn(const rational &length)
|
||||
{
|
||||
for (auto it=mipmapped_data_.begin(); it!=mipmapped_data_.end(); it++) {
|
||||
rational rate = it->first;
|
||||
double rate_dbl = rate.toDouble();
|
||||
Sample& data = it->second;
|
||||
|
||||
int chop_length = time_to_samples(length, rate_dbl);
|
||||
|
||||
if (chop_length == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (chop_length > 0) {
|
||||
data = data.mid(chop_length);
|
||||
} else {
|
||||
data.insert(0, -chop_length, SamplePerChannel());
|
||||
}
|
||||
}
|
||||
|
||||
length_ -= length;
|
||||
}
|
||||
|
||||
AudioVisualWaveform::Sample AudioVisualWaveform::GetSummaryFromTime(const rational &start, const rational &length) const
|
||||
{
|
||||
// Find mipmap that requires
|
||||
|
||||
Reference in New Issue
Block a user