X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fbinarycontrol.cpp;h=df07fb9eaf47c430d1a204f1dab7ad394d4e1491;hb=bc1a38d6d2c966a6aee74e483ca7a7d37a56909e;hp=b0148ccf5332f023d22c1a9dfe436ba94fe93783;hpb=5627c06b70fe2e8e926ed8d1d2d3fff0a33a503f;p=libs%2Fgui.git diff --git a/source/input/binarycontrol.cpp b/source/input/binarycontrol.cpp index b0148cc..df07fb9 100644 --- a/source/input/binarycontrol.cpp +++ b/source/input/binarycontrol.cpp @@ -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(); } }