/* 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 {
}
}
+static inline int types_to_bit (vector<ARDOUR::DataType> types) {
+ int rv = 0;
+ for (vector<DataType>::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)
{
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()) {
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()) {