MCP: maybe get vpot id's right; more debug tracing for gain notify
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 11 Apr 2012 23:52:37 +0000 (23:52 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 11 Apr 2012 23:52:37 +0000 (23:52 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@11926 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/surfaces/mackie/pot.cc
libs/surfaces/mackie/pot.h
libs/surfaces/mackie/strip.cc

index 3b8e8b65a5de4180fa61ea30f2efea75a497fb24..d21a18f6ae48fbd9a90a7139142f291ec0f07ba0 100644 (file)
@@ -81,7 +81,10 @@ Pot::update_message ()
                msg +=  (lrintf (value * 10.0) + 1) & 0x0f; // 0b00001111
        }
 
-       return MidiByteArray (3, 0xb0, id(), msg);
+       /* outbound LED message requires 0x20 to be added to the LED's id
+        */
+
+       return MidiByteArray (3, 0xb0, 0x20 + id(), msg);
 
 }
        
index ccb6eec0f13e19269ed6be6793ec4cdcbdf7a688..5e9ca6e68235c441100a6fcc437a53a051e53e07 100644 (file)
@@ -9,7 +9,7 @@ class Pot : public Control
 {
 public:
        enum base_id_t {
-               base_id = 0x30,
+               base_id = 0x10,
        };
 
        enum Mode {
index ac20bb49ac3cd0152cda656fc2740dc8cca9252f..c3df0e4c19798d417b2d3b59fb9c1d01a18a2548 100644 (file)
@@ -259,7 +259,7 @@ Strip::notify_route_deleted ()
 void 
 Strip::notify_gain_changed (bool force_update)
 {
-       DEBUG_TRACE (DEBUG::MackieControl, string_compose ("gain changed for strip %1\n", _index));
+       DEBUG_TRACE (DEBUG::MackieControl, string_compose ("gain changed for strip %1, flip mode\n", _index, _surface->mcp().flip_mode()));
 
        if (_route && _fader) {
                
@@ -282,11 +282,16 @@ Strip::notify_gain_changed (bool force_update)
                        }
                        
                        pos = gain_to_slider_position (pos);
+
                        if (force_update || pos != _last_fader_position_written) {
                                _surface->write (_fader->set_position (pos));
                                _last_fader_position_written = pos;
+                       } else {
+                               DEBUG_TRACE (DEBUG::MackieControl, "value is stale, no message sent\n");
                        }
-               } 
+               } else {
+                       DEBUG_TRACE (DEBUG::MackieControl, "fader in use, no message sent\n");
+               }
        }
 }