From 73d1962fe2d280126695579eb0f419b88080f1d7 Mon Sep 17 00:00:00 2001 From: Javier Serrano Polo Date: Sun, 2 Jul 2006 21:42:31 +0000 Subject: [PATCH] - 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 --- include/automatable_object.h | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/include/automatable_object.h b/include/automatable_object.h index 68574e017..4dee5f04f 100755 --- a/include/automatable_object.h +++ b/include/automatable_object.h @@ -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;