19 #ifndef _ardour_surfaces_m2pad_h_
20 #define _ardour_surfaces_m2pad_h_
42 virtual uint16_t
value ()
const {
return 0; }
43 virtual float pressure ()
const {
return 0.f; }
49 virtual void color (uint8_t& r, uint8_t& g, uint8_t& b)
const {
65 for (
int i = 0; i < 4; ++i) {
75 void color (uint8_t& r, uint8_t& g, uint8_t& b)
const
77 r = ((
_rgba >> 24) & 0xff) >> 1;
78 g = ((
_rgba >> 16) & 0xff) >> 1;
79 b = ((
_rgba >> 8) & 0xff) >> 1;
85 static const uint16_t high = 159;
86 static const float low = 159 / 4095.f;
87 static const float mindelta = 32.f / 4096.f;
103 const float p = v / 4095.f;
118 bool above_thresh =
true;
120 for (
int i = 0; i < 4; ++i) {
121 if (
hist[i] < high) {
122 above_thresh =
false;
125 max = std::max (max,
hist[i]);
virtual void color(uint8_t &r, uint8_t &g, uint8_t &b) const
PBD::Signal< void(float)> pressed
virtual float pressure() const
virtual void set_color(uint32_t rgba)
PBD::Signal< void(float)> aftertouch
PBD::Signal< void(float, bool)> event
virtual ~M2PadInterface()
PBD::Signal< void()> released
virtual void set_value(uint16_t v)
PBD::Signal< void(float)> changed
virtual uint16_t value() const
void set_value(uint16_t v)
void set_color(uint32_t rgba)
void color(uint8_t &r, uint8_t &g, uint8_t &b) const