X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fsurfaces%2Fmackie%2Ftypes.h;h=be5c7e8b79e49295541069d0c8cae4ed11099e9f;hb=96cd6c993b0ed9a775f7ea096e2afe01be9d00b9;hp=2b47e156408bfb7e2d1e1cf9f5f4d52e73a79aa7;hpb=449aab3c465bbbf66d221fac3d7ea559f1720357;p=ardour.git diff --git a/libs/surfaces/mackie/types.h b/libs/surfaces/mackie/types.h index 2b47e15640..be5c7e8b79 100644 --- a/libs/surfaces/mackie/types.h +++ b/libs/surfaces/mackie/types.h @@ -18,6 +18,8 @@ #ifndef mackie_types_h #define mackie_types_h +#include + namespace Mackie { @@ -62,23 +64,34 @@ enum ButtonState { neither = -1, release = 0, press = 1 }; */ struct ControlState { - ControlState(): pos(0.0), delta(0.0), button_state(neither) {} + ControlState(): pos(0.0), sign(0), delta(0.0), ticks(0), led_state(off), button_state(neither) {} ControlState( LedState ls ): pos(0.0), delta(0.0), led_state(ls), button_state(neither) {} // Note that this sets both pos and delta to the flt value ControlState( LedState ls, float flt ): pos(flt), delta(flt), ticks(0), led_state(ls), button_state(neither) {} ControlState( float flt ): pos(flt), delta(flt), ticks(0), led_state(none), button_state(neither) {} - ControlState( float flt, int tcks ): pos(flt), delta(flt), ticks(tcks), led_state(none), button_state(neither) {} + ControlState( float flt, unsigned int tcks ): pos(flt), delta(flt), ticks(tcks), led_state(none), button_state(neither) {} ControlState( ButtonState bs ): pos(0.0), delta(0.0), ticks(0), led_state(none), button_state(bs) {} + /// For faders. Between 0 and 1. float pos; + + /// For pots. Sign. Either -1 or 1; + int sign; + + /// For pots. Signed value of total movement. Between 0 and 1 float delta; - int ticks; + + /// For pots. Unsigned number of ticks. Usually between 1 and 16. + unsigned int ticks; + LedState led_state; ButtonState button_state; }; +std::ostream & operator << ( std::ostream &, const ControlState & ); + class Control; class Fader; class Button;