]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/binarycontrol.cpp
Keep track of edges in Control
[libs/gui.git] / source / input / binarycontrol.cpp
index 57c63427839bda9ac6c1d41f5c234e100790d87d..09efe40ac74f32500660030088b389076fdc5409 100644 (file)
@@ -21,6 +21,9 @@ BinaryControl::BinaryControl(Device &d, ControlSrcType t, unsigned i):
        threshold(0.5)
 { }
 
+BinaryControl::~BinaryControl()
+{ }
+
 void BinaryControl::set_threshold(float t)
 {
        threshold = t;
@@ -31,6 +34,7 @@ void BinaryControl::on_press()
        if(!state)
        {
                state = true;
+               rising_edge = true;
                signal_press.emit();
        }
 }
@@ -40,6 +44,7 @@ void BinaryControl::on_release()
        if(state)
        {
                state = false;
+               falling_edge = true;
                signal_release.emit();
        }
 }