diff options
author | Carl Hetherington <carl@carlh.net> | 2011-01-09 15:10:59 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-01-09 15:10:59 +0000 |
commit | 173a8894e370eb4494d3dd996abb61b22913b466 (patch) | |
tree | 71a32e7915ad5479a7447655c914efe4250ec050 | |
parent | ddb1a76e5b1b0645d28a83f4735f2070b204fc38 (diff) |
Fix setup of route meter point on load, and fix intermittent left-channel-only metering (#3699).
git-svn-id: svn://localhost/ardour2/branches/3.0@8486 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/gain_meter.cc | 10 | ||||
-rw-r--r-- | gtk2_ardour/gain_meter.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/meter.h | 6 | ||||
-rw-r--r-- | libs/ardour/ardour/route.h | 2 | ||||
-rw-r--r-- | libs/ardour/meter.cc | 6 | ||||
-rw-r--r-- | libs/ardour/route.cc | 8 |
6 files changed, 19 insertions, 15 deletions
diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc index 571f140bac..7dd7f88d7c 100644 --- a/gtk2_ardour/gain_meter.cc +++ b/gtk2_ardour/gain_meter.cc @@ -530,7 +530,7 @@ GainMeterBase::meter_press(GdkEventButton* ev) */ if (ev->button == 1) { - set_mix_group_meter_point (*_route, next_meter_point (_route->meter_point())); + set_route_group_meter_point (*_route, next_meter_point (_route->meter_point())); } } else { @@ -572,12 +572,12 @@ GainMeterBase::set_meter_point (Route& route, MeterPoint mp) } void -GainMeterBase::set_mix_group_meter_point (Route& route, MeterPoint mp) +GainMeterBase::set_route_group_meter_point (Route& route, MeterPoint mp) { - RouteGroup* mix_group; + RouteGroup* route_group; - if((mix_group = route.route_group()) != 0){ - mix_group->foreach_route (boost::bind (&Route::set_meter_point, _1, mp)); + if ((route_group = route.route_group ()) != 0) { + route_group->foreach_route (boost::bind (&Route::set_meter_point, _1, mp, false)); } else { route.set_meter_point (mp); } diff --git a/gtk2_ardour/gain_meter.h b/gtk2_ardour/gain_meter.h index 2c481837ae..600f7c2c00 100644 --- a/gtk2_ardour/gain_meter.h +++ b/gtk2_ardour/gain_meter.h @@ -158,7 +158,7 @@ class GainMeterBase : virtual public sigc::trackable, ARDOUR::SessionHandlePtr gint start_gain_touch (GdkEventButton*); gint end_gain_touch (GdkEventButton*); - void set_mix_group_meter_point (ARDOUR::Route&, ARDOUR::MeterPoint); + void set_route_group_meter_point (ARDOUR::Route&, ARDOUR::MeterPoint); void set_meter_point (ARDOUR::Route&, ARDOUR::MeterPoint); gint meter_release (GdkEventButton*); gint meter_press (GdkEventButton*); diff --git a/libs/ardour/ardour/meter.h b/libs/ardour/ardour/meter.h index 7ff910a91b..e7317f854f 100644 --- a/libs/ardour/ardour/meter.h +++ b/libs/ardour/ardour/meter.h @@ -93,7 +93,11 @@ public: private: friend class IO; - + + /** The number of meters that we are currently handling; + * may be different to _configured_input and _configured_output + * as it can be altered outside a ::configure_io by ::reflect_inputs. + */ ChanCount current_meters; std::vector<float> _peak_power; diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 5a6fbd04b6..0bb9b69596 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -161,7 +161,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, void set_denormal_protection (bool yn); bool denormal_protection() const; - void set_meter_point (MeterPoint); + void set_meter_point (MeterPoint, bool force = false); void infer_meter_point () const; MeterPoint meter_point() const { return _meter_point; } void meter (); diff --git a/libs/ardour/meter.cc b/libs/ardour/meter.cc index 226cf417f3..1ea3a090dd 100644 --- a/libs/ardour/meter.cc +++ b/libs/ardour/meter.cc @@ -45,8 +45,8 @@ PeakMeter::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_fr return; } - const uint32_t n_audio = min(_configured_input.n_audio(), bufs.count().n_audio()); - const uint32_t n_midi = min(_configured_input.n_midi(), bufs.count().n_midi()); + const uint32_t n_audio = min (current_meters.n_audio(), bufs.count().n_audio()); + const uint32_t n_midi = min (current_meters.n_midi(), bufs.count().n_midi()); uint32_t n = 0; @@ -129,7 +129,7 @@ PeakMeter::reflect_inputs (const ChanCount& in) void PeakMeter::reset_max_channels (const ChanCount& chn) { - uint32_t limit = chn.n_total(); + uint32_t const limit = chn.n_total(); while (_peak_power.size() > limit) { _peak_power.pop_back(); diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 90867940a1..25024b992a 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -1969,7 +1969,7 @@ Route::_set_state (const XMLNode& node, int version, bool /*call_base*/) if ((prop = node.property (X_("meter-point"))) != 0) { MeterPoint mp = MeterPoint (string_2_enum (prop->value (), _meter_point)); - set_meter_point (mp); + set_meter_point (mp, true); if (_meter) { _meter->set_display_to_user (_meter_point == MeterCustom); } @@ -2937,11 +2937,11 @@ Route::flush_processors () } void -Route::set_meter_point (MeterPoint p) +Route::set_meter_point (MeterPoint p, bool force) { /* CAN BE CALLED FROM PROCESS CONTEXT */ - if (_meter_point == p) { + if (_meter_point == p && !force) { return; } @@ -2981,7 +2981,7 @@ Route::set_meter_point (MeterPoint p) _meter->reflect_inputs (m_in); _processors.insert (loc, _meter); - + /* we do not need to reconfigure the processors, because the meter (a) is always ready to handle processor_max_streams (b) is always an N-in/N-out processor, and thus moving |