diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-11 19:16:49 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-11 19:16:49 +0000 |
commit | f40d6b6440df8579a3b33051c6f67e9bd764152b (patch) | |
tree | be93f5b197836c146a8f9fecd473ff61a10f850c | |
parent | 5097af6a13828adf9f1bb87bd8bd8557963c0d7e (diff) |
MCP: more view mode support, use 6 bits for pot information, more mute debug trace
git-svn-id: svn://localhost/ardour2/branches/3.0@11912 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | libs/surfaces/mackie/led.cc | 9 | ||||
-rw-r--r-- | libs/surfaces/mackie/mackie_control_protocol.cc | 102 | ||||
-rw-r--r-- | libs/surfaces/mackie/mackie_control_protocol.h | 1 | ||||
-rw-r--r-- | libs/surfaces/mackie/strip.cc | 2 | ||||
-rw-r--r-- | libs/surfaces/mackie/surface.cc | 4 |
5 files changed, 76 insertions, 42 deletions
diff --git a/libs/surfaces/mackie/led.cc b/libs/surfaces/mackie/led.cc index 43628e92bf..cd57c45d3f 100644 --- a/libs/surfaces/mackie/led.cc +++ b/libs/surfaces/mackie/led.cc @@ -46,11 +46,14 @@ Led::set_state (LedState new_state) switch (state.state()) { case LedState::on: - msg = 0x7f; break; + msg = 0x7f; + break; case LedState::off: - msg = 0x00; break; + msg = 0x00; + break; case LedState::flashing: - msg = 0x01; break; + msg = 0x01; + break; case LedState::none: return MidiByteArray (); } diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 6ad63df9a7..94d1de2917 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -211,19 +211,44 @@ MackieControlProtocol::get_sorted_routes() // sort in remote_id order, and exclude master, control and hidden routes // and any routes that are already set. + for (RouteList::iterator it = routes->begin(); it != routes->end(); ++it) { + Route & route = **it; - if ( - route.active() - && !route.is_master() - && !route.is_hidden() - && !route.is_monitor() - && remote_ids.find (route.remote_control_id()) == remote_ids.end() - ) { - sorted.push_back (*it); - remote_ids.insert (route.remote_control_id()); + + if (remote_ids.find (route.remote_control_id()) != remote_ids.end()) { + continue; + } + + if (route.is_hidden() || route.is_master() || route.is_monitor()) { + continue; + } + + switch (_view_mode) { + case Global: + break; + case AudioTracks: + break; + case Busses: + break; + case MidiTracks: + break; + case Dynamics: + break; + case EQ: + break; + case Loop: + break; + case Sends: + break; + case Plugins: + break; } + + sorted.push_back (*it); + remote_ids.insert (route.remote_control_id()); } + sort (sorted.begin(), sorted.end(), RouteByRemoteId()); return sorted; } @@ -1071,34 +1096,37 @@ MackieControlProtocol::set_view_mode (ViewMode m) boost::shared_ptr<Surface> surface = surfaces.front(); - if (surface->type() != mcu) { - return; + if (surface->type() == mcu) { + switch (_view_mode) { + case Global: + surface->write (surface->two_char_display ("Gl")); + break; + case Dynamics: + surface->write (surface->two_char_display ("Dy")); + break; + case EQ: + surface->write (surface->two_char_display ("EQ")); + break; + case Loop: + surface->write (surface->two_char_display ("LP")); + break; + case AudioTracks: + surface->write (surface->two_char_display ("AT")); + break; + case MidiTracks: + surface->write (surface->two_char_display ("MT")); + break; + case Busses: + surface->write (surface->two_char_display ("Bs")); + break; + case Sends: + surface->write (surface->two_char_display ("Sn")); + break; + case Plugins: + surface->write (surface->two_char_display ("Pl")); + break; + } } - switch (_view_mode) { - case Global: - surface->write (surface->two_char_display ("Gl")); - break; - case Dynamics: - surface->write (surface->two_char_display ("Dy")); - break; - case EQ: - surface->write (surface->two_char_display ("EQ")); - break; - case Loop: - surface->write (surface->two_char_display ("LP")); - break; - case AudioTracks: - surface->write (surface->two_char_display ("AT")); - break; - case MidiTracks: - surface->write (surface->two_char_display ("MT")); - break; - case Busses: - surface->write (surface->two_char_display ("Bs")); - break; - case Sends: - surface->write (surface->two_char_display ("Sn")); - break; - } + switch_banks (_current_initial_bank, true); } diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h index 2da47821d6..910be0921c 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.h +++ b/libs/surfaces/mackie/mackie_control_protocol.h @@ -97,6 +97,7 @@ class MackieControlProtocol MidiTracks, Busses, Sends, + Plugins, }; enum FlipMode { diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc index d924825bc7..9c68862872 100644 --- a/libs/surfaces/mackie/strip.cc +++ b/libs/surfaces/mackie/strip.cc @@ -343,6 +343,8 @@ Strip::notify_mute_changed () DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Strip %1 mute changed\n", _index)); if (_route && _mute) { DEBUG_TRACE (DEBUG::MackieControl, string_compose ("\troute muted ? %1\n", _route->muted())); + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("mute message: %1\n", _mute->led().set_state (_route->muted() ? on : off))); + _surface->write (_mute->led().set_state (_route->muted() ? on : off)); } } diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc index 97afee5c51..d47b4e260d 100644 --- a/libs/surfaces/mackie/surface.cc +++ b/libs/surfaces/mackie/surface.cc @@ -399,9 +399,9 @@ Surface::handle_midi_controller_message (MIDI::Parser &, MIDI::EventTwoBytes* ev // bit 6 gives the sign float sign = (ev->value & 0x40) == 0 ? 1.0 : -1.0; - // bits 0..3 give the velocity. we interpret this as "ticks + // bits 0..5 give the velocity. we interpret this as "ticks // moved before this message was sent" - float ticks = (ev->value & 0xf); + float ticks = (ev->value & 0x3f); if (ticks == 0) { /* euphonix and perhaps other devices send zero when they mean 1, we think. |