From 5540a356f78e819e4be0bc4e20d291ded5bc2863 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 23 Jan 2014 23:34:52 +0100 Subject: [PATCH] AutomatableModel: added centerValue property The optional centerValue property can be used by views to display the center somehow. It defaults to minimum value. --- include/AutomatableModel.h | 11 +++++++++++ src/core/AutomatableModel.cpp | 1 + 2 files changed, 12 insertions(+) diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index 37fcf2c3c..40a4484ba 100644 --- a/include/AutomatableModel.h +++ b/include/AutomatableModel.h @@ -178,6 +178,16 @@ public: void setStep( const float step ); + float centerValue() const + { + return m_centerValue; + } + + void setCenterValue( const float centerVal ) + { + m_centerValue = centerVal; + } + static void linkModels( AutomatableModel* m1, AutomatableModel* m2 ); static void unlinkModels( AutomatableModel* m1, AutomatableModel* m2 ); @@ -241,6 +251,7 @@ private: float m_maxValue; float m_step; float m_range; + float m_centerValue; // most objects will need this temporarily (until sampleExact is // standard) diff --git a/src/core/AutomatableModel.cpp b/src/core/AutomatableModel.cpp index 54024af53..a9a3b5147 100644 --- a/src/core/AutomatableModel.cpp +++ b/src/core/AutomatableModel.cpp @@ -45,6 +45,7 @@ AutomatableModel::AutomatableModel( DataType type, m_maxValue( max ), m_step( step ), m_range( max - min ), + m_centerValue( m_minValue ), m_journalEntryReady( false ), m_setValueDepth( 0 ), m_hasLinkedModels( false ),