Skip to content

Commit

Permalink
Fix AFP playback indicator not shown when dragging and dropping sampl…
Browse files Browse the repository at this point in the history
…es (#7064)

The issue occurred because `AudioFileProcessorWaveView::updateSampleRange` was not being called in `AudioFileProcessorWaveView::dropEvent`.
  • Loading branch information
sakertooth authored Jan 14, 2024
1 parent af90aff commit b53f2b4
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions plugins/AudioFileProcessor/AudioFileProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,29 +611,26 @@ void AudioFileProcessorView::newWaveView()

void AudioFileProcessorView::dropEvent( QDropEvent * _de )
{
QString type = StringPairDrag::decodeKey( _de );
QString value = StringPairDrag::decodeValue( _de );
if( type == "samplefile" )
const auto type = StringPairDrag::decodeKey(_de);
const auto value = StringPairDrag::decodeValue(_de);

if (type == "samplefile") { castModel<AudioFileProcessor>()->setAudioFile(value); }
else if (type == QString("clip_%1").arg(static_cast<int>(Track::Type::Sample)))
{
castModel<AudioFileProcessor>()->setAudioFile( value );
_de->accept();
newWaveView();
return;
DataFile dataFile(value.toUtf8());
castModel<AudioFileProcessor>()->setAudioFile(dataFile.content().firstChild().toElement().attribute("src"));
}
else if( type == QString( "clip_%1" ).arg( static_cast<int>(Track::Type::Sample) ) )
else
{
DataFile dataFile( value.toUtf8() );
castModel<AudioFileProcessor>()->setAudioFile( dataFile.content().firstChild().toElement().attribute( "src" ) );
_de->accept();
_de->ignore();
return;
}

_de->ignore();
m_waveView->updateSampleRange();
Engine::getSong()->setModified();
_de->accept();
}




void AudioFileProcessorView::paintEvent( QPaintEvent * )
{
QPainter p( this );
Expand Down

0 comments on commit b53f2b4

Please sign in to comment.