13
0

MCP: probably fix crash on solo, another debug trace

git-svn-id: svn://localhost/ardour2/branches/3.0@11901 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-04-11 15:50:02 +00:00
parent 3f647a9dcd
commit 753096ec18
4 changed files with 31 additions and 15 deletions

View File

@ -41,15 +41,16 @@ class Control
{
public:
enum base_id_t {
/* ID's associated with pot (Controller) messages */
pot_base_id = 0x30,
jog_base_id = 0x3c,
fader_touch_button_base_id = 0xe0,
vselect_button_base_id = 0x20,
select_button_base_id = 0x18,
mute_button_base_id = 0x10,
solo_button_base_id = 0x08,
/* ID's associated with button (NoteOn) messages */
recenable_button_base_id = 0x0,
meter_base_id = 0xd0,
solo_button_base_id = 0x08,
mute_button_base_id = 0x10,
select_button_base_id = 0x18,
vselect_button_base_id = 0x20,
fader_touch_button_base_id = 0xe0,
};
Control (int id, std::string name, Group& group);

View File

@ -700,10 +700,10 @@ MackieControlProtocol::notify_solo_active_changed (bool active)
{
boost::shared_ptr<Surface> surface = surfaces.front();
Button * rude_solo = reinterpret_cast<Button*> (surface->controls_by_name["solo"]);
Led* rude_solo = dynamic_cast<Led*> (surface->controls_by_name["solo"]);
if (rude_solo) {
surface->write (rude_solo->led().set_state (active ? flashing : off));
surface->write (rude_solo->set_state (active ? flashing : off));
}
}

View File

@ -413,20 +413,33 @@ Strip::handle_button (Button& button, ButtonState bs)
// no route so always switch the light off
// because no signals will be emitted by a non-route
_surface->write (button.led().set_state (off));
return;
}
if (bs == press) {
if (button.name() == "recenable") {
if (button.raw_id() >= Control::recenable_button_base_id &&
button.raw_id() < Control::recenable_button_base_id + 8) {
_route->set_record_enabled (!_route->record_enabled(), this);
} else if (button.name() == "mute") {
} else if (button.raw_id() >= Control::mute_button_base_id &&
button.raw_id() < Control::mute_button_base_id + 8) {
_route->set_mute (!_route->muted(), this);
} else if (button.name() == "solo") {
} else if (button.raw_id() >= Control::solo_button_base_id &&
button.raw_id() < Control::solo_button_base_id + 8) {
_route->set_solo (!_route->soloed(), this);
} else if (button.name() == "select") {
} else if (button.raw_id() >= Control::select_button_base_id &&
button.raw_id() < Control::select_button_base_id + 8) {
_surface->mcp().select_track (_route);
} else if (button.name() == "vselect") {
// TODO could be used to select different things to apply the pot to?
//state = default_button_press (dynamic_cast<Button&> (control));
} else if (button.raw_id() >= Control::vselect_button_base_id &&
button.raw_id() < Control::vselect_button_base_id + 8) {
}
}

View File

@ -375,6 +375,8 @@ Surface::handle_midi_note_on_message (MIDI::Parser &, MIDI::EventTwoBytes* ev)
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("global button %1\n", button->raw_id()));
_mcp.handle_button_event (*this, *button, ev->velocity == 0x7f ? press : release);
}
} else {
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("no button found for %1\n", ev->note_number));
}
}