summaryrefslogtreecommitdiff
path: root/libs/surfaces/faderport8/actions.cc
blob: 27fdce1a667708ac5f67fc13a2b4a9550dc65282 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
/*
 * Copyright (C) 2017-2018 Robin Gareus <robin@gareus.org>
 * Copyright (C) 2018 Ben Loftis <ben@harrisonconsoles.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

/* Faderport 8 Control Surface
 * This is the button "Controller" of the MVC surface inteface,
 * see callbacks.cc for the "View".
 */

#include "ardour/dB.h"
#include "ardour/plugin_insert.h"
#include "ardour/session.h"
#include "ardour/session_configuration.h"
#include "ardour/track.h"
#include "ardour/types.h"

#include "gtkmm2ext/actions.h"

#include "faderport8.h"

#include "pbd/i18n.h"

using namespace std;
using namespace ARDOUR;
using namespace ArdourSurface::FP_NAMESPACE;
using namespace ArdourSurface::FP_NAMESPACE::FP8Types;

#define BindMethod(ID, CB) \
	_ctrls.button (FP8Controls::ID).released.connect_same_thread (button_connections, boost::bind (&FaderPort8:: CB, this));

#define BindMethod2(ID, ACT, CB) \
	_ctrls.button (FP8Controls::ID). ACT .connect_same_thread (button_connections, boost::bind (&FaderPort8:: CB, this));

#define BindFunction(ID, ACT, CB, ...) \
	_ctrls.button (FP8Controls::ID). ACT .connect_same_thread (button_connections, boost::bind (&FaderPort8:: CB, this, __VA_ARGS__));

#define BindAction(ID, GRP, ITEM) \
	_ctrls.button (FP8Controls::ID).released.connect_same_thread (button_connections, boost::bind (&FaderPort8::button_action, this, GRP, ITEM));

#define BindUserAction(ID) \
	_ctrls.button (ID).pressed.connect_same_thread (button_connections, boost::bind (&FaderPort8::button_user, this, true, ID)); \
_ctrls.button (ID).released.connect_same_thread (button_connections, boost::bind (&FaderPort8::button_user, this, false, ID));


/* Bind button signals (press, release) to callback methods
 * (called once after constructing buttons).
 * Bound actions are handled the the ctrl-surface thread.
 */
void
FaderPort8::setup_actions ()
{
	BindMethod2 (BtnPlay, pressed, button_play);
	BindMethod2 (BtnStop, pressed, button_stop);
	BindMethod2 (BtnLoop, pressed, button_loop);
	BindMethod2 (BtnRecord, pressed, button_record);
	BindMethod2 (BtnClick, pressed, button_metronom);
	BindAction (BtnRedo, "Editor", "redo");

	BindAction (BtnSave, "Common", "Save");
	BindAction (BtnUndo, "Editor", "undo");
	BindAction (BtnRedo, "Editor", "redo");

#ifdef FP8_MUTESOLO_UNDO
	BindMethod (BtnSoloClear, button_solo_clear);
#else
	BindAction (BtnSoloClear, "Main", "cancel-solo");
#endif
	BindMethod (BtnMuteClear, button_mute_clear);

	BindMethod (FP8Controls::BtnArmAll, button_arm_all);

	BindFunction (BtnRewind, pressed, button_varispeed, false);
	BindFunction (BtnFastForward, pressed, button_varispeed, true);

	BindFunction (BtnPrev, released, button_prev_next, false);
	BindFunction (BtnNext, released, button_prev_next, true);

	BindFunction (BtnArm, pressed, button_arm, true);
	BindFunction (BtnArm, released, button_arm, false);

	BindFunction (BtnAOff, released, button_automation, ARDOUR::Off);
	BindFunction (BtnATouch, released, button_automation, ARDOUR::Touch);
	BindFunction (BtnARead, released, button_automation, ARDOUR::Play);
	BindFunction (BtnAWrite, released, button_automation, ARDOUR::Write);
	BindFunction (BtnALatch, released, button_automation, ARDOUR::Latch);

	_ctrls.button (FP8Controls::BtnEncoder).pressed.connect_same_thread (button_connections, boost::bind (&FaderPort8::button_encoder, this));
#ifdef FADERPORT2
	_ctrls.button (FP8Controls::BtnParam).pressed.connect_same_thread (button_connections, boost::bind (&FaderPort8::button_encoder, this));
#else
	_ctrls.button (FP8Controls::BtnParam).pressed.connect_same_thread (button_connections, boost::bind (&FaderPort8::button_parameter, this));
#endif


	BindMethod (BtnBypass, button_bypass);
	BindAction (BtnBypassAll, "Mixer", "ab-plugins");

	BindAction (BtnMacro, "Common", "toggle-editor-and-mixer");
	BindMethod (BtnOpen, button_open);

	BindMethod (BtnLink, button_link);
	BindMethod (BtnLock, button_lock);

#ifdef FADERPORT2
	BindMethod (BtnChanLock, button_chanlock);
	BindMethod (BtnFlip, button_flip);
#endif

	// user-specific
	for (FP8Controls::UserButtonMap::const_iterator i = _ctrls.user_buttons ().begin ();
			i != _ctrls.user_buttons ().end (); ++i) {
		BindUserAction ((*i).first);
	}
}

