]> 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 371de3c19f1a518afae93e7d329c3968c8c7a175..09efe40ac74f32500660030088b389076fdc5409 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspgbase
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include "binarycontrol.h"
 #include "device.h"
 
@@ -28,16 +21,20 @@ BinaryControl::BinaryControl(Device &d, ControlSrcType t, unsigned i):
        threshold(0.5)
 { }
 
+BinaryControl::~BinaryControl()
+{ }
+
 void BinaryControl::set_threshold(float t)
 {
-       threshold=t;
+       threshold = t;
 }
 
 void BinaryControl::on_press()
 {
        if(!state)
        {
-               state=true;
+               state = true;
+               rising_edge = true;
                signal_press.emit();
        }
 }
@@ -46,7 +43,8 @@ void BinaryControl::on_release()
 {
        if(state)
        {
-               state=false;
+               state = false;
+               falling_edge = true;
                signal_release.emit();
        }
 }