Paul Davis
a202b08f65
git-svn-id: svn://localhost/ardour2/branches/3.0@11820 d708f5d6-7413-0410-9779-e7cbd77b26cf
536 lines
12 KiB
C++
536 lines
12 KiB
C++
/*
|
|
Generated by scripts/generate-surface.rb
|
|
*/
|
|
|
|
#include "mackie_surface.h"
|
|
|
|
#include "controls.h"
|
|
#include "mackie_button_handler.h"
|
|
|
|
using namespace Mackie;
|
|
|
|
void Mackie::MackieSurface::handle_button (MackieButtonHandler & mbh, ButtonState bs, Button & button)
|
|
{
|
|
if (bs != press && bs != release) {
|
|
mbh.update_led (button, none);
|
|
return;
|
|
}
|
|
|
|
LedState ls;
|
|
switch (button.id()) {
|
|
case 0x9028: // io
|
|
switch (bs) {
|
|
case press: ls = mbh.io_press (button); break;
|
|
case release: ls = mbh.io_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9029: // sends
|
|
switch (bs) {
|
|
case press: ls = mbh.sends_press (button); break;
|
|
case release: ls = mbh.sends_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x902a: // pan
|
|
switch (bs) {
|
|
case press: ls = mbh.pan_press (button); break;
|
|
case release: ls = mbh.pan_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x902b: // plugin
|
|
switch (bs) {
|
|
case press: ls = mbh.plugin_press (button); break;
|
|
case release: ls = mbh.plugin_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x902c: // eq
|
|
switch (bs) {
|
|
case press: ls = mbh.eq_press (button); break;
|
|
case release: ls = mbh.eq_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x902d: // dyn
|
|
switch (bs) {
|
|
case press: ls = mbh.dyn_press (button); break;
|
|
case release: ls = mbh.dyn_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x902e: // left
|
|
switch (bs) {
|
|
case press: ls = mbh.left_press (button); break;
|
|
case release: ls = mbh.left_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x902f: // right
|
|
switch (bs) {
|
|
case press: ls = mbh.right_press (button); break;
|
|
case release: ls = mbh.right_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9030: // channel_left
|
|
switch (bs) {
|
|
case press: ls = mbh.channel_left_press (button); break;
|
|
case release: ls = mbh.channel_left_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9031: // channel_right
|
|
switch (bs) {
|
|
case press: ls = mbh.channel_right_press (button); break;
|
|
case release: ls = mbh.channel_right_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9032: // flip
|
|
switch (bs) {
|
|
case press: ls = mbh.flip_press (button); break;
|
|
case release: ls = mbh.flip_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9033: // edit
|
|
switch (bs) {
|
|
case press: ls = mbh.edit_press (button); break;
|
|
case release: ls = mbh.edit_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9034: // name_value
|
|
switch (bs) {
|
|
case press: ls = mbh.name_value_press (button); break;
|
|
case release: ls = mbh.name_value_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9035: // timecode_beats
|
|
switch (bs) {
|
|
case press: ls = mbh.timecode_beats_press (button); break;
|
|
case release: ls = mbh.timecode_beats_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9036: // F1
|
|
switch (bs) {
|
|
case press: ls = mbh.F1_press (button); break;
|
|
case release: ls = mbh.F1_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9037: // F2
|
|
switch (bs) {
|
|
case press: ls = mbh.F2_press (button); break;
|
|
case release: ls = mbh.F2_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9038: // F3
|
|
switch (bs) {
|
|
case press: ls = mbh.F3_press (button); break;
|
|
case release: ls = mbh.F3_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9039: // F4
|
|
switch (bs) {
|
|
case press: ls = mbh.F4_press (button); break;
|
|
case release: ls = mbh.F4_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x903a: // F5
|
|
switch (bs) {
|
|
case press: ls = mbh.F5_press (button); break;
|
|
case release: ls = mbh.F5_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x903b: // F6
|
|
switch (bs) {
|
|
case press: ls = mbh.F6_press (button); break;
|
|
case release: ls = mbh.F6_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x903c: // F7
|
|
switch (bs) {
|
|
case press: ls = mbh.F7_press (button); break;
|
|
case release: ls = mbh.F7_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x903d: // F8
|
|
switch (bs) {
|
|
case press: ls = mbh.F8_press (button); break;
|
|
case release: ls = mbh.F8_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x903e: // F9
|
|
switch (bs) {
|
|
case press: ls = mbh.F9_press (button); break;
|
|
case release: ls = mbh.F9_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x903f: // F10
|
|
switch (bs) {
|
|
case press: ls = mbh.F10_press (button); break;
|
|
case release: ls = mbh.F10_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9040: // F11
|
|
switch (bs) {
|
|
case press: ls = mbh.F11_press (button); break;
|
|
case release: ls = mbh.F11_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9041: // F12
|
|
switch (bs) {
|
|
case press: ls = mbh.F12_press (button); break;
|
|
case release: ls = mbh.F12_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9042: // F13
|
|
switch (bs) {
|
|
case press: ls = mbh.F13_press (button); break;
|
|
case release: ls = mbh.F13_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9043: // F14
|
|
switch (bs) {
|
|
case press: ls = mbh.F14_press (button); break;
|
|
case release: ls = mbh.F14_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9044: // F15
|
|
switch (bs) {
|
|
case press: ls = mbh.F15_press (button); break;
|
|
case release: ls = mbh.F15_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9045: // F16
|
|
switch (bs) {
|
|
case press: ls = mbh.F16_press (button); break;
|
|
case release: ls = mbh.F16_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9046: // shift
|
|
switch (bs) {
|
|
case press: ls = mbh.shift_press (button); break;
|
|
case release: ls = mbh.shift_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9047: // option
|
|
switch (bs) {
|
|
case press: ls = mbh.option_press (button); break;
|
|
case release: ls = mbh.option_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9048: // control
|
|
switch (bs) {
|
|
case press: ls = mbh.control_press (button); break;
|
|
case release: ls = mbh.control_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9049: // cmd_alt
|
|
switch (bs) {
|
|
case press: ls = mbh.cmd_alt_press (button); break;
|
|
case release: ls = mbh.cmd_alt_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x904a: // on
|
|
switch (bs) {
|
|
case press: ls = mbh.on_press (button); break;
|
|
case release: ls = mbh.on_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x904b: // rec_ready
|
|
switch (bs) {
|
|
case press: ls = mbh.rec_ready_press (button); break;
|
|
case release: ls = mbh.rec_ready_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x904c: // undo
|
|
switch (bs) {
|
|
case press: ls = mbh.undo_press (button); break;
|
|
case release: ls = mbh.undo_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x904d: // snapshot
|
|
switch (bs) {
|
|
case press: ls = mbh.snapshot_press (button); break;
|
|
case release: ls = mbh.snapshot_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x904e: // touch
|
|
switch (bs) {
|
|
case press: ls = mbh.touch_press (button); break;
|
|
case release: ls = mbh.touch_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x904f: // redo
|
|
switch (bs) {
|
|
case press: ls = mbh.redo_press (button); break;
|
|
case release: ls = mbh.redo_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9050: // marker
|
|
switch (bs) {
|
|
case press: ls = mbh.marker_press (button); break;
|
|
case release: ls = mbh.marker_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9051: // enter
|
|
switch (bs) {
|
|
case press: ls = mbh.enter_press (button); break;
|
|
case release: ls = mbh.enter_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9052: // cancel
|
|
switch (bs) {
|
|
case press: ls = mbh.cancel_press (button); break;
|
|
case release: ls = mbh.cancel_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9053: // mixer
|
|
switch (bs) {
|
|
case press: ls = mbh.mixer_press (button); break;
|
|
case release: ls = mbh.mixer_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9054: // frm_left
|
|
switch (bs) {
|
|
case press: ls = mbh.frm_left_press (button); break;
|
|
case release: ls = mbh.frm_left_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9055: // frm_right
|
|
switch (bs) {
|
|
case press: ls = mbh.frm_right_press (button); break;
|
|
case release: ls = mbh.frm_right_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9056: // loop
|
|
switch (bs) {
|
|
case press: ls = mbh.loop_press (button); break;
|
|
case release: ls = mbh.loop_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9057: // punch_in
|
|
switch (bs) {
|
|
case press: ls = mbh.punch_in_press (button); break;
|
|
case release: ls = mbh.punch_in_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9058: // punch_out
|
|
switch (bs) {
|
|
case press: ls = mbh.punch_out_press (button); break;
|
|
case release: ls = mbh.punch_out_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9059: // home
|
|
switch (bs) {
|
|
case press: ls = mbh.home_press (button); break;
|
|
case release: ls = mbh.home_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x905a: // end
|
|
switch (bs) {
|
|
case press: ls = mbh.end_press (button); break;
|
|
case release: ls = mbh.end_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x905b: // rewind
|
|
switch (bs) {
|
|
case press: ls = mbh.rewind_press (button); break;
|
|
case release: ls = mbh.rewind_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x905c: // ffwd
|
|
switch (bs) {
|
|
case press: ls = mbh.ffwd_press (button); break;
|
|
case release: ls = mbh.ffwd_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x905d: // stop
|
|
switch (bs) {
|
|
case press: ls = mbh.stop_press (button); break;
|
|
case release: ls = mbh.stop_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x905e: // play
|
|
switch (bs) {
|
|
case press: ls = mbh.play_press (button); break;
|
|
case release: ls = mbh.play_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x905f: // record
|
|
switch (bs) {
|
|
case press: ls = mbh.record_press (button); break;
|
|
case release: ls = mbh.record_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9060: // cursor_up
|
|
switch (bs) {
|
|
case press: ls = mbh.cursor_up_press (button); break;
|
|
case release: ls = mbh.cursor_up_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9061: // cursor_down
|
|
switch (bs) {
|
|
case press: ls = mbh.cursor_down_press (button); break;
|
|
case release: ls = mbh.cursor_down_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9062: // cursor_left
|
|
switch (bs) {
|
|
case press: ls = mbh.cursor_left_press (button); break;
|
|
case release: ls = mbh.cursor_left_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9063: // cursor_right
|
|
switch (bs) {
|
|
case press: ls = mbh.cursor_right_press (button); break;
|
|
case release: ls = mbh.cursor_right_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9064: // zoom
|
|
switch (bs) {
|
|
case press: ls = mbh.zoom_press (button); break;
|
|
case release: ls = mbh.zoom_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9065: // scrub
|
|
switch (bs) {
|
|
case press: ls = mbh.scrub_press (button); break;
|
|
case release: ls = mbh.scrub_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9066: // user_a
|
|
switch (bs) {
|
|
case press: ls = mbh.user_a_press (button); break;
|
|
case release: ls = mbh.user_a_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
case 0x9067: // user_b
|
|
switch (bs) {
|
|
case press: ls = mbh.user_b_press (button); break;
|
|
case release: ls = mbh.user_b_release (button); break;
|
|
case neither: break;
|
|
}
|
|
break;
|
|
|
|
}
|
|
mbh.update_led (button, ls);
|
|
}
|