-/* $Id$
-
-This file is part of libmspgbase
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#ifndef MSP_GBASE_BINARYCONTROL_H_
-#define MSP_GBASE_BINARYCONTROL_H_
+#ifndef MSP_INPUT_BINARYCONTROL_H_
+#define MSP_INPUT_BINARYCONTROL_H_
#include "control.h"
/**
A control with two possible states. Button state is mapped directly. An axis
-is considered to be active when its value is above a threshold (defined by the
-input device).
+is considered to be active when its value is above a threshold (0.5 by
+default).
*/
class BinaryControl: public Control
{
private:
bool state;
+ float threshold;
public:
BinaryControl();
BinaryControl(const ControlSource &);
BinaryControl(Device &, ControlSrcType, unsigned);
+ virtual ~BinaryControl();
+
+ /** Sets the threshold between states for axis sources. No effect on button
+ sources */
+ void set_threshold(float);
+
bool get_state() const { return state; }
private: