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

@@ -71,7 +71,7 @@ public:
{
return m_isBackwards;
}
inline void setBackwards( bool _backwards )
{
m_isBackwards = _backwards;
@@ -81,7 +81,7 @@ public:
private:
f_cnt_t m_frameIndex;
const bool m_varyingPitch;
bool m_isBackwards;
bool m_isBackwards;
SRC_STATE * m_resamplingData;
friend class SampleBuffer;
@@ -148,6 +148,16 @@ public:
m_varLock.unlock();
}
void setAllPointFrames( f_cnt_t _start, f_cnt_t _end, f_cnt_t _loopstart, f_cnt_t _loopend )
{
m_varLock.lock();
m_startFrame = _start;
m_endFrame = _end;
m_loopStartFrame = _loopstart;
m_loopEndFrame = _loopend;
m_varLock.unlock();
}
inline f_cnt_t frames() const
{
return m_frames;