fixed autoscroll feature in piano-roll (closes #2204508)

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1813 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-10-29 08:48:33 +00:00
parent ff0a8ab9dd
commit 19800a6971
3 changed files with 23 additions and 11 deletions

View File

@@ -1,3 +1,9 @@
2008-10-29 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* include/timeline.h:
* src/gui/piano_roll.cpp:
fixed autoscroll feature in piano-roll (closes #2204508)
2008-10-28 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* CMakeLists.txt:

View File

@@ -69,26 +69,31 @@ public:
return( m_pos );
}
AutoScrollStates autoScroll( void ) const
{
return m_autoScroll;
}
BehaviourAtStopStates behaviourAtStop( void ) const
{
return( m_behaviourAtStop );
return m_behaviourAtStop;
}
bool loopPointsEnabled( void ) const
{
return( m_loopPoints == LoopPointsEnabled );
return m_loopPoints == LoopPointsEnabled;
}
inline const midiTime & loopBegin( void ) const
{
return( ( m_loopPos[0] < m_loopPos[1] ) ?
m_loopPos[0] : m_loopPos[1] );
return ( m_loopPos[0] < m_loopPos[1] ) ?
m_loopPos[0] : m_loopPos[1];
}
inline const midiTime & loopEnd( void ) const
{
return( ( m_loopPos[0] > m_loopPos[1] ) ?
m_loopPos[0] : m_loopPos[1] );
return ( m_loopPos[0] > m_loopPos[1] ) ?
m_loopPos[0] : m_loopPos[1];
}
inline void savePos( const midiTime & _pos )
@@ -97,7 +102,7 @@ public:
}
inline const midiTime & savedPos( void ) const
{
return( m_savedPos );
return m_savedPos;
}
inline void setPixelsPerTact( float _ppt )
@@ -113,13 +118,13 @@ public:
virtual void loadSettings( const QDomElement & _this );
inline virtual QString nodeName( void ) const
{
return( "timeline" );
return "timeline";
}
inline int markerX( const midiTime & _t ) const
{
return( m_xOffset + static_cast<int>( ( _t - m_begin ) *
m_ppt / midiTime::ticksPerTact() ) );
return m_xOffset + static_cast<int>( ( _t - m_begin ) *
m_ppt / midiTime::ticksPerTact() );
}

View File

@@ -2670,7 +2670,8 @@ void pianoRoll::updatePosition( const midiTime & _t )
{
if( ( engine::getSong()->isPlaying() &&
engine::getSong()->playMode() ==
song::Mode_PlayPattern ) ||
song::Mode_PlayPattern &&
m_timeLine->autoScroll() == timeLine::AutoScrollEnabled ) ||
m_scrollBack == true )
{
const int w = width() - WHITE_KEY_WIDTH;