X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fbinarycontrol.cpp;h=df07fb9eaf47c430d1a204f1dab7ad394d4e1491;hb=507fa60f32bd3f64840a2cdd1be5d68478432b55;hp=57c63427839bda9ac6c1d41f5c234e100790d87d;hpb=821cea8627597a5458c1cb02c0652384bb3431a4;p=libs%2Fgui.git diff --git a/source/input/binarycontrol.cpp b/source/input/binarycontrol.cpp index 57c6342..df07fb9 100644 --- a/source/input/binarycontrol.cpp +++ b/source/input/binarycontrol.cpp @@ -4,21 +4,15 @@ 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() { } void BinaryControl::set_threshold(float t) @@ -31,6 +25,7 @@ void BinaryControl::on_press() if(!state) { state = true; + rising_edge = true; signal_press.emit(); } } @@ -40,6 +35,7 @@ void BinaryControl::on_release() if(state) { state = false; + falling_edge = true; signal_release.emit(); } }