Changing active-state needs no color lookup
[ardour.git] / libs / widgets / fastmeter.cc
index cf1d9dd070e5da95f4d7e7c57d448920fc4b4fa5..eda5b23d01dc5fa58ba1aedc20a1c907e52b8905 100644 (file)
@@ -1,20 +1,21 @@
 /*
-    Copyright (C) 2003-2006 Paul Davis
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
+ * Copyright (C) 2003-2006 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2017-2019 Robin Gareus <robin@gareus.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
 
 #include <iostream>
 #include <cmath>
@@ -74,7 +75,7 @@ FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o, int len,
        last_peak_rect.x = 0;
        last_peak_rect.y = 0;
 
-       no_rgba_overlay = ! Glib::getenv("NO_METER_SHADE").empty();
+       no_rgba_overlay = ! Glib::getenv("ARDOUR_NO_METER_SHADE").empty();
 
        _clr[0] = clr0;
        _clr[1] = clr1;
@@ -703,7 +704,7 @@ FastMeter::set (float lvl, float peak)
        if (pixwidth <= 0 || pixheight <=0) return;
 
        if (peak == -1) {
-               if (lvl >= current_peak) {
+               if (lvl >= current_peak && lvl > 0) {
                        current_peak = lvl;
                        hold_state = hold_cnt;
                }