MCP: move init functions back into Surface since there is no difference between the BCF and MCU versions of the code at this point
git-svn-id: svn://localhost/ardour2/branches/3.0@11838 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
715bdc3829
commit
79799023f5
@ -1,9 +1,10 @@
|
||||
#include "bcf_surface.h"
|
||||
#include "surface_port.h"
|
||||
#include "mackie_midi_builder.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "bcf_surface.h"
|
||||
#include "controls.h"
|
||||
#include "mackie_midi_builder.h"
|
||||
#include "surface_port.h"
|
||||
|
||||
using namespace Mackie;
|
||||
|
||||
void BcfSurface::display_bank_start (SurfacePort & port, MackieMidiBuilder & builder, uint32_t current_bank)
|
||||
@ -40,7 +41,3 @@ BcfSurface::scaled_delta (const ControlState & state, float current_speed)
|
||||
return state.sign * (std::pow (float(state.ticks + 1), 2) + current_speed) / 100.0;
|
||||
}
|
||||
|
||||
void
|
||||
BcfSurface::init_strips ()
|
||||
{
|
||||
}
|
||||
|
@ -16,10 +16,6 @@ class BcfSurface : public Surface
|
||||
public:
|
||||
BcfSurface (uint32_t max_strips) : Surface (max_strips, 7) {}
|
||||
|
||||
virtual void handle_button( MackieButtonHandler & mbh, ButtonState bs, Button & button );
|
||||
virtual void init_controls();
|
||||
virtual void init_strips ();
|
||||
|
||||
virtual void display_bank_start( SurfacePort & port, MackieMidiBuilder & builder, uint32_t current_bank );
|
||||
virtual void zero_all( SurfacePort & port, MackieMidiBuilder & builder );
|
||||
virtual void blank_jog_ring( SurfacePort & port, MackieMidiBuilder & builder );
|
||||
|
@ -3,9 +3,10 @@
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
|
||||
#include "controls.h"
|
||||
#include "mackie_surface.h"
|
||||
#include "surface_port.h"
|
||||
#include "mackie_midi_builder.h"
|
||||
#include "surface_port.h"
|
||||
|
||||
using namespace Mackie;
|
||||
|
||||
@ -21,136 +22,3 @@ MackieSurface::scaled_delta (const ControlState & state, float current_speed)
|
||||
return state.sign * (std::pow (float(state.ticks + 1), 2) + current_speed) / 100.0;
|
||||
}
|
||||
|
||||
static GlobalControlDefinition mackie_global_controls[] = {
|
||||
{ "jog", 0x3c, Jog::factory, "none" },
|
||||
{ "external", 0x2e, Pot::factory, "none" },
|
||||
{ "io", 0x28, Button::factory, "assignment" },
|
||||
{ "sends", 0x29, Button::factory, "assignment" },
|
||||
{ "pan", 0x2a, Button::factory, "assignment" },
|
||||
{ "plugin", 0x2b, Button::factory, "assignment" },
|
||||
{ "eq", 0x2c, Button::factory, "assignment" },
|
||||
{ "dyn", 0x2d, Button::factory, "assignment" },
|
||||
{ "left", 0x2e, Button::factory, "bank" },
|
||||
{ "right", 0x2f, Button::factory, "bank" },
|
||||
{ "channel_left", 0x30, Button::factory, "bank" },
|
||||
{ "channel_right", 0x31, Button::factory, "bank" },
|
||||
{ "flip", 0x32, Button::factory, "none" },
|
||||
{ "edit", 0x33, Button::factory, "none" },
|
||||
{ "name_value", 0x34, Button::factory, "display" },
|
||||
{ "timecode_beats", 0x35, Button::factory, "display" },
|
||||
{ "F1", 0x36, Button::factory, "none" },
|
||||
{ "F2", 0x37, Button::factory, "none" },
|
||||
{ "F3", 0x38, Button::factory, "none" },
|
||||
{ "F4", 0x39, Button::factory, "none" },
|
||||
{ "F5", 0x3a, Button::factory, "none" },
|
||||
{ "F6", 0x3b, Button::factory, "none" },
|
||||
{ "F7", 0x3c, Button::factory, "none" },
|
||||
{ "F8", 0x3d, Button::factory, "none" },
|
||||
{ "F9", 0x3e, Button::factory, "none" },
|
||||
{ "F10", 0x3f, Button::factory, "none" },
|
||||
{ "F11", 0x40, Button::factory, "none" },
|
||||
{ "F12", 0x41, Button::factory, "none" },
|
||||
{ "F13", 0x42, Button::factory, "none" },
|
||||
{ "F14", 0x43, Button::factory, "none" },
|
||||
{ "F15", 0x44, Button::factory, "none" },
|
||||
{ "F16", 0x45, Button::factory, "none" },
|
||||
{ "shift", 0x46, Button::factory, "modifiers" },
|
||||
{ "option", 0x47, Button::factory, "modifiers" },
|
||||
{ "control", 0x48, Button::factory, "modifiers" },
|
||||
{ "cmd_alt", 0x49, Button::factory, "modifiers" },
|
||||
{ "on", 0x4a, Button::factory, "automation" },
|
||||
{ "rec_ready", 0x4b, Button::factory, "automation" },
|
||||
{ "undo", 0x4c, Button::factory, "functions" },
|
||||
{ "snapshot", 0x4d, Button::factory, "automation" },
|
||||
{ "touch", 0x4e, Button::factory, "automation" },
|
||||
{ "redo", 0x4f, Button::factory, "functions" },
|
||||
{ "marker", 0x50, Button::factory, "functions" },
|
||||
{ "enter", 0x51, Button::factory, "functions" },
|
||||
{ "cancel", 0x52, Button::factory, "functions" },
|
||||
{ "mixer", 0x53, Button::factory, "functions" },
|
||||
{ "frm_left", 0x54, Button::factory, "transport" },
|
||||
{ "frm_right", 0x55, Button::factory, "transport" },
|
||||
{ "loop", 0x56, Button::factory, "transport" },
|
||||
{ "punch_in", 0x57, Button::factory, "transport" },
|
||||
{ "punch_out", 0x58, Button::factory, "transport" },
|
||||
{ "home", 0x59, Button::factory, "transport" },
|
||||
{ "end", 0x5a, Button::factory, "transport" },
|
||||
{ "rewind", 0x5b, Button::factory, "transport" },
|
||||
{ "ffwd", 0x5c, Button::factory, "transport" },
|
||||
{ "stop", 0x5d, Button::factory, "transport" },
|
||||
{ "play", 0x5e, Button::factory, "transport" },
|
||||
{ "record", 0x5f, Button::factory, "transport" },
|
||||
{ "cursor_up", 0x60, Button::factory, "cursor" },
|
||||
{ "cursor_down", 0x61, Button::factory, "cursor" },
|
||||
{ "cursor_left", 0x62, Button::factory, "cursor" },
|
||||
{ "cursor_right", 0x63, Button::factory, "cursor" },
|
||||
{ "zoom", 0x64, Button::factory, "none" },
|
||||
{ "scrub", 0x65, Button::factory, "none" },
|
||||
{ "user_a", 0x66, Button::factory, "user" },
|
||||
{ "user_b", 0x67, Button::factory, "user" },
|
||||
{ "fader_touch", 0x70, Led::factory, "master" },
|
||||
{ "timecode", 0x71, Led::factory, "none" },
|
||||
{ "beats", 0x72, Led::factory, "none" },
|
||||
{ "solo", 0x73, Led::factory, "none" },
|
||||
{ "relay_click", 0x73, Led::factory, "none" },
|
||||
{ "", 0, Button::factory, "" }
|
||||
};
|
||||
|
||||
void
|
||||
Mackie::MackieSurface::init_controls()
|
||||
{
|
||||
Group* group;
|
||||
|
||||
groups["assignment"] = new Group ("assignment");
|
||||
groups["automation"] = new Group ("automation");
|
||||
groups["bank"] = new Group ("bank");
|
||||
groups["cursor"] = new Group ("cursor");
|
||||
groups["display"] = new Group ("display");
|
||||
groups["functions"] = new Group ("functions");
|
||||
groups["modifiers"] = new Group ("modifiers");
|
||||
groups["none"] = new Group ("none");
|
||||
groups["transport"] = new Group ("transport");
|
||||
groups["user"] = new Group ("user");
|
||||
|
||||
group = new MasterStrip ("master", 0);
|
||||
groups["master"] = group;
|
||||
strips[0] = dynamic_cast<Strip*> (group);
|
||||
|
||||
for (uint32_t n = 0; mackie_global_controls[n].name[0]; ++n) {
|
||||
group = groups[mackie_global_controls[n].group_name];
|
||||
Control* control = mackie_global_controls[n].factory (*this, mackie_global_controls[n].id, 1, mackie_global_controls[n].name, *group);
|
||||
controls_by_name[mackie_global_controls[n].name] = control;
|
||||
group->add (*control);
|
||||
}
|
||||
}
|
||||
|
||||
static StripControlDefinition mackie_strip_controls[] = {
|
||||
{ "gain", Control::fader_base_id, Fader::factory, },
|
||||
{ "vpot", Control::pot_base_id, Pot::factory, },
|
||||
{ "recenable", Control::recenable_button_base_id, Button::factory, },
|
||||
{ "solo", Control::solo_button_base_id, Button::factory, },
|
||||
{ "mute", Control::mute_button_base_id, Button::factory, },
|
||||
{ "select", Control::select_button_base_id, Button::factory, },
|
||||
{ "vselect", Control::vselect_button_base_id, Button::factory, },
|
||||
{ "fader_touch", Control::fader_touch_button_base_id, Button::factory, },
|
||||
{ "", 0, Button::factory, }
|
||||
};
|
||||
|
||||
void MackieSurface::init_strips ()
|
||||
{
|
||||
for (uint32_t i = 0; i < _max_strips; ++i) {
|
||||
|
||||
char name[32];
|
||||
|
||||
uint32_t unit_index = i % _unit_strips;
|
||||
|
||||
snprintf (name, sizeof (name), "strip_%d", unit_index+1);
|
||||
|
||||
Strip* strip = new Strip (*this, name, i, unit_index, mackie_strip_controls);
|
||||
|
||||
groups[name] = strip;
|
||||
strips[i] = strip;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,10 +15,6 @@ class MackieSurface : public Surface
|
||||
public:
|
||||
MackieSurface (uint32_t max_strips) : Surface (max_strips, 8) {}
|
||||
|
||||
virtual void handle_button (MackieButtonHandler & mbh, ButtonState bs, Button & button);
|
||||
virtual void init_controls();
|
||||
virtual void init_strips();
|
||||
|
||||
virtual bool has_timecode_display() const { return true; }
|
||||
virtual void display_timecode (SurfacePort &, MackieMidiBuilder &, const std::string & timecode, const std::string & timecode_last);
|
||||
|
||||
|
@ -1,9 +1,13 @@
|
||||
#include "ardour/debug.h"
|
||||
#include "surface.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <cstdio>
|
||||
|
||||
#include "ardour/debug.h"
|
||||
|
||||
#include "mackie_button_handler.h"
|
||||
#include "surface_port.h"
|
||||
#include "surface.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace PBD;
|
||||
@ -39,3 +43,661 @@ Surface::~Surface ()
|
||||
}
|
||||
}
|
||||
|
||||
static GlobalControlDefinition mackie_global_controls[] = {
|
||||
{ "jog", 0x3c, Jog::factory, "none" },
|
||||
{ "external", 0x2e, Pot::factory, "none" },
|
||||
{ "io", 0x28, Button::factory, "assignment" },
|
||||
{ "sends", 0x29, Button::factory, "assignment" },
|
||||
{ "pan", 0x2a, Button::factory, "assignment" },
|
||||
{ "plugin", 0x2b, Button::factory, "assignment" },
|
||||
{ "eq", 0x2c, Button::factory, "assignment" },
|
||||
{ "dyn", 0x2d, Button::factory, "assignment" },
|
||||
{ "left", 0x2e, Button::factory, "bank" },
|
||||
{ "right", 0x2f, Button::factory, "bank" },
|
||||
{ "channel_left", 0x30, Button::factory, "bank" },
|
||||
{ "channel_right", 0x31, Button::factory, "bank" },
|
||||
{ "flip", 0x32, Button::factory, "none" },
|
||||
{ "edit", 0x33, Button::factory, "none" },
|
||||
{ "name_value", 0x34, Button::factory, "display" },
|
||||
{ "timecode_beats", 0x35, Button::factory, "display" },
|
||||
{ "F1", 0x36, Button::factory, "none" },
|
||||
{ "F2", 0x37, Button::factory, "none" },
|
||||
{ "F3", 0x38, Button::factory, "none" },
|
||||
{ "F4", 0x39, Button::factory, "none" },
|
||||
{ "F5", 0x3a, Button::factory, "none" },
|
||||
{ "F6", 0x3b, Button::factory, "none" },
|
||||
{ "F7", 0x3c, Button::factory, "none" },
|
||||
{ "F8", 0x3d, Button::factory, "none" },
|
||||
{ "F9", 0x3e, Button::factory, "none" },
|
||||
{ "F10", 0x3f, Button::factory, "none" },
|
||||
{ "F11", 0x40, Button::factory, "none" },
|
||||
{ "F12", 0x41, Button::factory, "none" },
|
||||
{ "F13", 0x42, Button::factory, "none" },
|
||||
{ "F14", 0x43, Button::factory, "none" },
|
||||
{ "F15", 0x44, Button::factory, "none" },
|
||||
{ "F16", 0x45, Button::factory, "none" },
|
||||
{ "shift", 0x46, Button::factory, "modifiers" },
|
||||
{ "option", 0x47, Button::factory, "modifiers" },
|
||||
{ "control", 0x48, Button::factory, "modifiers" },
|
||||
{ "cmd_alt", 0x49, Button::factory, "modifiers" },
|
||||
{ "on", 0x4a, Button::factory, "automation" },
|
||||
{ "rec_ready", 0x4b, Button::factory, "automation" },
|
||||
{ "undo", 0x4c, Button::factory, "functions" },
|
||||
{ "snapshot", 0x4d, Button::factory, "automation" },
|
||||
{ "touch", 0x4e, Button::factory, "automation" },
|
||||
{ "redo", 0x4f, Button::factory, "functions" },
|
||||
{ "marker", 0x50, Button::factory, "functions" },
|
||||
{ "enter", 0x51, Button::factory, "functions" },
|
||||
{ "cancel", 0x52, Button::factory, "functions" },
|
||||
{ "mixer", 0x53, Button::factory, "functions" },
|
||||
{ "frm_left", 0x54, Button::factory, "transport" },
|
||||
{ "frm_right", 0x55, Button::factory, "transport" },
|
||||
{ "loop", 0x56, Button::factory, "transport" },
|
||||
{ "punch_in", 0x57, Button::factory, "transport" },
|
||||
{ "punch_out", 0x58, Button::factory, "transport" },
|
||||
{ "home", 0x59, Button::factory, "transport" },
|
||||
{ "end", 0x5a, Button::factory, "transport" },
|
||||
{ "rewind", 0x5b, Button::factory, "transport" },
|
||||
{ "ffwd", 0x5c, Button::factory, "transport" },
|
||||
{ "stop", 0x5d, Button::factory, "transport" },
|
||||
{ "play", 0x5e, Button::factory, "transport" },
|
||||
{ "record", 0x5f, Button::factory, "transport" },
|
||||
{ "cursor_up", 0x60, Button::factory, "cursor" },
|
||||
{ "cursor_down", 0x61, Button::factory, "cursor" },
|
||||
{ "cursor_left", 0x62, Button::factory, "cursor" },
|
||||
{ "cursor_right", 0x63, Button::factory, "cursor" },
|
||||
{ "zoom", 0x64, Button::factory, "none" },
|
||||
{ "scrub", 0x65, Button::factory, "none" },
|
||||
{ "user_a", 0x66, Button::factory, "user" },
|
||||
{ "user_b", 0x67, Button::factory, "user" },
|
||||
{ "fader_touch", 0x70, Led::factory, "master" },
|
||||
{ "timecode", 0x71, Led::factory, "none" },
|
||||
{ "beats", 0x72, Led::factory, "none" },
|
||||
{ "solo", 0x73, Led::factory, "none" },
|
||||
{ "relay_click", 0x73, Led::factory, "none" },
|
||||
{ "", 0, Button::factory, "" }
|
||||
};
|
||||
|
||||
void
|
||||
Surface::init_controls()
|
||||
{
|
||||
Group* group;
|
||||
|
||||
groups["assignment"] = new Group ("assignment");
|
||||
groups["automation"] = new Group ("automation");
|
||||
groups["bank"] = new Group ("bank");
|
||||
groups["cursor"] = new Group ("cursor");
|
||||
groups["display"] = new Group ("display");
|
||||
groups["functions"] = new Group ("functions");
|
||||
groups["modifiers"] = new Group ("modifiers");
|
||||
groups["none"] = new Group ("none");
|
||||
groups["transport"] = new Group ("transport");
|
||||
groups["user"] = new Group ("user");
|
||||
|
||||
group = new MasterStrip ("master", 0);
|
||||
groups["master"] = group;
|
||||
strips[0] = dynamic_cast<Strip*> (group);
|
||||
|
||||
for (uint32_t n = 0; mackie_global_controls[n].name[0]; ++n) {
|
||||
group = groups[mackie_global_controls[n].group_name];
|
||||
Control* control = mackie_global_controls[n].factory (*this, mackie_global_controls[n].id, 1, mackie_global_controls[n].name, *group);
|
||||
controls_by_name[mackie_global_controls[n].name] = control;
|
||||
group->add (*control);
|
||||
}
|
||||
}
|
||||
|
||||
static StripControlDefinition mackie_strip_controls[] = {
|
||||
{ "gain", Control::fader_base_id, Fader::factory, },
|
||||
{ "vpot", Control::pot_base_id, Pot::factory, },
|
||||
{ "recenable", Control::recenable_button_base_id, Button::factory, },
|
||||
{ "solo", Control::solo_button_base_id, Button::factory, },
|
||||
{ "mute", Control::mute_button_base_id, Button::factory, },
|
||||
{ "select", Control::select_button_base_id, Button::factory, },
|
||||
{ "vselect", Control::vselect_button_base_id, Button::factory, },
|
||||
{ "fader_touch", Control::fader_touch_button_base_id, Button::factory, },
|
||||
{ "", 0, Button::factory, }
|
||||
};
|
||||
|
||||
void
|
||||
Surface::init_strips ()
|
||||
{
|
||||
for (uint32_t i = 0; i < _max_strips; ++i) {
|
||||
|
||||
char name[32];
|
||||
|
||||
uint32_t unit_index = i % _unit_strips;
|
||||
|
||||
snprintf (name, sizeof (name), "strip_%d", unit_index+1);
|
||||
|
||||
Strip* strip = new Strip (*this, name, i, unit_index, mackie_strip_controls);
|
||||
|
||||
groups[name] = strip;
|
||||
strips[i] = strip;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Surface::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);
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ public:
|
||||
uint32_t max_strips() const { return _max_strips; }
|
||||
|
||||
/// map button ids to calls to press_ and release_ in mbh
|
||||
virtual void handle_button( MackieButtonHandler & mbh, ButtonState bs, Button & button ) = 0;
|
||||
virtual void handle_button (MackieButtonHandler & mbh, ButtonState bs, Button & button);
|
||||
|
||||
public:
|
||||
/// display an indicator of the first switched-in Route. Do nothing by default.
|
||||
@ -114,8 +114,8 @@ public:
|
||||
virtual float scaled_delta( const ControlState & state, float current_speed ) = 0;
|
||||
|
||||
protected:
|
||||
virtual void init_controls() = 0;
|
||||
virtual void init_strips () {}
|
||||
virtual void init_controls();
|
||||
virtual void init_strips ();
|
||||
|
||||
const uint32_t _max_strips;
|
||||
const uint32_t _unit_strips;
|
||||
|
@ -22,7 +22,6 @@ def build(bld):
|
||||
obj = bld(features = 'cxx cxxshlib')
|
||||
obj.source = '''
|
||||
bcf_surface.cc
|
||||
bcf_surface_generated.cc
|
||||
controls.cc
|
||||
dummy_port.cc
|
||||
gui.cc
|
||||
@ -34,7 +33,6 @@ def build(bld):
|
||||
mackie_midi_builder.cc
|
||||
mackie_port.cc
|
||||
mackie_surface.cc
|
||||
mackie_surface_generated.cc
|
||||
midi_byte_array.cc
|
||||
route_signal.cc
|
||||
surface.cc
|
||||
|
Loading…
Reference in New Issue
Block a user