X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fsmoothcontrol.h;h=11744ddc7fc6f4e4248580bd5b77e141a91745ca;hb=43d31e73c4b97a37017757232c4ef1db355fee3a;hp=2e964bd32c62784cb9370e7cfa34cec69b27d6c5;hpb=daf317db7a79a4c92880042125814ca942c3a6fa;p=libs%2Fgui.git diff --git a/source/input/smoothcontrol.h b/source/input/smoothcontrol.h index 2e964bd..11744dd 100644 --- a/source/input/smoothcontrol.h +++ b/source/input/smoothcontrol.h @@ -1,12 +1,5 @@ -/* $Id$ - -This file is part of libmspgbase -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#ifndef MSP_GBASE_SMOOTHCONTROL_H_ -#define MSP_GBASE_SMOOTHCONTROL_H_ +#ifndef MSP_INPUT_SMOOTHCONTROL_H_ +#define MSP_INPUT_SMOOTHCONTROL_H_ #include "control.h" @@ -36,21 +29,25 @@ public: SmoothControl(); SmoothControl(const ControlSource &); SmoothControl(Device &, ControlSrcType, unsigned); - virtual ~SmoothControl(); + ~SmoothControl(); /// Sets the dead zone value. Any value below this will be treated as 0. void set_dead_zone(float); - /// Sets the max-out threshold. Any value above this will be treated as 1. + /** Sets the max-out threshold. Any value above this will be treated as 1. + A negative value can be used to disable the threshold entirely. */ void set_threshold(float); + /// Sets dead zone and threshold in a single function call. + void set_range(float, float); + void pair(SmoothControl *ctrl); float get_value() const { return value; } private: - virtual void on_press(); - virtual void on_release(); - virtual void on_motion(float, float); + void on_press() override; + void on_release() override; + void on_motion(float, float) override; }; } // namespace Input