use digital max-peak with RMS meter
This commit is contained in:
parent
5de0aee287
commit
09243a326a
@ -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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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; }
|
||||
|
Loading…
Reference in New Issue
Block a user