13
0

use digital max-peak with RMS meter

This commit is contained in:
Robin Gareus 2013-07-07 19:31:09 +02:00
parent 5de0aee287
commit 09243a326a
3 changed files with 11 additions and 6 deletions

View File

@ -113,7 +113,7 @@ LevelMeter::update_meters ()
if (n < nmidi) {
(*i).meter->set (peak);
} else {
(*i).meter->set (log_meter (peak));
(*i).meter->set (log_meter (peak), log_meter(_meter->meter_level(n, MeterPeak)));
}
}
}

View File

@ -431,21 +431,26 @@ FastMeter::vertical_expose (GdkEventExpose* ev)
}
void
FastMeter::set (float lvl)
FastMeter::set (float lvl, float peak)
{
float old_level = current_level;
float old_peak = current_peak;
float peak_lvl = peak;
if (peak_lvl == -1) {
peak_lvl = lvl;
}
current_level = lvl;
if (lvl > current_peak) {
current_peak = lvl;
if (peak_lvl >= current_peak) {
current_peak = peak_lvl;
hold_state = hold_cnt;
}
if (hold_state > 0) {
if (--hold_state == 0) {
current_peak = lvl;
current_peak = peak_lvl;
}
}

View File

@ -51,7 +51,7 @@ class FastMeter : public Gtk::DrawingArea {
);
virtual ~FastMeter ();
void set (float level);
void set (float level, float peak = -1);
void clear ();
float get_level() { return current_level; }