/* ****************************************************************************
 * Direct control callback Actions
 */

void
FaderPort8::button_play ()
{
	if (session->transport_rolling ()) {
		if (session->transport_speed () != 1.0) {
			session->request_transport_speed (1.0);
		} else {
			transport_stop ();
		}
	} else {
		transport_play ();
	}
}

void
FaderPort8::button_stop ()
{
	if (session->transport_rolling ()) {
		transport_stop ();
	} else {
		AccessAction ("Transport", "GotoStart");
	}
}

void
FaderPort8::button_record ()
{
	set_record_enable (!get_record_enabled ());
}

void
FaderPort8::button_loop ()
{
	loop_toggle ();
}

void
FaderPort8::button_metronom ()
{
	Config->set_clicking (!Config->get_clicking ());
}

void
FaderPort8::button_bypass ()
{
	boost::shared_ptr<PluginInsert> pi = _plugin_insert.lock();
	if (pi) {
		pi->enable (! pi->enabled ());
	} else {
		AccessAction ("Mixer", "ab-plugins");
	}
}

void
FaderPort8::button_open ()
{
	boost::shared_ptr<PluginInsert> pi = _plugin_insert.lock();
	if (pi) {
		pi->ToggleUI (); /* EMIT SIGNAL */
	} else {
		AccessAction ("Common", "addExistingAudioFiles");
	}
}

void
FaderPort8::button_chanlock ()
{
	_chan_locked = !_chan_locked;

	_ctrls.button (FP8Controls::BtnChannel).set_blinking (_chan_locked);
}

void
FaderPort8::button_flip ()
{
}

void
FaderPort8::button_lock ()
{
	if (!_link_enabled) {
		AccessAction ("Editor", "lock");
		return;
	}
	if (_link_locked) {
		unlock_link ();
	} else if (!_link_control.expired ()) {
		lock_link ();
	}
}

void
FaderPort8::button_link ()
{
	switch (_ctrls.fader_mode()) {
		case ModeTrack:
		case ModePan:
			if (_link_enabled) {
				stop_link ();
			} else {
				start_link ();
			}
			break;
		default:
			//AccessAction ("Window", "show-mixer");
			break;
	}
}

void
FaderPort8::button_automation (ARDOUR::AutoState as)
{
	FaderMode fadermode = _ctrls.fader_mode ();
	switch (fadermode) {
		case ModePlugins:
#if 0 // Plugin Control Automation Mode
			for (std::list <ProcessorCtrl>::iterator i = _proc_params.begin(); i != _proc_params.end(); ++i) {
				((*i).ac)->set_automation_state (as);
			}
#endif
			return;
		case ModeSend:
			if (first_selected_stripable()) {
#if 0 // Send Level Automation
				boost::shared_ptr<Stripable> s = first_selected_stripable();
				boost::shared_ptr<AutomationControl> send;
				uint32_t i = 0;
				while (0 != (send = s->send_level_controllable (i))) {
					send->set_automation_state (as);
					++i;
				}
#endif
			}
			return;
		default:
			break;
	}

	// TODO link/lock control automation?

	// apply to all selected tracks
	StripableList all;
	session->get_stripables (all);
	for (StripableList::const_iterator i = all.begin(); i != all.end(); ++i) {
		if ((*i)->is_master() || (*i)->is_monitor()) {
			continue;
		}
		if (!(*i)->is_selected()) {
			continue;
		}
		boost::shared_ptr<AutomationControl> ac;
		switch (fadermode) {
			case ModeTrack:
				ac = (*i)->gain_control ();
				break;
			case ModePan:
				ac = (*i)->pan_azimuth_control ();
				break;
			default:
				break;
		}
		if (ac) {
			ac->set_automation_state (as);
		}
	}
}

