Make the trim knob on busses show only if there is audio
The trim knob has been designed to operate only on audio channels. If the bus has none, hide the knob that would otherwise have no effect at all. Factor the trim control show/hide code out of MixerStrip::set_route(), and also call that code in response to I/O changes in the route.
This commit is contained in:
parent
ba815a903b
commit
4093cf6b90
@ -457,6 +457,20 @@ MixerStrip::name() const
|
||||
return string();
|
||||
}
|
||||
|
||||
void
|
||||
MixerStrip::update_trim_control ()
|
||||
{
|
||||
if (route()->trim() && route()->trim()->active() &&
|
||||
route()->n_inputs().n_audio() > 0) {
|
||||
trim_control.show ();
|
||||
trim_control.set_controllable (route()->trim()->gain_control());
|
||||
} else {
|
||||
trim_control.hide ();
|
||||
boost::shared_ptr<Controllable> none;
|
||||
trim_control.set_controllable (none);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MixerStrip::set_route (boost::shared_ptr<Route> rt)
|
||||
{
|
||||
@ -563,14 +577,7 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
|
||||
monitor_disk_button->hide ();
|
||||
}
|
||||
|
||||
if (route()->trim() && route()->trim()->active()) {
|
||||
trim_control.show ();
|
||||
trim_control.set_controllable (route()->trim()->gain_control());
|
||||
} else {
|
||||
trim_control.hide ();
|
||||
boost::shared_ptr<Controllable> none;
|
||||
trim_control.set_controllable (none);
|
||||
}
|
||||
update_trim_control();
|
||||
|
||||
if (is_midi_track()) {
|
||||
if (midi_input_enable_button == 0) {
|
||||
@ -1509,6 +1516,7 @@ void
|
||||
MixerStrip::io_changed_proxy ()
|
||||
{
|
||||
Glib::signal_idle().connect_once (sigc::mem_fun (*this, &MixerStrip::update_panner_choices));
|
||||
Glib::signal_idle().connect_once (sigc::mem_fun (*this, &MixerStrip::update_trim_control));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -253,6 +253,7 @@ class MixerStrip : public AxisView, public RouteUI, public Gtk::EventBox
|
||||
PBD::ScopedConnection panstyle_connection;
|
||||
void connect_to_pan ();
|
||||
void update_panner_choices ();
|
||||
void update_trim_control ();
|
||||
|
||||
void update_diskstream_display ();
|
||||
void update_input_display ();
|
||||
|
Loading…
Reference in New Issue
Block a user