diff --git a/gtk2_ardour/meter_patterns.cc b/gtk2_ardour/meter_patterns.cc index c86fb88291..50fcaa4684 100644 --- a/gtk2_ardour/meter_patterns.cc +++ b/gtk2_ardour/meter_patterns.cc @@ -52,15 +52,17 @@ sigc::signal ArdourMeter::Set /* pattern cache */ struct MeterMatricsMapKey { - MeterMatricsMapKey (std::string n, MeterType t) + MeterMatricsMapKey (std::string n, MeterType t, int dt) : _n(n) , _t(t) + , _dt(dt) {} inline bool operator<(const MeterMatricsMapKey& rhs) const { - return (_n < rhs._n) || (_n == rhs._n && _t < rhs._t); + return (_n < rhs._n) || (_n == rhs._n && _t < rhs._t) || (_n == rhs._n && _t == rhs._t && _dt < rhs._dt); } std::string _n; MeterType _t; + int _dt; }; namespace ArdourMeter { @@ -108,6 +110,14 @@ ArdourMeter::meter_type_string (ARDOUR::MeterType mt) } } +static inline int types_to_bit (vector types) { + int rv = 0; + for (vector::const_iterator i = types.begin(); i != types.end(); ++i) { + rv |= 1 << (*i); + } + return rv; +} + static inline float mtr_col_and_fract( cairo_t* cr, Gdk::Color const * const c, const uint32_t peakcolor, const MeterType mt, const float val) { @@ -906,7 +916,7 @@ ArdourMeter::meter_expose_ticks (GdkEventExpose *ev, MeterType type, std::vector cairo_clip (cr); cairo_pattern_t* pattern; - const MeterMatricsMapKey key (mta->get_name(), type); + const MeterMatricsMapKey key (mta->get_name(), type, types_to_bit(types)); MetricPatternMap::iterator i = ticks_patterns.find (key); if (i == ticks_patterns.end()) { @@ -944,7 +954,7 @@ ArdourMeter::meter_expose_metrics (GdkEventExpose *ev, MeterType type, std::vect cairo_clip (cr); cairo_pattern_t* pattern; - const MeterMatricsMapKey key (mma->get_name(), type); + const MeterMatricsMapKey key (mma->get_name(), type, types_to_bit(types)); MetricPatternMap::iterator i = metric_patterns.find (key); if (i == metric_patterns.end()) {