fixed several bugs responsible for clicks and pops
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@488 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "note.h"
|
||||
#include "instrument.h"
|
||||
#include "instrument_track.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
class notePlayHandle;
|
||||
@@ -70,6 +71,55 @@ public:
|
||||
m_releaseFramesDone >= m_releaseFramesToDo ) );
|
||||
}
|
||||
|
||||
bool willFinishThisPeriod( void ) const
|
||||
{
|
||||
f_cnt_t rftd = m_releaseFramesToDo;
|
||||
f_cnt_t fbr = m_framesBeforeRelease;
|
||||
f_cnt_t rfd = m_releaseFramesDone;
|
||||
if( m_released == TRUE )
|
||||
{
|
||||
f_cnt_t todo = engine::getMixer()->framesPerAudioBuffer();
|
||||
if( arpBaseNote() == TRUE )
|
||||
{
|
||||
rftd = rfd + 2 *
|
||||
engine::getMixer()->framesPerAudioBuffer();
|
||||
}
|
||||
if( fbr )
|
||||
{
|
||||
if( fbr <=
|
||||
engine::getMixer()->framesPerAudioBuffer() )
|
||||
{
|
||||
todo -= fbr;
|
||||
fbr = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
todo = 0;
|
||||
fbr -=
|
||||
engine::getMixer()->framesPerAudioBuffer();
|
||||
}
|
||||
}
|
||||
if( todo && rfd < rftd )
|
||||
{
|
||||
if( rftd - rfd >= todo )
|
||||
{
|
||||
rfd += todo;
|
||||
}
|
||||
else
|
||||
{
|
||||
rfd = rftd;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( arpBaseNote() == TRUE && m_subNotes.size() == 0 )
|
||||
{
|
||||
rfd = rftd;
|
||||
}
|
||||
|
||||
return( ( m_released && fbr == 0 && rfd >= rftd ) );
|
||||
}
|
||||
|
||||
virtual bool isFromTrack( const track * _track ) const;
|
||||
|
||||
|
||||
@@ -87,6 +137,7 @@ public:
|
||||
|
||||
f_cnt_t actualReleaseFramesToDo( void ) const;
|
||||
|
||||
|
||||
// returns how many samples this note is aligned ahead, i.e.
|
||||
// at which position it is inserted in the according buffer
|
||||
inline f_cnt_t framesAhead( void ) const
|
||||
|
||||
Reference in New Issue
Block a user