made song-length being cached and only updated upon changed length or position of TCOs
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@880 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -538,15 +538,18 @@ void song::playPattern( pattern * _patternToPlay, bool _loop )
|
||||
|
||||
|
||||
|
||||
tact song::lengthInTacts( void ) const
|
||||
void song::updateLength( void )
|
||||
{
|
||||
tact len = 0;
|
||||
m_length = 0;
|
||||
const QList<track *> & ctl = tracks();
|
||||
for( int i = 0; i < ctl.size(); ++i )
|
||||
{
|
||||
len = tMax( ctl[i]->length(), len );
|
||||
const tact cur = ctl[i]->length();
|
||||
if( cur > m_length )
|
||||
{
|
||||
m_length = cur;
|
||||
}
|
||||
}
|
||||
return( len );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -370,8 +370,8 @@ void exportProjectDialog::exportBtnClicked( void )
|
||||
&& !m_deleteFile )
|
||||
{
|
||||
dev->processNextBuffer();
|
||||
int pval = pp * 100 /
|
||||
( ( engine::getSong()->lengthInTacts() + 1 ) * 64 );
|
||||
const int pval = pp * 100 /
|
||||
( ( engine::getSong()->length() + 1 ) * 64 );
|
||||
m_exportProgressBar->setValue( pval );
|
||||
if( engine::getMainWindow() )
|
||||
{
|
||||
|
||||
@@ -378,7 +378,7 @@ songEditor::~songEditor()
|
||||
|
||||
void songEditor::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
m_leftRightScroll->setMaximum( m_s->lengthInTacts() );
|
||||
m_leftRightScroll->setMaximum( m_s->length() );
|
||||
trackContainerView::paintEvent( _pe );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user