summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2013-07-25 10:53:11 +0200
committerRobin Gareus <robin@gareus.org>2013-07-25 10:53:11 +0200
commit132549c48a65271dfd81a3f550305e3990caed9f (patch)
treee6d7033adbb26981b44f37c6e41243df5122c436 /libs/ardour
parent3c33ff26335f9fdd6ea327cf5829345c3d4bbdc5 (diff)
reset meters only when *really* necessary
..and continue to calculate fall-off in audio-cycle (rather than UI thread) TODO: check if this works properly when switching between audio/midi meter modes on a midi-track. One of the motivations to always reset meters when the meter-point changes was to resolve peak-hold & fall-off issues when a midi-meter replaces an audio-meter and vice versa.
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/meter.cc22
-rw-r--r--libs/ardour/route.cc3
-rw-r--r--libs/ardour/track.cc3
3 files changed, 13 insertions, 15 deletions
diff --git a/libs/ardour/meter.cc b/libs/ardour/meter.cc
index 3c2d28ef1b..0c23ea168d 100644
--- a/libs/ardour/meter.cc
+++ b/libs/ardour/meter.cc
@@ -186,20 +186,20 @@ PeakMeter::configure_io (ChanCount in, ChanCount out)
void
PeakMeter::reflect_inputs (const ChanCount& in)
{
- current_meters = in;
-
- const size_t limit = min (_peak_signal.size(), (size_t) current_meters.n_total ());
- const size_t n_midi = min (_peak_signal.size(), (size_t) current_meters.n_midi());
-
- for (size_t n = 0; n < limit; ++n) {
- if (n < n_midi) {
- _visible_peak_power[n] = 0;
- } else {
- _visible_peak_power[n] = -INFINITY;
+ for (uint32_t i = in.n_total(); i < current_meters.n_total(); ++i) {
+ if (i < _peak_signal.size()) {
+ _peak_signal[i] = 0.0f;
}
}
+ for (uint32_t i = in.n_audio(); i < current_meters.n_audio(); ++i) {
+ if (i >= _kmeter.size()) continue;
+ _kmeter[i]->reset();
+ _iec1meter[i]->reset();
+ _iec2meter[i]->reset();
+ _vumeter[i]->reset();
+ }
- reset();
+ current_meters = in;
reset_max();
ConfigurationChanged (in, in); /* EMIT SIGNAL */
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 5c794fb379..dad1922488 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -3152,9 +3152,6 @@ Route::set_meter_point (MeterPoint p, bool force)
*/
}
- _meter->reset();
- _meter->reset_max();
-
meter_change (); /* EMIT SIGNAL */
bool const meter_visibly_changed = (_meter->display_to_user() != meter_was_visible_to_user);
diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc
index c6a348ddfb..5dfc956c75 100644
--- a/libs/ardour/track.cc
+++ b/libs/ardour/track.cc
@@ -436,7 +436,8 @@ Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
}
if (no_meter) {
- _meter->reset();
+ BufferSet& bufs (_session.get_silent_buffers (n_process_buffers()));
+ _meter->run (bufs, 0, 0, nframes, true);
_input->process_input (boost::shared_ptr<Processor>(), start_frame, end_frame, nframes);
} else {
_input->process_input (_meter, start_frame, end_frame, nframes);