diff options
author | Owen Williams <owilliams@mixxx.org> | 2015-05-07 11:47:16 -0400 |
---|---|---|
committer | Owen Williams <owilliams@mixxx.org> | 2015-05-07 11:47:16 -0400 |
commit | 65048eccc7c67f5aa95ee8b80b2423f5e433a2a3 (patch) | |
tree | b59218637ba421fb96d23444fddbea2d9d33a5d9 /src/control/control.cpp | |
parent | 116d7326a1a35f21643fff77acebd1dfaf0b6a53 (diff) |
Revert "Revert "Revert "Allow to set a value when initalize new COs"""
This reverts commit 759e142ef6437d3a980579f74269a01957ff723d.
Diffstat (limited to 'src/control/control.cpp')
-rw-r--r-- | src/control/control.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/control/control.cpp b/src/control/control.cpp index 17d30fa91b..7ba8ac815c 100644 --- a/src/control/control.cpp +++ b/src/control/control.cpp @@ -27,7 +27,7 @@ ControlDoublePrivate::ControlDoublePrivate() ControlDoublePrivate::ControlDoublePrivate(ConfigKey key, ControlObject* pCreatorCO, bool bIgnoreNops, bool bTrack, - double defaultValue, bool bPersist) + bool bPersist) : m_key(key), m_bPersistInConfiguration(bPersist), m_bIgnoreNops(bIgnoreNops), @@ -38,20 +38,20 @@ ControlDoublePrivate::ControlDoublePrivate(ConfigKey key, Stat::SAMPLE_VARIANCE | Stat::MIN | Stat::MAX), m_confirmRequired(false), m_pCreatorCO(pCreatorCO) { - initialize(defaultValue); + initialize(); } -void ControlDoublePrivate::initialize(double defaultValue) { - m_defaultValue.setValue(defaultValue); - double initialValue = defaultValue; +void ControlDoublePrivate::initialize() { + double value = 0; if (m_bPersistInConfiguration) { ConfigObject<ConfigValue>* pConfig = ControlDoublePrivate::s_pUserConfig; if (pConfig != NULL) { // Assume toDouble() returns 0 if conversion fails. - initialValue = pConfig->getValueString(m_key).toDouble(); + value = pConfig->getValueString(m_key).toDouble(); } } - m_value.setValue(initialValue); + m_defaultValue.setValue(0); + m_value.setValue(value); //qDebug() << "Creating:" << m_trackKey << "at" << &m_value << sizeof(m_value); @@ -101,7 +101,7 @@ void ControlDoublePrivate::insertAlias(const ConfigKey& alias, const ConfigKey& // static QSharedPointer<ControlDoublePrivate> ControlDoublePrivate::getControl( const ConfigKey& key, bool warn, ControlObject* pCreatorCO, - bool bIgnoreNops, bool bTrack, double defaultValue, bool bPersist) { + bool bIgnoreNops, bool bTrack, bool bPersist) { if (key.isNull()) { if (warn) { qWarning() << "ControlDoublePrivate::getControl returning NULL" @@ -130,7 +130,7 @@ QSharedPointer<ControlDoublePrivate> ControlDoublePrivate::getControl( if (pCreatorCO) { pControl = QSharedPointer<ControlDoublePrivate>( new ControlDoublePrivate(key, pCreatorCO, bIgnoreNops, - bTrack, defaultValue, bPersist)); + bTrack, bPersist)); locker.relock(); //qDebug() << "ControlDoublePrivate::s_qCOHash.insert(" << key.group << "," << key.item << ")"; s_qCOHash.insert(key, pControl); |