#include <string>
#include <sigc++/signal.h>
#include <sigc++/trackable.h>
+#include <msp/graphics/mspgui_api.h>
namespace Msp {
namespace Input {
enum ControlSrcType
{
- NONE,
+ NO_SOURCE,
BUTTON,
AXIS_POS,
AXIS_NEG
Specifies the source of a control. This provides a way for setting sources for
different types of controls in a uniform way.
*/
-struct ControlSource
+struct MSPGUI_API ControlSource
{
- Device *dev;
- ControlSrcType type;
- unsigned index;
+ Device *dev = nullptr;
+ ControlSrcType type = NO_SOURCE;
+ unsigned index = 0;
- ControlSource();
+ ControlSource() = default;
ControlSource(Device &, ControlSrcType, unsigned);
std::string str() const;
};
controls (when used on a BinaryControl) or click-and-drag functionality (when
used on a SmoothControl).
*/
-class Control: public sigc::trackable
+class MSPGUI_API Control: public sigc::trackable
{
public:
sigc::signal<void> signal_capture_complete;
protected:
ControlSource src;
- Device *capture_dev;
- BinaryControl *activator;
- float origin;
- bool rising_edge;
- bool falling_edge;
+ Device *capture_dev = nullptr;
+ BinaryControl *activator = nullptr;
+ float origin = 0.0f;
+ bool rising_edge = false;
+ bool falling_edge = false;
- Control();
+ Control() = default;
Control(const ControlSource &);
Control(Device &, ControlSrcType, unsigned);
public: