From 523c198341aa863366f69c516a38e55e2b8d8daf Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Wed, 20 Aug 2008 11:26:44 +0000 Subject: [PATCH] when connected to controller and returning current value, respect step-property of automatableModel git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1447 0778d3d1-df1d-0410-868b-ea421aaaa00d --- include/automatable_model.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/automatable_model.h b/include/automatable_model.h index a99457518..dc0caa650 100644 --- a/include/automatable_model.h +++ b/include/automatable_model.h @@ -118,10 +118,15 @@ public: { if( m_controllerConnection != NULL ) { - return minValue() + + const float v = minValue() + castValue( m_range * m_controllerConnection->currentValue( _frameOffset ) ); + if( m_step != 0 ) + { + return( roundf( v / m_step ) * m_step ); + } + return( v ); } return castValue( m_value );