Skip to content

Commit

Permalink
fixed data offset for AFP waveform vis
Browse files Browse the repository at this point in the history
the data itself isn't reversed, so we have to account for that
  • Loading branch information
RiedleroD committed Oct 4, 2024
1 parent a13faa2 commit 2b7a3bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/AudioFileProcessor/AudioFileProcessorWaveView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,12 @@ void AudioFileProcessorWaveView::updateGraph()
m_graph.fill(Qt::transparent);
QPainter p(&m_graph);
p.setPen(QColor(255, 255, 255));

const auto dataOffset = m_reversed ? m_sample->sampleSize() - m_to : m_from;

const auto rect = QRect{0, 0, m_graph.width(), m_graph.height()};
const auto waveform = SampleWaveform::Parameters{
m_sample->data() + m_from, static_cast<size_t>(range()), m_sample->amplification(), m_sample->reversed()};
m_sample->data() + dataOffset, static_cast<size_t>(range()), m_sample->amplification(), m_sample->reversed()};
SampleWaveform::visualize(waveform, p, rect);
}

Expand Down

0 comments on commit 2b7a3bf

Please sign in to comment.