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
This commit is contained in:
Paul Davis
2009-05-17 14:11:16 +00:00
parent 7a5eed3048
commit 6001b8d28d
4 changed files with 55 additions and 13 deletions

View File

@@ -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 ();
}

View File

@@ -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;
};

View File

@@ -181,7 +181,7 @@ class Route : public IO
boost::shared_ptr<Delivery> control_outs() const { return _control_outs; }
boost::shared_ptr<Delivery> main_outs() const { return _main_outs; }
boost::shared_ptr<IO> send_io_for (boost::shared_ptr<const IO> target) const;
boost::shared_ptr<Send> send_for (boost::shared_ptr<const IO> target) const;
/** A record of the stream configuration at some point in the processor list.
* Used to return where and why an processor list configuration request failed.

View File

@@ -2683,8 +2683,8 @@ Route::set_name (const string& str)
return ret;
}
boost::shared_ptr<IO>
Route::send_io_for (boost::shared_ptr<const IO> target) const
boost::shared_ptr<Send>
Route::send_for (boost::shared_ptr<const IO> target) const
{
Glib::RWLock::ReaderLock lm (_processor_lock);
@@ -2693,10 +2693,10 @@ Route::send_io_for (boost::shared_ptr<const IO> target) const
if ((send = boost::dynamic_pointer_cast<Send>(*i)) != 0) {
if (send->io()->connected_to (target)) {
return send->io();
return send;
}
}
}
return boost::shared_ptr<IO>();
return boost::shared_ptr<Send>();
}