fix meterbridge metric display switch

This commit is contained in:
Robin Gareus 2013-07-07 11:58:27 +02:00
parent 3a8f5a9770
commit 4a9e79e53f
3 changed files with 9 additions and 5 deletions

View File

@ -566,7 +566,7 @@ Meterbridge::update_metrics ()
{
bool have_midi = false;
for (list<MeterBridgeStrip>::iterator i = strips.begin(); i != strips.end(); ++i) {
if ( (*i).s->has_midi () && (*i).visible) {
if ( (*i).s->has_midi() && (*i).visible) {
have_midi = true;
break;
}
@ -581,13 +581,14 @@ Meterbridge::update_metrics ()
void
Meterbridge::sync_order_keys (RouteSortOrderKey src)
{
Glib::Threads::Mutex::Lock lm (_resync_mutex);
MeterOrderRouteSorter sorter;
std::list<MeterBridgeStrip> copy (strips);
copy.sort(sorter);
strips.sort(sorter);
int pos = 0;
for (list<MeterBridgeStrip>::iterator i = copy.begin(); i != copy.end(); ++i) {
for (list<MeterBridgeStrip>::iterator i = strips.begin(); i != strips.end(); ++i) {
if (! (*i).s->route()->active()) {
(*i).s->hide();

View File

@ -20,6 +20,8 @@
#ifndef __ardour_meterbridge_h__
#define __ardour_meterbridge_h__
#include <glibmm/thread.h>
#include <gtkmm/box.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/label.h>
@ -81,6 +83,7 @@ class Meterbridge :
void session_going_away ();
void sync_order_keys (ARDOUR::RouteSortOrderKey src);
void resync_order ();
mutable Glib::Threads::Mutex _resync_mutex;
struct MeterBridgeStrip {
MeterStrip *s;

View File

@ -95,7 +95,7 @@ PeakMeter::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end_fr
// Meter audio in to the rest of the peaks
for (uint32_t i = 0; i < n_audio; ++i, ++n) {
_peak_signal[n] = compute_peak (bufs.get_audio(i).data(), nframes, _peak_signal[n]);
if (1 /* TODO use separate bit-flags for mixer|meterbridge */ || _meter_type & MeterKrms) {
if (/* TODO use separate bit-flags for mixer,meterbridge,.. */ /* 1 || */ _meter_type & MeterKrms) {
_kmeter[i]->process(bufs.get_audio(i).data(), nframes);
}
}