void
FaderPort8::button_varispeed (bool ffw)
{
	/* pressing both rew + ffwd -> return to zero */
	FP8ButtonInterface& b_rew = _ctrls.button (FP8Controls::BtnRewind);
	FP8ButtonInterface& b_ffw = _ctrls.button (FP8Controls::BtnFastForward);
	if (b_rew.is_pressed () && b_ffw.is_pressed ()){
		// stop key-repeat
		dynamic_cast<FP8RepeatButton*>(&b_ffw)->stop_repeat();
		dynamic_cast<FP8RepeatButton*>(&b_rew)->stop_repeat();
		session->request_locate (0, false);
		return;
	}

	// switch play direction, if needed
	if (ffw) {
		if (session->transport_speed () <= 0) {
			session->request_transport_speed (1.0);
			return ;
		}
	} else {
		if (session->transport_speed () >= 0) {
			session->request_transport_speed (-1.0);
			return ;
		}
	}
	// incremetally increase speed. double speed every 10 clicks
	// (keypress auto-repeat is 100ms)
	float maxspeed = Config->get_shuttle_max_speed();
	float speed = exp2f(0.1f) * session->transport_speed ();
	speed = std::max (-maxspeed, std::min (maxspeed, speed));
	session->request_transport_speed (speed, false);
}

#ifdef FP8_MUTESOLO_UNDO
void
FaderPort8::button_solo_clear ()
{
	bool soloing = session->soloing() || session->listening();
#ifdef MIXBUS
	soloing |= session->mixbus_soloed();
#endif
	if (soloing) {
		StripableList all;
		session->get_stripables (all);
		for (StripableList::const_iterator i = all.begin(); i != all.end(); ++i) {
			if ((*i)->is_master() || (*i)->is_auditioner() || (*i)->is_monitor()) {
				continue;
			}
			boost::shared_ptr<SoloControl> sc = (*i)->solo_control();
			if (sc && sc->self_soloed ()) {
				_solo_state.push_back (boost::weak_ptr<AutomationControl>(sc));
			}
		}
		cancel_all_solo (); // AccessAction ("Main", "cancel-solo");
	} else {
		/* restore solo */
		boost::shared_ptr<ControlList> cl (new ControlList);
		for (std::vector <boost::weak_ptr<AutomationControl> >::const_iterator i = _solo_state.begin(); i != _solo_state.end(); ++i) {
			boost::shared_ptr<AutomationControl> ac = (*i).lock();
			if (!ac) {
				continue;
			}
			ac->start_touch (ac->session().transport_sample());
			cl->push_back (ac);
		}
		if (!cl->empty()) {
			session->set_controls (cl, 1.0, PBD::Controllable::NoGroup);
		}
	}
}
#endif

void
FaderPort8::button_mute_clear ()
{
#ifdef FP8_MUTESOLO_UNDO
	if (session->muted ()) {
		_mute_state = session->cancel_all_mute ();
	} else {
		/* restore mute */
		boost::shared_ptr<ControlList> cl (new ControlList);
		for (std::vector <boost::weak_ptr<AutomationControl> >::const_iterator i = _mute_state.begin(); i != _mute_state.end(); ++i) {
			boost::shared_ptr<AutomationControl> ac = (*i).lock();
			if (!ac) {
				continue;
			}
			cl->push_back (ac);
			ac->start_touch (ac->session().transport_sample());
		}
		if (!cl->empty()) {
			session->set_controls (cl, 1.0, PBD::Controllable::NoGroup);
		}
	}
#else
	session->cancel_all_mute ();
#endif
}

void
FaderPort8::button_arm_all ()
{
	BasicUI::all_tracks_rec_in ();
}

/* access generic action */
void
FaderPort8::button_action (const std::string& group, const std::string& item)
{
	AccessAction (group, item);
}

/* ****************************************************************************
 * Control Interaction (encoder)
 */

