summaryrefslogtreecommitdiff
path: root/gtk2_ardour/mixer_strip.cc
diff options
context:
space:
mode:
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2016-07-22 00:44:22 +0200
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2016-07-24 13:51:11 +0200
commit4093cf6b90e1479ed1589c587baa572b6047d383 (patch)
tree4af523d1e27aecde623038fcf29bd6c87e66b02a /gtk2_ardour/mixer_strip.cc
parentba815a903b679b002f48589e77032ca4a2799feb (diff)
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.
Diffstat (limited to 'gtk2_ardour/mixer_strip.cc')
-rw-r--r--gtk2_ardour/mixer_strip.cc24
1 files changed, 16 insertions, 8 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index b5ae269c7f..1e8717d327 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -458,6 +458,20 @@ MixerStrip::name() const
}
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)
{
//the rec/monitor stuff only shows up for tracks.
@@ -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