- moved getAutomationPattern to public

- added some checks and minor fixes


git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@195 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Javier Serrano Polo
2006-07-02 21:42:31 +00:00
parent f286c8bd2d
commit 73d1962fe2

View File

@@ -67,11 +67,11 @@ public:
m_minValue( _min ),
m_maxValue( _max ),
m_step( _step ),
m_curLevel( (int)( _val / _step ) ),
m_automation_pattern( NULL ),
m_track( _track ),
m_update_first( TRUE )
{
m_curLevel = level( _val );
m_minLevel = level( _min );
m_maxLevel = level( _max );
}
@@ -341,6 +341,17 @@ public:
m_data = _data;
}
inline automationPattern * getAutomationPattern( void )
{
if( !m_automation_pattern )
{
m_automation_pattern = new automationPattern( m_track,
this );
syncAutomationPattern();
}
return( m_automation_pattern );
}
protected:
virtual void redoStep( journalEntry & _je )
@@ -377,20 +388,9 @@ protected:
addJournalEntry( journalEntry( 0, value() - m_oldValue ) );
}
inline automationPattern * getAutomationPattern( void )
{
if( !m_automation_pattern )
{
m_automation_pattern = new automationPattern( m_track,
this );
syncAutomationPattern();
}
return( m_automation_pattern );
}
inline void setFirstValue( void )
{
if( m_update_first )
if( m_update_first && m_automation_pattern )
{
m_automation_pattern->putValue( midiTime( 0 ),
m_curLevel, FALSE );
@@ -402,6 +402,11 @@ protected:
}
}
inline bool nullTrack( void )
{
return( m_track == NULL );
}
private:
T m_value;