void
FaderPort8::handle_encoder_pan (int steps)
{
	boost::shared_ptr<Stripable> s = first_selected_stripable();
	if (s) {
		boost::shared_ptr<AutomationControl> ac;
		if (shift_mod () || _ctrls.fader_mode() == ModePan) {
			ac = s->pan_width_control ();
		} else {
			ac = s->pan_azimuth_control ();
		}
		if (ac) {
			ac->start_touch (ac->session().transport_sample());
			if (steps == 0) {
				ac->set_value (ac->normal(), PBD::Controllable::UseGroup);
			} else {
				double v = ac->internal_to_interface (ac->get_value());
				v = std::max (0.0, std::min (1.0, v + steps * .01));
				ac->set_value (ac->interface_to_internal(v), PBD::Controllable::UseGroup);
			}
		}
	}
}

void
FaderPort8::handle_encoder_link (int steps)
{
	if (_link_control.expired ()) {
		return;
	}
	boost::shared_ptr<AutomationControl> ac = boost::dynamic_pointer_cast<AutomationControl> (_link_control.lock ());
	if (!ac) {
		return;
	}

	double v = ac->internal_to_interface (ac->get_value());
	ac->start_touch (ac->session().transport_sample());

	if (steps == 0) {
		ac->set_value (ac->normal(), PBD::Controllable::UseGroup);
		return;
	}

	if (ac->desc().toggled) {
		v = v > 0 ? 0. : 1.;
	} else if (ac->desc().integer_step) {
		v += steps / (1.f + ac->desc().upper - ac->desc().lower);
	} else if (ac->desc().enumeration) {
		ac->set_value (ac->desc().step_enum (ac->get_value(), steps < 0), PBD::Controllable::UseGroup);
		return;
	} else {
		v = std::max (0.0, std::min (1.0, v + steps * .01));
	}
	ac->set_value (ac->interface_to_internal(v), PBD::Controllable::UseGroup);
}


/* ****************************************************************************
 * Mode specific and internal callbacks
 */

/* handle "ARM" press -- act like shift, change "Select" button mode */
void
FaderPort8::button_arm (bool press)
{
#ifdef FADERPORT2
	boost::shared_ptr<Stripable> s = first_selected_stripable();
	if (press && s) {
		boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(s);
		if (t) {
			t->rec_enable_control()->set_value (!t->rec_enable_control()->get_value(), PBD::Controllable::UseGroup);
		}
	}
#else
	FaderMode fadermode = _ctrls.fader_mode ();
	if (fadermode == ModeTrack || fadermode == ModePan) {
		_ctrls.button (FP8Controls::BtnArm).set_active (press);
		ARMButtonChange (press); /* EMIT SIGNAL */
	}
#endif
}

void
FaderPort8::button_prev_next (bool next)
{
	switch (_ctrls.nav_mode()) {
		case NavChannel:
#ifndef FADERPORT2
			select_prev_next (next);
			break;
#endif
		case NavMaster:
		case NavScroll:
		case NavPan:
			bank (!next, false);
			break;
		case NavBank:
			bank (!next, true);
			break;
		case NavZoom:
			if (next) {
				VerticalZoomInSelected ();
			} else {
				VerticalZoomOutSelected ();
			}
			break;
		case NavSection:
			if (next) {
				AccessAction ("Region", "nudge-forward");
			} else {
				AccessAction ("Region", "nudge-backward");
			}
			break;
		case NavMarker:
			if (next) {
				next_marker ();
			} else {
				prev_marker ();
			}
			break;
	}
}

/* handle navigation encoder press */
void
FaderPort8::button_encoder ()
{
	/* special-case metronome level */
	if (_ctrls.button (FP8Controls::BtnClick).is_pressed ()) {
		Config->set_click_gain (1.0);
		_ctrls.button (FP8Controls::BtnClick).ignore_release();
		return;
	}
	switch (_ctrls.nav_mode()) {
		case NavZoom:
			ZoomToSession (); // XXX undo zoom
			break;
		case NavScroll:
			ZoomToSession ();
			break;
		case NavChannel:
			AccessAction ("Editor", "select-topmost");
			break;
		case NavBank:
			move_selected_into_view ();
			break;
		case NavMaster:
			{
				/* master || monitor level -- reset to 0dB */
				boost::shared_ptr<AutomationControl> ac;
				if (session->monitor_active() && !_ctrls.button (FP8Controls::BtnMaster).is_pressed ()) {
					ac = session->monitor_out()->gain_control ();
				} else if (session->master_out()) {
					ac = session->master_out()->gain_control ();
				}
				if (ac) {
					ac->start_touch (ac->session().transport_sample());
					ac->set_value (ac->normal(), PBD::Controllable::NoGroup);
				}
			}
			break;
		case NavPan:
			break;
		case NavSection:
			// TODO nudge
			break;
		case NavMarker:
			{
				string markername;
				/* Don't add another mark if one exists within 1/100th of a second of
				 * the current position and we're not rolling.
				 */
				samplepos_t where = session->audible_sample();
				if (session->transport_stopped_or_stopping() && session->locations()->mark_at (where, session->sample_rate() / 100.0)) {
					return;
				}

				session->locations()->next_available_name (markername,"mark");
				add_marker (markername);
			}
			break;
	}
}

