French translation update - fixes
[ardour.git] / gtk2_ardour / level_meter.cc
index 114c28c708756e27d152edf060fb60fa4e776523..70e922bdb30625fcd82cf1658e8587026453770c 100644 (file)
 #include <limits.h>
 
 #include "ardour/meter.h"
+#include "ardour/logmeter.h"
 
 #include <gtkmm2ext/utils.h>
 #include "pbd/fastlog.h"
 
 #include "level_meter.h"
 #include "utils.h"
-#include "logmeter.h"
 #include "gui_thread.h"
 #include "keyboard.h"
 #include "public_editor.h"
 #include "ui_config.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace ARDOUR;
 using namespace ARDOUR_UI_UTILS;
@@ -51,6 +51,7 @@ LevelMeterBase::LevelMeterBase (Session* s, PBD::EventLoop::InvalidationRecord*
        , max_peak (minus_infinity())
        , meter_type (MeterPeak)
        , visible_meter_type (MeterType(0))
+       , midi_count (0)
        , meter_count (0)
        , max_visible_meters (0)
        , color_changed (false)
@@ -254,7 +255,7 @@ LevelMeterBase::setup_meters (int len, int initial_width, int thin_width)
                return; /* do it later or never */
        }
 
-       int32_t nmidi = _meter->input_streams().n_midi();
+       uint32_t nmidi = _meter->input_streams().n_midi();
        uint32_t nmeters = _meter->input_streams().n_total();
        regular_meter_width = initial_width;
        thin_meter_width = thin_width;
@@ -276,6 +277,7 @@ LevelMeterBase::setup_meters (int len, int initial_width, int thin_width)
        width = rint (width * UIConfiguration::instance().get_ui_scale());
 
        if (   meters.size() > 0
+           && nmidi == midi_count
            && nmeters == meter_count
            && meters[0].width == width
            && meters[0].length == len
@@ -311,7 +313,7 @@ LevelMeterBase::setup_meters (int len, int initial_width, int thin_width)
                b[1] = UIConfiguration::instance().color ("meter background top");
                b[2] = 0x991122ff; // red highlight gradient Bot
                b[3] = 0x551111ff; // red highlight gradient Top
-               if (n < nmidi) {
+               if ((uint32_t) n < nmidi) {
                        c[0] = UIConfiguration::instance().color ("midi meter color0");
                        c[1] = UIConfiguration::instance().color ("midi meter color1");
                        c[2] = UIConfiguration::instance().color ("midi meter color2");
@@ -450,7 +452,7 @@ LevelMeterBase::setup_meters (int len, int initial_width, int thin_width)
                                }
                        }
                }
-               if (meters[n].width != width || meters[n].length != len || color_changed || meter_type != visible_meter_type) {
+               if (meters[n].width != width || meters[n].length != len || color_changed || meter_type != visible_meter_type || nmidi != midi_count) {
                        bool hl = meters[n].meter ? meters[n].meter->get_highlight() : false;
                        meters[n].packed = false;
                        delete meters[n].meter;
@@ -481,6 +483,7 @@ LevelMeterBase::setup_meters (int len, int initial_width, int thin_width)
        //show();
        color_changed = false;
        visible_meter_type = meter_type;
+       midi_count = nmidi;
        meter_count = nmeters;
 }