X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fsmoothcontrol.cpp;h=0532aef68ca66d62dc6d38808da0a08c07529eb9;hb=27356249e3607c78f5da9823c88703a6f4f7bed1;hp=3218753157628fc477c968acaa7a692673913b1d;hpb=8b985716894cd5f585a04a6253dd67060abe0b2f;p=libs%2Fgui.git diff --git a/source/input/smoothcontrol.cpp b/source/input/smoothcontrol.cpp index 3218753..0532aef 100644 --- a/source/input/smoothcontrol.cpp +++ b/source/input/smoothcontrol.cpp @@ -1,37 +1,22 @@ -#include #include "smoothcontrol.h" +#include using namespace std; namespace Msp { namespace Input { -SmoothControl::SmoothControl(): - value(0), - paired_ctrl(0), - dead_zone(0.1), - threshold(0.9) -{ } - SmoothControl::SmoothControl(const ControlSource &s): - Control(s), - value(0), - paired_ctrl(0), - dead_zone(0.1), - threshold(0.9) + Control(s) { } SmoothControl::SmoothControl(Device &d, ControlSrcType t, unsigned i): - Control(d, t, i), - value(0), - paired_ctrl(0), - dead_zone(0.1), - threshold(0.9) + Control(d, t, i) { } SmoothControl::~SmoothControl() { - pair(0); + pair(nullptr); } void SmoothControl::set_dead_zone(float d) @@ -64,8 +49,8 @@ void SmoothControl::pair(SmoothControl *ctrl) if(paired_ctrl) { SmoothControl *old_pair = paired_ctrl; - paired_ctrl = 0; - old_pair->pair(0); + paired_ctrl = nullptr; + old_pair->pair(nullptr); } paired_ctrl = ctrl;