The boolean "valid" is implicit, get() returns -1 (really UINT32_MAX)
This simplifies upcoming lua bindings
ChanMapping(ARDOUR::ChanCount identity);
uint32_t get(DataType t, uint32_t from, bool* valid);
+ uint32_t get(DataType t, uint32_t from) { return get (t, from, NULL); }
void set(DataType t, uint32_t from, uint32_t to);
void offset_from(DataType t, int32_t delta);
void offset_to(DataType t, int32_t delta);
{
Mappings::iterator tm = _mappings.find(t);
if (tm == _mappings.end()) {
- *valid = false;
+ if (valid) { *valid = false; }
return -1;
}
TypeMapping::iterator m = tm->second.find(from);
if (m == tm->second.end()) {
- *valid = false;
+ if (valid) { *valid = false; }
return -1;
}
- *valid = true;
+ if (valid) { *valid = true; }
return m->second;
}