diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-05-17 14:11:16 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-05-17 14:11:16 +0000 |
commit | 6001b8d28dd764bada8b9198a5f91e0a2f5251f6 (patch) | |
tree | fb8d3d95bcb78b5e16e14b6a8a8d2e05758cb98d /gtk2_ardour | |
parent | 7a5eed3048ad5894302c53e4b9a56ca7abd2a03c (diff) |
send control now has working metering, and switches back and forth between busses etc. correctly.
git-svn-id: svn://localhost/ardour2/branches/3.0@5092 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/mixer_strip.cc | 56 | ||||
-rw-r--r-- | gtk2_ardour/mixer_strip.h | 2 |
2 files changed, 50 insertions, 8 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 5a8442dc44..4d8d196b4b 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -355,6 +355,12 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt) delete output_selector; output_selector = 0; + if (_current_send) { + _current_send->set_metering (false); + } + + _current_send.reset (); + panners.set_io (rt); gpm.set_io (rt); pre_processor_box.set_route (rt); @@ -401,10 +407,12 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt) rec_enable_button->show(); } else if (!is_track()) { - /* bus */ + /* non-master bus */ - button_table.attach (*show_sends_button, 0, 2, 2, 3); - show_sends_button->show(); + if (!_route->is_master()) { + button_table.attach (*show_sends_button, 0, 2, 2, 3); + show_sends_button->show(); + } } if (_route->phase_invert()) { @@ -1494,15 +1502,33 @@ MixerStrip::switch_io (boost::shared_ptr<Route> target) { boost::shared_ptr<IO> to_display; - if (_route == target) { - /* don't change the display for the target */ + if (_route == target || _route->is_master()) { + /* don't change the display for the target or the master bus */ return; + } else if (!is_track() && show_sends_button) { + /* make sure our show sends button is inactive, + since we're not the target. + */ + show_sends_button->set_active (false); } if (!target) { - to_display = _route; - } else { - to_display = _route->send_io_for (target); + /* switch back to default */ + revert_to_default_display (); + return; + } + + if (_current_send) { + _current_send->set_metering (false); + } + + _current_send = _route->send_for (target); + + if (_current_send) { + to_display = _current_send->io(); + + _current_send->set_metering (true); + _current_send->GoingAway.connect (mem_fun (*this, &MixerStrip::revert_to_default_display)); } gain_meter().set_io (to_display); @@ -1510,3 +1536,17 @@ MixerStrip::switch_io (boost::shared_ptr<Route> target) panner_ui().set_io (to_display); panner_ui().setup_pan (); } + +void +MixerStrip::revert_to_default_display () +{ + if (_current_send) { + _current_send->set_metering (false); + _current_send.reset(); + } + + gain_meter().set_io (_route); + gain_meter().setup_meters (); + panner_ui().set_io (_route); + panner_ui().setup_pan (); +} diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h index 958bfc9422..f0cc4c67c6 100644 --- a/gtk2_ardour/mixer_strip.h +++ b/gtk2_ardour/mixer_strip.h @@ -263,6 +263,8 @@ class MixerStrip : public RouteUI, public Gtk::EventBox void engine_stopped(); void switch_io (boost::shared_ptr<ARDOUR::Route>); + boost::shared_ptr<ARDOUR::Send> _current_send; + void revert_to_default_display (); static int scrollbar_height; }; |