X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fcontrol.cpp;h=4f093573baeaf2418a2faf25ca881934b94aecae;hb=27356249e3607c78f5da9823c88703a6f4f7bed1;hp=fb1d37654b61b812c05bc1092f98158e7df50a16;hpb=294c354ae3b1f26887c37f866f082e52c08d80f1;p=libs%2Fgui.git diff --git a/source/input/control.cpp b/source/input/control.cpp index fb1d376..4f09357 100644 --- a/source/input/control.cpp +++ b/source/input/control.cpp @@ -15,7 +15,7 @@ ControlSource::ControlSource(Device &d, ControlSrcType t, unsigned i): index(i) { } -std::string ControlSource::str() const +string ControlSource::str() const { if(type==BUTTON) return dev->get_button_name(index); @@ -23,7 +23,7 @@ std::string ControlSource::str() const return dev->get_axis_name(index)+" +"; else if(type==AXIS_NEG) return dev->get_axis_name(index)+" -"; - else if(type==NONE) + else if(type==NO_SOURCE) return "None"; return lexical_cast(index); @@ -54,7 +54,7 @@ void Control::capture(Device &d) void Control::cancel_capture() { notify_callbacks(); - capture_dev = 0; + capture_dev = nullptr; connect_signals(); } @@ -87,7 +87,7 @@ void Control::connect_signals() { switch(src.type) { - case NONE: + case NO_SOURCE: break; case BUTTON: src.dev->signal_button_press.connect(sigc::bind_return(sigc::mem_fun(this, &Control::button_press), false)); @@ -112,7 +112,7 @@ void Control::button_press(unsigned i) src.index = i; notify_callbacks(); - capture_dev = 0; + capture_dev = nullptr; connect_signals(); signal_capture_complete.emit(); } @@ -130,20 +130,20 @@ void Control::axis_motion(unsigned i, float v, float r) { if(capture_dev) { - ControlSrcType type = NONE; + ControlSrcType type = NO_SOURCE; if(v<-0.9) type = AXIS_NEG; else if(v>0.9) type = AXIS_POS; - if(type!=NONE) + if(type!=NO_SOURCE) { src.dev = capture_dev; src.type = type; src.index = i; notify_callbacks(); - capture_dev = 0; + capture_dev = nullptr; connect_signals(); signal_capture_complete.emit(); }