Skip to content

Commit

Permalink
Remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
khoidauminh committed Jul 12, 2024
1 parent b903d9f commit 7a393ef
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 26 deletions.
6 changes: 0 additions & 6 deletions plugins/AudioFileProcessor/AudioFileProcessorWaveView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,6 @@ void AudioFileProcessorWaveView::updateGraph()
QPainter p(&m_graph);
p.setPen(QColor(255, 255, 255));

//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()};
//SampleWaveform::visualize(waveform, p, rect);

// Performance hit is neglectable
m_thumbnaillist = SampleThumbnailListManager(*m_sample);

auto param = SampleThumbnailVisualizeParameters();
Expand Down
7 changes: 1 addition & 6 deletions plugins/SlicerT/SlicerTWaveform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ void SlicerTWaveform::drawSeekerWaveform()
brush.setPen(s_waveformColor);

const auto& sample = m_slicerTParent->m_originalSample;
//const auto waveform = SampleWaveform::Parameters{sample.data(), sample.sampleSize(), sample.amplification(), sample.reversed()};
//const auto rect = QRect(0, 0, m_seekerWaveform.width(), m_seekerWaveform.height());
//SampleWaveform::visualize(waveform, brush, rect);

m_thumbnaillist = SampleThumbnailListManager(sample);
auto param = SampleThumbnailVisualizeParameters();
Expand Down Expand Up @@ -160,10 +157,8 @@ void SlicerTWaveform::drawEditorWaveform()
brush.setPen(s_waveformColor);
long zoomOffset = (m_editorHeight - m_zoomLevel * m_editorHeight) / 2;

// Visualize
const auto& sample = m_slicerTParent->m_originalSample;
//const auto waveform = SampleWaveform::Parameters{sample.data() + startFrame, endFrame - startFrame, sample.amplification(), sample.reversed()};
//const auto rect = QRect(0, zoomOffset, m_editorWidth, m_zoomLevel * m_editorHeight);
//SampleWaveform::visualize(waveform, brush, rect);

m_thumbnaillist = SampleThumbnailListManager(sample);
auto param = SampleThumbnailVisualizeParameters();
Expand Down
14 changes: 4 additions & 10 deletions src/gui/clips/SampleClipView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,23 +272,16 @@ void SampleClipView::paintEvent( QPaintEvent * pe )
float den = Engine::getSong()->getTimeSigModel().getDenominator();
float ticksPerBar = DefaultTicksPerBar * nom / den;

// Visualize
float offsetStart = m_clip->startTimeOffset() / ticksPerBar * pixelsPerBar();
float sampleLength = m_clip->sampleLength() * ppb / ticksPerBar;
float clipLength = m_clip->length() * ppb / ticksPerBar;
// qDebug("%d %d", (int) offset_start, (int) length);

const auto& sample = m_clip->m_sample;
// const auto waveform = SampleWaveform::Parameters{sample.data(), sample.sampleSize(), sample.amplification(), sample.reversed()};
// SampleWaveform::visualize(waveform, p, r);

// qDebug("parent size %d %d", parentWidget()->width(), parentWidget()->height());
//~ qDebug("ratio %f", ratio);

//qDebug("%f %f", offset_end, length);


auto param = SampleThumbnailVisualizeParameters();

param.amplification = sample.amplification();
param.amplification = sample.amplification();
param.reversed = sample.reversed();

param.x = static_cast<long>(offsetStart);
Expand All @@ -300,6 +293,7 @@ void SampleClipView::paintEvent( QPaintEvent * pe )
param.clipWidthSinceSampleStart = static_cast<long>(clipLength - offsetStart);

m_thumbnaillist.visualize(param, p);
//

QString name = PathUtil::cleanName(m_clip->m_sample.sampleFile());
paintTextLabel(name, p);
Expand Down
4 changes: 0 additions & 4 deletions src/gui/editors/AutomationEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1221,10 +1221,6 @@ void AutomationEditor::paintEvent(QPaintEvent * pe )
p.setPen(m_ghostSampleColor);

const auto& sample = m_ghostSample->sample();
//const auto waveform = SampleWaveform::Parameters{
//sample.data(), sample.sampleSize(), sample.amplification(), sample.reversed()};
//const auto rect = QRect(startPos, yOffset, sampleWidth, sampleHeight);
//SampleWaveform::visualize(waveform, p, rect);

auto param = SampleThumbnailVisualizeParameters();

Expand Down

0 comments on commit 7a393ef

Please sign in to comment.