/* handle navigation encoder turn */
void
FaderPort8::encoder_navigate (bool neg, int steps)
{
	/* special-case metronome level */
	if (_ctrls.button (FP8Controls::BtnClick).is_pressed ()) {
		// compare to ARDOUR_UI::click_button_scroll()
		gain_t gain = Config->get_click_gain();
		float gain_db = accurate_coefficient_to_dB (gain);
		gain_db += (neg ? -1.f : 1.f) * steps;
		gain_db = std::max (-60.f, gain_db);
		gain = dB_to_coefficient (gain_db);
		gain = std::min (gain, Config->get_max_gain());
		Config->set_click_gain (gain);
		_ctrls.button (FP8Controls::BtnClick).ignore_release();
		return;
	}

	switch (_ctrls.nav_mode()) {
		case NavChannel:
			if (neg) {
				AccessAction ("Mixer", "scroll-left");
				AccessAction ("Editor", "step-tracks-up");
			} else {
				AccessAction ("Mixer", "scroll-right");
				AccessAction ("Editor", "step-tracks-down");
			}
			break;
		case NavZoom:
			if (neg) {
				ZoomOut ();
			} else {
				ZoomIn ();
			}
			break;
		case NavMarker:
		case NavScroll:
			ScrollTimeline ((neg ? -1.f : 1.f) * steps / (shift_mod() ? 1024.f : 256.f));
			break;
		case NavBank:
			bank (neg, false);
			break;
		case NavMaster:
			{
				/* master || monitor level */
				boost::shared_ptr<AutomationControl> ac;
				if (session->monitor_active() && !_ctrls.button (FP8Controls::BtnMaster).is_pressed ()) {
					ac = session->monitor_out()->gain_control ();
				} else if (session->master_out()) {
					ac = session->master_out()->gain_control ();
				}
				if (ac) {
					double v = ac->internal_to_interface (ac->get_value());
					v = std::max (0.0, std::min (1.0, v + steps * (neg ? -.01 : .01)));
					ac->start_touch (ac->session().transport_sample());
					ac->set_value (ac->interface_to_internal(v), PBD::Controllable::NoGroup);
				}
			}
			break;
		case NavSection:
			if (neg) {
				AccessAction ("Common", "nudge-playhead-backward");
			} else {
				AccessAction ("Common", "nudge-playhead-forward");
			}
			break;
		case NavPan:
			abort(); /*NOTREACHED*/
			break;
	}
}

/* handle pan/param encoder press */
void
FaderPort8::button_parameter ()
{
	switch (_ctrls.fader_mode()) {
		case ModeTrack:
		case ModePan:
			if (_link_enabled || _link_locked) {
				handle_encoder_link (0);
			} else {
				handle_encoder_pan (0);
			}
			break;
		case ModePlugins:
			toggle_preset_param_mode ();
			break;
		case ModeSend:
			break;
	}
}

/* handle pan/param encoder turn */
void
FaderPort8::encoder_parameter (bool neg, int steps)
{
	switch (_ctrls.fader_mode()) {
		case ModeTrack:
		case ModePan:
			if (steps != 0) {
				if (_link_enabled || _link_locked) {
					handle_encoder_link (neg ? -steps : steps);
				} else {
					handle_encoder_pan (neg ? -steps : steps);
				}
			}
			break;
		case ModePlugins:
		case ModeSend:
			while (steps > 0) {
				bank_param (neg, shift_mod());
				--steps;
			}
			break;
	}
}

/* handle user-specific actions */
void
FaderPort8::button_user (bool press, FP8Controls::ButtonId btn)
{
	_user_action_map[btn].call (*this, press);
}