19 #ifndef _ardour_surfaces_fp8button_h_
20 #define _ardour_surfaces_fp8button_h_
82 , _ignore_release (false)
99 if (_ignore_release) {
100 _ignore_release =
false;
110 _ignore_release =
true;
117 if (yes && !_blinking) {
119 _base.BlinkIt.connect_same_thread (_blink_connection, std::bind (&FP8ButtonBase::blink,
this, _1));
120 }
else if (!yes && _blinking) {
121 _blink_connection.disconnect ();
133 virtual void blink (
bool onoff) = 0;
152 if (_active == a && !force_change) {
156 _base.tx_midi3 (0x90, _midi_id, a ? 0x7f : 0x00);
161 if (!_has_color || _rgba == rgba) {
165 _base.tx_midi3 (0x91, _midi_id, (_rgba >> 25) & 0x7f);
166 _base.tx_midi3 (0x92, _midi_id, (_rgba >> 17) & 0x7f);
167 _base.tx_midi3 (0x93, _midi_id, (_rgba >> 9) & 0x7f);
173 if (!_active) {
return; }
174 _base.tx_midi3 (0x90, _midi_id, onoff ? 0x7f : 0x00);
203 uint32_t
color ()
const {
return _rgba; }
213 return FP8ButtonBase::midi_event (a);
218 if (_active == a && !force_change) {
236 if (!_active) {
return; }
237 ActiveChanged (onoff);
254 _b0.ActiveChanged.connect_same_thread (_button_connections, std::bind (&FP8DualButton::active_changed,
this,
false, _1));
255 _b1.ActiveChanged.connect_same_thread (_button_connections, std::bind (&FP8DualButton::active_changed,
this,
true, _1));
257 _b0.ColourChanged.connect_same_thread (_button_connections, std::bind (&FP8DualButton::colour_changed,
this,
false));
258 _b1.ColourChanged.connect_same_thread (_button_connections, std::bind (&FP8DualButton::colour_changed,
this,
true));
263 return (_shift ? _b1 : _b0).set_pressed (a);
277 _base.tx_midi3 (0x90, _midi_id, a ? 0x7f : 0x00);
281 if (s != _shift || !_has_color) {
284 uint32_t rgba = (_shift ? _b1 : _b0).
color ();
289 _base.tx_midi3 (0x91, _midi_id, (rgba >> 25) & 0x7f);
290 _base.tx_midi3 (0x92, _midi_id, (rgba >> 17) & 0x7f);
291 _base.tx_midi3 (0x93, _midi_id, (rgba >> 9) & 0x7f);
303 if (_shift ==
shift) {
306 (_shift ? _b1 : _b0).set_pressed (
false);
308 active_changed (_shift, (_shift ? _b1 : _b0).is_active());
309 colour_changed (_shift);
334 _base.ShiftButtonChange.connect_same_thread (_shift_connection, std::bind (&FP8ShiftSensitiveButton::shift_changed,
this, _1));
353 _base.ARMButtonChange.connect_same_thread (_arm_connection, std::bind (&FP8ARMSensitiveButton::shift_changed,
this, _1));
373 _hold_connection.disconnect ();
380 if (_active == a && !force_change) {
384 _base.tx_midi3 (0x90, _midi_id, a ? 0x7f : 0x00);
389 _was_active_on_press =
false;
390 _hold_connection.disconnect ();
404 _was_active_on_press = _active;
410 Glib::RefPtr<Glib::TimeoutSource> hold_timer =
411 Glib::TimeoutSource::create (500);
412 hold_timer->attach (
fp8_loop()->get_context());
413 _hold_connection = hold_timer->connect (sigc::mem_fun (*
this, &FP8MomentaryButton::hold_timeout));
414 }
else if (!a && _was_active_on_press) {
415 _hold_connection.disconnect ();
418 }
else if (!a && _momentaty) {
419 _hold_connection.disconnect ();
430 _base.tx_midi3 (0x90, _midi_id, _active ? 0x7f : 0x00);
433 _base.tx_midi3 (0x90, _midi_id, onoff ? 0x7f : 0x00);
467 bool rv = FP8Button::midi_event (a);
476 _press_timeout_connection.disconnect ();
484 Glib::RefPtr<Glib::TimeoutSource> press_timer =
485 Glib::TimeoutSource::create (100);
486 press_timer->attach (
fp8_loop()->get_context());
487 _press_timeout_connection = press_timer->connect (sigc::mem_fun (*
this, &FP8RepeatButton::repeat_press));
PBD::PropertyDescriptor< uint32_t > color
PBD::PropertyDescriptor< float > shift
BaseUI::RequestType StateChange