From 0b057ec5df31d76f06665d99de1193c182870445 Mon Sep 17 00:00:00 2001 From: NoiseByNorthwest Date: Mon, 13 Feb 2012 22:01:24 +0100 Subject: [PATCH] Fixed bugs with magnetic knobs The problem comes from AutomatableModel::m_initValue wich is not fitted either in constructor or in setter. Idem for m_value in constructor, imo this is not enough consistent. I propose to: - call fittedValue() in init value setter. - always call setter to initialize current & init values. --- src/core/AutomatableModel.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/AutomatableModel.cpp b/src/core/AutomatableModel.cpp index 607385c49..2207c3a3b 100644 --- a/src/core/AutomatableModel.cpp +++ b/src/core/AutomatableModel.cpp @@ -44,8 +44,6 @@ AutomatableModel::AutomatableModel( DataType _type, bool _default_constructed ) : Model( _parent, _display_name, _default_constructed ), m_dataType( _type ), - m_value( _val ), - m_initValue( _val ), m_minValue( _min ), m_maxValue( _max ), m_step( _step ), @@ -55,6 +53,7 @@ AutomatableModel::AutomatableModel( DataType _type, m_hasLinkedModels( false ), m_controllerConnection( NULL ) { + setInitValue( _val ); } @@ -473,7 +472,7 @@ void AutomatableModel::unlinkControllerConnection() void AutomatableModel::setInitValue( const float _value ) { - m_initValue = _value; + m_initValue = fittedValue( _value ); bool journalling = testAndSetJournalling( false ); setValue( _value ); setJournalling( journalling );