summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-10-28 18:15:12 +0100
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-10-28 18:15:12 +0100
commit2c02ea592bc01914bbe48c9c472073cae69db9e4 (patch)
treea2eff98eeb7ea6ec610597265f979cae4c572108 /src/control
parent112fe1840113665eefa2f99195141b876b8f6c8b (diff)
ControlObject: Inline the static toBool() method
Diffstat (limited to 'src/control')
-rw-r--r--src/control/controlobject.cpp5
-rw-r--r--src/control/controlobject.h6
2 files changed, 5 insertions, 6 deletions
diff --git a/src/control/controlobject.cpp b/src/control/controlobject.cpp
index 770064f83b..543046e576 100644
--- a/src/control/controlobject.cpp
+++ b/src/control/controlobject.cpp
@@ -94,11 +94,6 @@ double ControlObject::get(const ConfigKey& key) {
return pCop ? pCop->get() : 0.0;
}
-// static
-bool ControlObject::toBool(const ConfigKey& key) {
- return ControlObject::get(key) > 0;
-}
-
double ControlObject::getParameter() const {
return m_pControl ? m_pControl->getParameter() : 0.0;
}
diff --git a/src/control/controlobject.h b/src/control/controlobject.h
index b0c7cfaa72..22a6d49b93 100644
--- a/src/control/controlobject.h
+++ b/src/control/controlobject.h
@@ -86,7 +86,11 @@ class ControlObject : public QObject {
// Instantly returns the value of the ControlObject
static double get(const ConfigKey& key);
- static bool toBool(const ConfigKey& key);
+
+ /// Returns the boolean interpretation of the ControlObject's value.
+ static bool toBool(const ConfigKey& key) {
+ return ControlObject::get(key) > 0;
+ }
// Sets the ControlObject value. May require confirmation by owner.
inline void set(double value) {