]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/binarycontrol.cpp
Use default member initializers and defaulted default constructors
[libs/gui.git] / source / input / binarycontrol.cpp
index b0148ccf5332f023d22c1a9dfe436ba94fe93783..df07fb9eaf47c430d1a204f1dab7ad394d4e1491 100644 (file)
@@ -4,21 +4,12 @@
 namespace Msp {
 namespace Input {
 
-BinaryControl::BinaryControl():
-       state(false),
-       threshold(0.5)
-{ }
-
 BinaryControl::BinaryControl(const ControlSource &s):
-       Control(s),
-       state(false),
-       threshold(0.5)
+       Control(s)
 { }
 
 BinaryControl::BinaryControl(Device &d, ControlSrcType t, unsigned i):
-       Control(d, t, i),
-       state(false),
-       threshold(0.5)
+       Control(d, t, i)
 { }
 
 BinaryControl::~BinaryControl()
@@ -34,6 +25,7 @@ void BinaryControl::on_press()
        if(!state)
        {
                state = true;
+               rising_edge = true;
                signal_press.emit();
        }
 }
@@ -43,6 +35,7 @@ void BinaryControl::on_release()
        if(state)
        {
                state = false;
+               falling_edge = true;
                signal_release.emit();
        }
 }