SampleBuffer: fix a segfault when moving a loop point while playing a note, also do some sptring cleanup (some unused/redundant variables removed)

Also, some codepath optimization: add a method to SampleBuffer for setting all loop/start/endpoints at once, so we don't have to wait for mutex unlocks 4 times in a row. Then make AFP utilize this method.
This commit is contained in:
Vesa
2014-04-04 02:48:04 +03:00
parent 19aec58abc
commit afa1275af9
3 changed files with 41 additions and 57 deletions

View File

@@ -356,10 +356,7 @@ void audioFileProcessor::loopPointChanged( void )
m_nextPlayStartPoint = f_start;
m_nextPlayBackwards = false;
m_sampleBuffer.setStartFrame( f_start );
m_sampleBuffer.setEndFrame( f_end );
m_sampleBuffer.setLoopStartFrame( f_loop );
m_sampleBuffer.setLoopEndFrame( f_end );
m_sampleBuffer.setAllPointFrames( f_start, f_end, f_loop, f_end );
emit dataChanged();
}
@@ -735,11 +732,6 @@ void AudioFileProcessorWaveView::mousePressEvent( QMouseEvent * _me )
if( start_dist < loop_dist ) { dt = sample_start; md = start_dist; }
else if( end_dist < loop_dist ) { dt = sample_end; md = end_dist; }
/* qDebug( "x %d", x );
qDebug( "loopframex %d", m_loopFrameX );
qDebug( "dt %d", dt );
qDebug( "md %d", md );*/
if( md < 4 )
{
m_draggingType = dt;