fix missing negation from previous MCP commit
[ardour.git] / libs / surfaces / mackie / strip.cc
index af859ab41d1abb9a49e4fdb96533571a324a30c3..a80306c799fc789b5d6f27f41505d392f81243ec 100644 (file)
@@ -80,7 +80,10 @@ Strip::Strip (Surface& s, const std::string& name, int index, const map<Button::
 {
        _fader = dynamic_cast<Fader*> (Fader::factory (*_surface, index, "fader", *this));
        _vpot = dynamic_cast<Pot*> (Pot::factory (*_surface, Pot::ID + index, "vpot", *this));
-       _meter = dynamic_cast<Meter*> (Meter::factory (*_surface, index, "meter", *this));
+
+       if (s.mcp().device_info().has_meters()) {
+               _meter = dynamic_cast<Meter*> (Meter::factory (*_surface, index, "meter", *this));
+       }
 
        for (map<Button::ID,StripButtonInfo>::const_iterator b = strip_buttons.begin(); b != strip_buttons.end(); ++b) {
                Button* bb = dynamic_cast<Button*> (Button::factory (*_surface, b->first, b->second.base_id + index, b->second.name, *this));
@@ -130,7 +133,7 @@ Strip::add (Control & control)
 }
 
 void
-Strip::set_route (boost::shared_ptr<Route> r, bool with_messages)
+Strip::set_route (boost::shared_ptr<Route> r, bool /*with_messages*/)
 {
        if (_controls_locked) {
                return;
@@ -163,7 +166,9 @@ Strip::set_route (boost::shared_ptr<Route> r, bool with_messages)
 
        set_vpot_parameter (PanAzimuthAutomation);
        
-       _route->solo_control()->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_solo_changed, this), ui_context());
+       _route->solo_changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_solo_changed, this), ui_context());
+       _route->listen_changed.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_solo_changed, this), ui_context());
+
        _route->mute_control()->Changed.connect(route_connections, MISSING_INVALIDATOR, boost::bind (&Strip::notify_mute_changed, this), ui_context());
 
        boost::shared_ptr<Pannable> pannable = _route->pannable();
@@ -239,7 +244,7 @@ void
 Strip::notify_solo_changed ()
 {
        if (_route && _solo) {
-               _surface->write (_solo->set_state (_route->soloed() ? on : off));
+               _surface->write (_solo->set_state ((_route->soloed() || _route->listening_via_monitor()) ? on : off));
        }
 }
 
@@ -419,7 +424,7 @@ Strip::notify_panner_width_changed (bool force_update)
 }
 
 void
-Strip::select_event (Button& button, ButtonState bs)
+Strip::select_event (Button&, ButtonState bs)
 {
        DEBUG_TRACE (DEBUG::MackieControl, "select button\n");
        
@@ -454,15 +459,16 @@ Strip::select_event (Button& button, ButtonState bs)
 }
 
 void
-Strip::vselect_event (Button& button, ButtonState bs)
+Strip::vselect_event (Button&, ButtonState bs)
 {
        if (bs == press) {
 
                int ms = _surface->mcp().modifier_state();
                                
                if (ms & MackieControlProtocol::MODIFIER_SHIFT) {
-                       boost::shared_ptr<AutomationControl> ac = button.control ();
 
+                       boost::shared_ptr<AutomationControl> ac = _vpot->control ();
+                               
                        if (ac) {
                                
                                /* reset to default/normal value */
@@ -470,6 +476,7 @@ Strip::vselect_event (Button& button, ButtonState bs)
                        }
 
                }  else {
+
                        DEBUG_TRACE (DEBUG::MackieControl, "switching to next pot mode\n");
                        next_pot_mode ();
                }
@@ -478,7 +485,7 @@ Strip::vselect_event (Button& button, ButtonState bs)
 }
 
 void
-Strip::fader_touch_event (Button& button, ButtonState bs)
+Strip::fader_touch_event (Button&, ButtonState bs)
 {
        DEBUG_TRACE (DEBUG::MackieControl, string_compose ("fader touch, press ? %1\n", (bs == press)));
        
@@ -685,7 +692,7 @@ Strip::update_meter ()
 {
        if (_meter) {
                float dB = const_cast<PeakMeter&> (_route->peak_meter()).peak_power (0);
-               _surface->write (_meter->update_message (dB));
+               _meter->send_update (*_surface, dB);
        }
 }
 
@@ -754,9 +761,9 @@ Strip::unlock_controls ()
 }
 
 void
-Strip::gui_selection_changed (ARDOUR::RouteNotificationListPtr rl)
+Strip::gui_selection_changed (const ARDOUR::StrongRouteNotificationList& rl)
 {
-       for (ARDOUR::RouteNotificationList::iterator i = rl->begin(); i != rl->end(); ++i) {
+       for (ARDOUR::StrongRouteNotificationList::const_iterator i = rl.begin(); i != rl.end(); ++i) {
                if ((*i) == _route) {
                        _surface->write (_select->set_state (on));
                        return;