mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
MCP: latest patch from Rodrigo:
* delays Mackie's led initialization until the Mackie is actually ready to receive messages;
* at the button X function mapping customization interface in Preferences:
o show specific device names instead of global ones;
o mark the buttons that are actually available in the device with a *;
o included a bottom text explaining what the * means;
* created a DeviceInfo::get_global_button_name(Button::ID) method;
* included several DEBUG_TRACE in mackies code;
* renamed device buttons and groups according to the following logic: Mackie buttons are named exactly like a actual (mine) Mackie names them on the interface itself. Logic Control buttons are named exactly like they appear at Logic Pro 7.2.1 Dedicated Control Surface Support manual;
* improved timecode display (new format);
git-svn-id: svn://localhost/ardour2/branches/3.0@12582 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
1bc662e64e
commit
a56ab30261
6 changed files with 175 additions and 134 deletions
|
|
@ -61,46 +61,35 @@ DeviceInfo::~DeviceInfo()
|
|||
{
|
||||
}
|
||||
|
||||
std::string&
|
||||
DeviceInfo::get_global_button_name(Button::ID id)
|
||||
{
|
||||
std::map<Button::ID,GlobalButtonInfo>::iterator it;
|
||||
|
||||
it = _global_buttons.find (id);
|
||||
if (it == _global_buttons.end ()) {
|
||||
_global_button_name = "";
|
||||
return _global_button_name;
|
||||
} else {
|
||||
return it->second.label;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DeviceInfo::mackie_control_buttons ()
|
||||
{
|
||||
_global_buttons.clear ();
|
||||
shared_buttons ();
|
||||
|
||||
_global_buttons[Button::Edit] = GlobalButtonInfo ("edit", "none", 0x33);
|
||||
_global_buttons[Button::UserA] = GlobalButtonInfo ("Rear Panel User Switch 1", "user", 0x66);
|
||||
_global_buttons[Button::UserB] = GlobalButtonInfo ("Rear Panel User Switch 2", "user", 0x67);
|
||||
|
||||
_global_buttons[Button::F9] = GlobalButtonInfo ("F9", "none", 0x3e);
|
||||
_global_buttons[Button::F10] = GlobalButtonInfo ("F10", "none", 0x3f);
|
||||
_global_buttons[Button::F11] = GlobalButtonInfo ("F11", "none", 0x40);
|
||||
_global_buttons[Button::F12] = GlobalButtonInfo ("F12", "none", 0x41);
|
||||
_global_buttons[Button::F13] = GlobalButtonInfo ("F13", "none", 0x42);
|
||||
_global_buttons[Button::F14] = GlobalButtonInfo ("F14", "none", 0x43);
|
||||
_global_buttons[Button::F15] = GlobalButtonInfo ("F15", "none", 0x44);
|
||||
_global_buttons[Button::F16] = GlobalButtonInfo ("F16", "none", 0x45);
|
||||
_global_buttons[Button::Ctrl] = GlobalButtonInfo ("ctrl", "modifiers", 0x46);
|
||||
_global_buttons[Button::Option] = GlobalButtonInfo ("option", "modifiers", 0x47);
|
||||
_global_buttons[Button::Snapshot] = GlobalButtonInfo ("snapshot", "modifiers", 0x48);
|
||||
_global_buttons[Button::Shift] = GlobalButtonInfo ("shift", "modifiers", 0x49);
|
||||
_global_buttons[Button::Read] = GlobalButtonInfo ("read", "automation", 0x4a);
|
||||
_global_buttons[Button::Write] = GlobalButtonInfo ("write", "automation", 0x4b);
|
||||
_global_buttons[Button::Undo] = GlobalButtonInfo ("undo", "functions", 0x4c);
|
||||
_global_buttons[Button::Save] = GlobalButtonInfo ("save", "automation", 0x4d);
|
||||
_global_buttons[Button::Touch] = GlobalButtonInfo ("touch", "automation", 0x4e);
|
||||
_global_buttons[Button::Redo] = GlobalButtonInfo ("redo", "functions", 0x4f);
|
||||
_global_buttons[Button::FdrGroup] = GlobalButtonInfo ("fader group", "functions", 0x50);
|
||||
_global_buttons[Button::ClearSolo] = GlobalButtonInfo ("clear solo", "functions", 0x51);
|
||||
_global_buttons[Button::Cancel] = GlobalButtonInfo ("cancel", "functions", 0x52);
|
||||
_global_buttons[Button::Marker] = GlobalButtonInfo ("marker", "functions", 0x53);
|
||||
_global_buttons[Button::Mixer] = GlobalButtonInfo ("mixer", "transport", 0x54);
|
||||
_global_buttons[Button::FrmLeft] = GlobalButtonInfo ("frm left", "transport", 0x55);
|
||||
_global_buttons[Button::FrmRight] = GlobalButtonInfo ("frm right", "transport", 0x56);
|
||||
_global_buttons[Button::End] = GlobalButtonInfo ("end", "transport", 0x57);
|
||||
_global_buttons[Button::PunchIn] = GlobalButtonInfo ("punch in", "transport", 0x58);
|
||||
_global_buttons[Button::PunchOut] = GlobalButtonInfo ("punch out", "transport", 0x59);
|
||||
_global_buttons[Button::Loop] = GlobalButtonInfo ("loop", "transport", 0x59);
|
||||
_global_buttons[Button::Home] = GlobalButtonInfo ("home", "transport", 0x5a);
|
||||
//TODO Implement "rear panel external control": a connection for a resistive
|
||||
//TODO element expression pedal . Message: 0xb0 0x2e 0xVV where 0xVV = external
|
||||
//TODO controller position value (0x00 to 0x7f)
|
||||
|
||||
_strip_buttons[Button::FaderTouch] = StripButtonInfo (0xe0, "fader touch");
|
||||
_strip_buttons[Button::RecEnable] = StripButtonInfo (0x0, "Rec");
|
||||
_strip_buttons[Button::FaderTouch] = StripButtonInfo (0xe0, "Fader Touch");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -109,86 +98,93 @@ DeviceInfo::logic_control_buttons ()
|
|||
_global_buttons.clear ();
|
||||
shared_buttons ();
|
||||
|
||||
_global_buttons[Button::View] = GlobalButtonInfo ("view", "view", 0x33);
|
||||
_global_buttons[Button::UserA] = GlobalButtonInfo ("User Switch A", "user", 0x66);
|
||||
_global_buttons[Button::UserB] = GlobalButtonInfo ("User Switch B", "user", 0x67);
|
||||
|
||||
_global_buttons[Button::MidiTracks] = GlobalButtonInfo ("miditracks", "view", 0x3e);
|
||||
_global_buttons[Button::Inputs] = GlobalButtonInfo ("inputs", "view", 0x3f);
|
||||
_global_buttons[Button::AudioTracks] = GlobalButtonInfo ("audiotracks", "view", 0x40);
|
||||
_global_buttons[Button::AudioInstruments] = GlobalButtonInfo ("audio instruments", "view", 0x41);
|
||||
_global_buttons[Button::Aux] = GlobalButtonInfo ("aux", "view", 0x42);
|
||||
_global_buttons[Button::Busses] = GlobalButtonInfo ("busses", "view", 0x43);
|
||||
_global_buttons[Button::Outputs] = GlobalButtonInfo ("outputs", "view", 0x44);
|
||||
_global_buttons[Button::User] = GlobalButtonInfo ("user", "view", 0x45);
|
||||
_global_buttons[Button::Shift] = GlobalButtonInfo ("shift", "modifiers", 0x46);
|
||||
_global_buttons[Button::Option] = GlobalButtonInfo ("option", "modifiers", 0x47);
|
||||
_global_buttons[Button::Ctrl] = GlobalButtonInfo ("ctrl", "modifiers", 0x48);
|
||||
_global_buttons[Button::CmdAlt] = GlobalButtonInfo ("cmdalt", "modifiers", 0x49);
|
||||
_global_buttons[Button::Read] = GlobalButtonInfo ("read", "automation", 0x4a);
|
||||
_global_buttons[Button::Write] = GlobalButtonInfo ("write", "automation", 0x4b);
|
||||
_global_buttons[Button::Trim] = GlobalButtonInfo ("trim", "automation", 0x4c);
|
||||
_global_buttons[Button::Touch] = GlobalButtonInfo ("touch", "functions", 0x4d);
|
||||
_global_buttons[Button::Latch] = GlobalButtonInfo ("latch", "functions", 0x4e);
|
||||
_global_buttons[Button::Grp] = GlobalButtonInfo ("group", "functions", 0x4f);
|
||||
_global_buttons[Button::Save] = GlobalButtonInfo ("save", "functions", 0x50);
|
||||
_global_buttons[Button::Undo] = GlobalButtonInfo ("undo", "functions", 0x51);
|
||||
_global_buttons[Button::Cancel] = GlobalButtonInfo ("cancel", "transport", 0x52);
|
||||
_global_buttons[Button::Enter] = GlobalButtonInfo ("enter right", "transport", 0x53);
|
||||
_global_buttons[Button::Marker] = GlobalButtonInfo ("marker", "transport", 0x54);
|
||||
_global_buttons[Button::Nudge] = GlobalButtonInfo ("nudge", "transport", 0x55);
|
||||
_global_buttons[Button::Loop] = GlobalButtonInfo ("cycle", "transport", 0x56);
|
||||
_global_buttons[Button::Drop] = GlobalButtonInfo ("drop", "transport", 0x57);
|
||||
_global_buttons[Button::Replace] = GlobalButtonInfo ("replace", "transport", 0x58);
|
||||
_global_buttons[Button::Click] = GlobalButtonInfo ("click", "transport", 0x59);
|
||||
_global_buttons[Button::Solo] = GlobalButtonInfo ("solo", "transport", 0x5a);
|
||||
|
||||
_strip_buttons[Button::FaderTouch] = StripButtonInfo (0x68, "fader touch");
|
||||
_strip_buttons[Button::RecEnable] = StripButtonInfo (0x0, "Rec/Rdy");
|
||||
_strip_buttons[Button::FaderTouch] = StripButtonInfo (0x68, "Fader Touch");
|
||||
}
|
||||
|
||||
void
|
||||
DeviceInfo::shared_buttons ()
|
||||
{
|
||||
_global_buttons[Button::Track] = GlobalButtonInfo ("track", "assignment", 0x28);
|
||||
_global_buttons[Button::Send] = GlobalButtonInfo ("send", "assignment", 0x29);
|
||||
_global_buttons[Button::Pan] = GlobalButtonInfo ("pan", "assignment", 0x2a);
|
||||
_global_buttons[Button::Plugin] = GlobalButtonInfo ("plugin", "assignment", 0x2b);
|
||||
_global_buttons[Button::Eq] = GlobalButtonInfo ("eq", "assignment", 0x2c);
|
||||
_global_buttons[Button::Dyn] = GlobalButtonInfo ("dyn", "assignment", 0x2d);
|
||||
_global_buttons[Button::Left] = GlobalButtonInfo ("left", "bank", 0x2e);
|
||||
_global_buttons[Button::Right] = GlobalButtonInfo ("right", "bank", 0x2f);
|
||||
_global_buttons[Button::ChannelLeft] = GlobalButtonInfo ("channelleft", "bank", 0x30);
|
||||
_global_buttons[Button::ChannelRight] = GlobalButtonInfo ("channelright", "bank", 0x31);
|
||||
_global_buttons[Button::Flip] = GlobalButtonInfo ("flip", "none", 0x32);
|
||||
_global_buttons[Button::Track] = GlobalButtonInfo ("Track", "assignment", 0x28);
|
||||
_global_buttons[Button::Send] = GlobalButtonInfo ("Send", "assignment", 0x29);
|
||||
_global_buttons[Button::Pan] = GlobalButtonInfo ("Pan/Surround", "assignment", 0x2a);
|
||||
_global_buttons[Button::Plugin] = GlobalButtonInfo ("Plugin", "assignment", 0x2b);
|
||||
_global_buttons[Button::Eq] = GlobalButtonInfo ("Eq", "assignment", 0x2c);
|
||||
_global_buttons[Button::Dyn] = GlobalButtonInfo ("Instrument", "assignment", 0x2d);
|
||||
|
||||
_global_buttons[Button::NameValue] = GlobalButtonInfo ("name/value", "display", 0x34);
|
||||
_global_buttons[Button::TimecodeBeats] = GlobalButtonInfo ("timecode/beats", "display", 0x35);
|
||||
_global_buttons[Button::F1] = GlobalButtonInfo ("F1", "none", 0x36);
|
||||
_global_buttons[Button::F2] = GlobalButtonInfo ("F2", "none", 0x37);
|
||||
_global_buttons[Button::F3] = GlobalButtonInfo ("F3", "none", 0x38);
|
||||
_global_buttons[Button::F4] = GlobalButtonInfo ("F4", "none", 0x39);
|
||||
_global_buttons[Button::F5] = GlobalButtonInfo ("F5", "none", 0x3a);
|
||||
_global_buttons[Button::F6] = GlobalButtonInfo ("F6", "none", 0x3b);
|
||||
_global_buttons[Button::F7] = GlobalButtonInfo ("F7", "none", 0x3c);
|
||||
_global_buttons[Button::F8] = GlobalButtonInfo ("F8", "none", 0x3d);
|
||||
_global_buttons[Button::Left] = GlobalButtonInfo ("Bank Left", "bank", 0x2e);
|
||||
_global_buttons[Button::Right] = GlobalButtonInfo ("Bank Right", "bank", 0x2f);
|
||||
_global_buttons[Button::ChannelLeft] = GlobalButtonInfo ("Channel Left", "bank", 0x30);
|
||||
_global_buttons[Button::ChannelRight] = GlobalButtonInfo ("Channel Right", "bank", 0x31);
|
||||
_global_buttons[Button::Flip] = GlobalButtonInfo ("Flip", "assignment", 0x32);
|
||||
_global_buttons[Button::View] = GlobalButtonInfo ("Global View", "global view", 0x33);
|
||||
|
||||
_global_buttons[Button::Rewind] = GlobalButtonInfo ("rewind", "transport", 0x5b);
|
||||
_global_buttons[Button::Ffwd] = GlobalButtonInfo ("ffwd", "transport", 0x5c);
|
||||
_global_buttons[Button::Stop] = GlobalButtonInfo ("stop", "transport", 0x5d);
|
||||
_global_buttons[Button::Play] = GlobalButtonInfo ("play", "transport", 0x5e);
|
||||
_global_buttons[Button::Record] = GlobalButtonInfo ("record", "transport", 0x5f);
|
||||
_global_buttons[Button::CursorUp] = GlobalButtonInfo ("cursor up", "cursor", 0x60);
|
||||
_global_buttons[Button::CursorDown] = GlobalButtonInfo ("cursor down", "cursor", 0x61);
|
||||
_global_buttons[Button::CursorLeft] = GlobalButtonInfo ("cursor left", "cursor", 0x62);
|
||||
_global_buttons[Button::CursorRight] = GlobalButtonInfo ("cursor right", "cursor", 0x63);
|
||||
_global_buttons[Button::Zoom] = GlobalButtonInfo ("zoom", "none", 0x64);
|
||||
_global_buttons[Button::Scrub] = GlobalButtonInfo ("scrub", "none", 0x65);
|
||||
_global_buttons[Button::UserA] = GlobalButtonInfo ("user a", "user", 0x66);
|
||||
_global_buttons[Button::UserB] = GlobalButtonInfo ("user b", "user", 0x67);
|
||||
_global_buttons[Button::NameValue] = GlobalButtonInfo ("Name/Value", "display", 0x34);
|
||||
_global_buttons[Button::TimecodeBeats] = GlobalButtonInfo ("Timecode/Beats", "display", 0x35);
|
||||
|
||||
_strip_buttons[Button::RecEnable] = StripButtonInfo (0x0, "recenable");
|
||||
_strip_buttons[Button::Solo] = StripButtonInfo (0x08, "solo");
|
||||
_strip_buttons[Button::Mute] = StripButtonInfo (0x10, "mute");
|
||||
_strip_buttons[Button::Select] = StripButtonInfo (0x18, "select");
|
||||
_strip_buttons[Button::VSelect] = StripButtonInfo (0x20, "vselect");
|
||||
_global_buttons[Button::F1] = GlobalButtonInfo ("F1", "function select", 0x36);
|
||||
_global_buttons[Button::F2] = GlobalButtonInfo ("F2", "function select", 0x37);
|
||||
_global_buttons[Button::F3] = GlobalButtonInfo ("F3", "function select", 0x38);
|
||||
_global_buttons[Button::F4] = GlobalButtonInfo ("F4", "function select", 0x39);
|
||||
_global_buttons[Button::F5] = GlobalButtonInfo ("F5", "function select", 0x3a);
|
||||
_global_buttons[Button::F6] = GlobalButtonInfo ("F6", "function select", 0x3b);
|
||||
_global_buttons[Button::F7] = GlobalButtonInfo ("F7", "function select", 0x3c);
|
||||
_global_buttons[Button::F8] = GlobalButtonInfo ("F8", "function select", 0x3d);
|
||||
|
||||
_global_buttons[Button::MidiTracks] = GlobalButtonInfo ("MIDI Tracks", "global view", 0x3e);
|
||||
_global_buttons[Button::Inputs] = GlobalButtonInfo ("Inputs", "global view", 0x3f);
|
||||
_global_buttons[Button::AudioTracks] = GlobalButtonInfo ("Audio Tracks", "global view", 0x40);
|
||||
_global_buttons[Button::AudioInstruments] = GlobalButtonInfo ("Audio Instruments", "global view", 0x41);
|
||||
_global_buttons[Button::Aux] = GlobalButtonInfo ("Aux", "global view", 0x42);
|
||||
_global_buttons[Button::Busses] = GlobalButtonInfo ("Busses", "global view", 0x43);
|
||||
_global_buttons[Button::Outputs] = GlobalButtonInfo ("Outputs", "global view", 0x44);
|
||||
_global_buttons[Button::User] = GlobalButtonInfo ("User", "global view", 0x45);
|
||||
|
||||
_global_buttons[Button::Shift] = GlobalButtonInfo ("Shift", "modifiers", 0x46);
|
||||
_global_buttons[Button::Option] = GlobalButtonInfo ("Option", "modifiers", 0x47);
|
||||
_global_buttons[Button::Ctrl] = GlobalButtonInfo ("Ctrl", "modifiers", 0x48);
|
||||
_global_buttons[Button::CmdAlt] = GlobalButtonInfo ("Cmd/Alt", "modifiers", 0x49);
|
||||
|
||||
_global_buttons[Button::Read] = GlobalButtonInfo ("Read/Off", "automation", 0x4a);
|
||||
_global_buttons[Button::Write] = GlobalButtonInfo ("Write", "automation", 0x4b);
|
||||
_global_buttons[Button::Trim] = GlobalButtonInfo ("Trim", "automation", 0x4c);
|
||||
_global_buttons[Button::Touch] = GlobalButtonInfo ("Touch", "automation", 0x4d);
|
||||
_global_buttons[Button::Latch] = GlobalButtonInfo ("Latch", "automation", 0x4e);
|
||||
_global_buttons[Button::Grp] = GlobalButtonInfo ("Group", "automation", 0x4f);
|
||||
|
||||
_global_buttons[Button::Save] = GlobalButtonInfo ("Save", "utilities", 0x50);
|
||||
_global_buttons[Button::Undo] = GlobalButtonInfo ("Undo", "utilities", 0x51);
|
||||
_global_buttons[Button::Cancel] = GlobalButtonInfo ("Cancel", "utilities", 0x52);
|
||||
_global_buttons[Button::Enter] = GlobalButtonInfo ("Enter", "utilities", 0x53);
|
||||
|
||||
_global_buttons[Button::Marker] = GlobalButtonInfo ("Marker", "transport", 0x54);
|
||||
_global_buttons[Button::Nudge] = GlobalButtonInfo ("Nudge", "transport", 0x55);
|
||||
_global_buttons[Button::Loop] = GlobalButtonInfo ("Cycle", "transport", 0x56);
|
||||
_global_buttons[Button::Drop] = GlobalButtonInfo ("Drop", "transport", 0x57);
|
||||
_global_buttons[Button::Replace] = GlobalButtonInfo ("Replace", "transport", 0x58);
|
||||
_global_buttons[Button::Click] = GlobalButtonInfo ("Click", "transport", 0x59);
|
||||
_global_buttons[Button::Solo] = GlobalButtonInfo ("Solo", "transport", 0x5a);
|
||||
|
||||
_global_buttons[Button::Rewind] = GlobalButtonInfo ("Rewind", "transport", 0x5b);
|
||||
_global_buttons[Button::Ffwd] = GlobalButtonInfo ("Fast Fwd", "transport", 0x5c);
|
||||
_global_buttons[Button::Stop] = GlobalButtonInfo ("Stop", "transport", 0x5d);
|
||||
_global_buttons[Button::Play] = GlobalButtonInfo ("Play", "transport", 0x5e);
|
||||
_global_buttons[Button::Record] = GlobalButtonInfo ("Record", "transport", 0x5f);
|
||||
|
||||
_global_buttons[Button::CursorUp] = GlobalButtonInfo ("Cursor Up", "cursor", 0x60);
|
||||
_global_buttons[Button::CursorDown] = GlobalButtonInfo ("Cursor Down", "cursor", 0x61);
|
||||
_global_buttons[Button::CursorLeft] = GlobalButtonInfo ("Cursor Left", "cursor", 0x62);
|
||||
_global_buttons[Button::CursorRight] = GlobalButtonInfo ("Cursor Right", "cursor", 0x63);
|
||||
_global_buttons[Button::Zoom] = GlobalButtonInfo ("Zoom", "cursor", 0x64);
|
||||
_global_buttons[Button::Scrub] = GlobalButtonInfo ("Scrub", "cursor", 0x65);
|
||||
|
||||
_strip_buttons[Button::Solo] = StripButtonInfo (0x08, "Solo");
|
||||
_strip_buttons[Button::Mute] = StripButtonInfo (0x10, "Mute");
|
||||
_strip_buttons[Button::Select] = StripButtonInfo (0x18, "Select");
|
||||
_strip_buttons[Button::VSelect] = StripButtonInfo (0x20, "V-Select");
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@ class DeviceInfo
|
|||
static std::map<std::string,DeviceInfo> device_info;
|
||||
static void reload_device_info();
|
||||
|
||||
std::string& get_global_button_name(Button::ID);
|
||||
|
||||
const std::map<Button::ID,GlobalButtonInfo>& global_buttons() const { return _global_buttons; }
|
||||
const std::map<Button::ID,StripButtonInfo>& strip_buttons() const { return _strip_buttons; }
|
||||
|
||||
|
|
@ -91,6 +93,7 @@ class DeviceInfo
|
|||
bool _no_handshake;
|
||||
bool _has_meters;
|
||||
std::string _name;
|
||||
std::string _global_button_name;
|
||||
|
||||
std::map<Button::ID,GlobalButtonInfo> _global_buttons;
|
||||
std::map<Button::ID,StripButtonInfo> _strip_buttons;
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
|
|||
|
||||
VBox* fkey_packer = manage (new VBox);
|
||||
HBox* profile_packer = manage (new HBox);
|
||||
HBox* observation_packer = manage (new HBox);
|
||||
|
||||
l = manage (new Gtk::Label (_("Profile/Settings:")));
|
||||
profile_packer->pack_start (*l, false, false);
|
||||
|
|
@ -174,8 +175,12 @@ MackieControlProtocolGUI::MackieControlProtocolGUI (MackieControlProtocol& p)
|
|||
profile_packer->set_spacing (12);
|
||||
profile_packer->set_border_width (12);
|
||||
|
||||
l = manage (new Gtk::Label (_("* Button available at the original Mackie MCU PRO or current device if enabled (NOT implemented yet). Device specific name presented.")));
|
||||
observation_packer->pack_start (*l, false, false);
|
||||
|
||||
fkey_packer->pack_start (*profile_packer, false, false);
|
||||
fkey_packer->pack_start (function_key_scroller, true, true);
|
||||
fkey_packer->pack_start (*observation_packer, false, false);
|
||||
fkey_packer->set_spacing (12);
|
||||
function_key_scroller.set_size_request (700,700);
|
||||
function_key_scroller.property_shadow_type() = Gtk::SHADOW_NONE;
|
||||
|
|
@ -340,13 +345,18 @@ MackieControlProtocolGUI::refresh_function_key_editor ()
|
|||
|
||||
TreeModel::Row row;
|
||||
DeviceProfile dp (_cp.device_profile());
|
||||
DeviceInfo di;
|
||||
|
||||
for (int n = 0; n < Mackie::Button::FinalGlobalButton; ++n) {
|
||||
|
||||
Mackie::Button::ID bid = (Mackie::Button::ID) n;
|
||||
|
||||
row = *(function_key_model->append());
|
||||
if (di.global_buttons().find (bid) == di.global_buttons().end()) {
|
||||
row[function_key_columns.name] = Mackie::Button::id_to_name (bid);
|
||||
} else {
|
||||
row[function_key_columns.name] = di.get_global_button_name (bid) + "*";
|
||||
}
|
||||
row[function_key_columns.id] = bid;
|
||||
|
||||
Glib::RefPtr<Gtk::Action> act;
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ MackieControlProtocol::MackieControlProtocol (Session& session)
|
|||
, _ipmidi_base (MIDI::IPMIDIPort::lowest_ipmidi_port_default)
|
||||
, needs_ipmidi_restart (false)
|
||||
, _metering_active (true)
|
||||
, _initialized (false)
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::MackieControlProtocol\n");
|
||||
|
||||
|
|
@ -415,6 +416,10 @@ MackieControlProtocol::periodic ()
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!_initialized) {
|
||||
initialize();
|
||||
}
|
||||
|
||||
struct timeval now;
|
||||
uint64_t now_usecs;
|
||||
gettimeofday (&now, 0);
|
||||
|
|
@ -430,10 +435,10 @@ MackieControlProtocol::periodic ()
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MackieControlProtocol::update_timecode_beats_led()
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose("MackieControlProtocol::update_timecode_beats_led(): %1\n", _timecode_type));
|
||||
switch (_timecode_type) {
|
||||
case ARDOUR::AnyTime::BBT:
|
||||
update_global_led (Led::Beats, on);
|
||||
|
|
@ -473,6 +478,8 @@ MackieControlProtocol::update_global_led (int id, LedState ls)
|
|||
{
|
||||
boost::shared_ptr<Surface> surface = surfaces.front();
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("MackieControlProtocol::update_global_led (%1, %2)\n", id, ls));
|
||||
|
||||
if (surface->type() != mcu) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -480,6 +487,7 @@ MackieControlProtocol::update_global_led (int id, LedState ls)
|
|||
map<int,Control*>::iterator x = surface->controls_by_device_independent_id.find (id);
|
||||
if (x != surface->controls_by_device_independent_id.end()) {
|
||||
Led * led = dynamic_cast<Led*> (x->second);
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "Writing LedState\n");
|
||||
surface->write (led->set_state (ls));
|
||||
} else {
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Led %1 not found\n", id));
|
||||
|
|
@ -490,6 +498,7 @@ MackieControlProtocol::update_global_led (int id, LedState ls)
|
|||
void
|
||||
MackieControlProtocol::update_surfaces()
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::update_surfaces() init\n");
|
||||
if (!_active) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -498,6 +507,15 @@ MackieControlProtocol::update_surfaces()
|
|||
// _current_initial_bank is initialised by set_state
|
||||
switch_banks (_current_initial_bank, true);
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::update_surfaces() finished\n");
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::initialize()
|
||||
{
|
||||
if (!surfaces.front()->active ()) {
|
||||
return;
|
||||
}
|
||||
// sometimes the jog wheel is a pot
|
||||
surfaces.front()->blank_jog_ring ();
|
||||
|
||||
|
|
@ -506,6 +524,8 @@ MackieControlProtocol::update_surfaces()
|
|||
notify_record_state_changed();
|
||||
notify_transport_state_changed();
|
||||
update_timecode_beats_led();
|
||||
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -755,8 +775,8 @@ MackieControlProtocol::format_timecode_timecode (framepos_t now_frame)
|
|||
os << setw(2) << setfill('0') << timecode.hours;
|
||||
os << setw(2) << setfill('0') << timecode.minutes;
|
||||
os << setw(2) << setfill('0') << timecode.seconds;
|
||||
os << ' ';
|
||||
os << setw(2) << setfill('0') << timecode.frames;
|
||||
os << ' ';
|
||||
|
||||
return os.str();
|
||||
}
|
||||
|
|
@ -881,7 +901,7 @@ MackieControlProtocol::notify_transport_state_changed()
|
|||
// switch various play and stop buttons on / off
|
||||
update_global_button (Button::Loop, session->get_play_loop());
|
||||
update_global_button (Button::Play, session->transport_speed() == 1.0);
|
||||
update_global_button (Button::Stop, !session->transport_rolling());
|
||||
update_global_button (Button::Stop, session->transport_stopped ());
|
||||
update_global_button (Button::Rewind, session->transport_speed() < 0.0);
|
||||
update_global_button (Button::Ffwd, session->transport_speed() > 1.0);
|
||||
|
||||
|
|
|
|||
|
|
@ -289,6 +289,7 @@ class MackieControlProtocol
|
|||
int16_t _ipmidi_base;
|
||||
bool needs_ipmidi_restart;
|
||||
bool _metering_active;
|
||||
bool _initialized;
|
||||
|
||||
ARDOUR::RouteNotificationList _last_selected_routes;
|
||||
|
||||
|
|
@ -302,6 +303,7 @@ class MackieControlProtocol
|
|||
void gui_track_selection_changed (ARDOUR::RouteNotificationListPtr, bool save_list);
|
||||
void _gui_track_selection_changed (ARDOUR::RouteNotificationList*, bool save_list);
|
||||
void ipmidi_restart ();
|
||||
void initialize ();
|
||||
|
||||
/* BUTTON HANDLING */
|
||||
|
||||
|
|
|
|||
|
|
@ -71,12 +71,15 @@ Surface::Surface (MackieControlProtocol& mcp, const std::string& device_name, ui
|
|||
/* only the first Surface object has global controls */
|
||||
|
||||
if (_number == 0) {
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "Surface has global controls\n");
|
||||
if (_mcp.device_info().has_global_controls()) {
|
||||
init_controls ();
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "init_controls done\n");
|
||||
}
|
||||
|
||||
if (_mcp.device_info().has_master_fader()) {
|
||||
setup_master ();
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "setup_master done\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -84,6 +87,7 @@ Surface::Surface (MackieControlProtocol& mcp, const std::string& device_name, ui
|
|||
|
||||
if (n) {
|
||||
init_strips (n);
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "init_strips done\n");
|
||||
}
|
||||
|
||||
connect_to_signals ();
|
||||
|
|
@ -137,23 +141,27 @@ Surface::init_controls()
|
|||
{
|
||||
Group* group;
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "Surface::init_controls: creating groups\n");
|
||||
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["function select"] = new Group ("function select");
|
||||
groups["global view"] = new Group ("global view");
|
||||
groups["master"] = new Group ("master");
|
||||
groups["modifiers"] = new Group ("modifiers");
|
||||
groups["none"] = new Group ("none");
|
||||
groups["transport"] = new Group ("transport");
|
||||
groups["user"] = new Group ("user");
|
||||
groups["master"] = new Group ("master");
|
||||
groups["view"] = new Group ("view");
|
||||
groups["utilities"] = new Group ("utilities");
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "Surface::init_controls: creating jog wheel\n");
|
||||
if (_mcp.device_info().has_jog_wheel()) {
|
||||
_jog_wheel = new Mackie::JogWheel (_mcp);
|
||||
}
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "Surface::init_controls: creating global controls\n");
|
||||
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, mackie_global_controls[n].name, *group);
|
||||
|
|
@ -161,7 +169,7 @@ Surface::init_controls()
|
|||
}
|
||||
|
||||
/* add global buttons */
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "Surface::init_controls: adding global buttons\n");
|
||||
const map<Button::ID,GlobalButtonInfo>& global_buttons (_mcp.device_info().global_buttons());
|
||||
|
||||
for (map<Button::ID,GlobalButtonInfo>::const_iterator b = global_buttons.begin(); b != global_buttons.end(); ++b){
|
||||
|
|
@ -508,7 +516,10 @@ Surface::host_connection_confirmation (const MidiByteArray & bytes)
|
|||
void
|
||||
Surface::turn_it_on ()
|
||||
{
|
||||
if (!_active) {
|
||||
if (_active) {
|
||||
return;
|
||||
}
|
||||
|
||||
_active = true;
|
||||
zero_controls ();
|
||||
for (Strips::iterator s = strips.begin(); s != strips.end(); ++s) {
|
||||
|
|
@ -521,9 +532,6 @@ Surface::turn_it_on ()
|
|||
|
||||
if (_mcp.device_info ().has_global_controls ()) {
|
||||
_mcp.update_global_button (Button::Read, _mcp.metering_active ());
|
||||
_mcp.update_global_button (Button::Stop, _mcp.get_session ().transport_stopped ());
|
||||
_mcp.update_global_button (Button::Play, (_mcp.get_session ().transport_speed () == 1.0f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -635,7 +643,9 @@ Surface::periodic (uint64_t now_usecs)
|
|||
void
|
||||
Surface::write (const MidiByteArray& data)
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Surface::write for %1\n", data));
|
||||
if (_active) {
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "Surface::write surface active\n");
|
||||
_port->write (data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue