add wrapper for ChanMapping::get()
The boolean "valid" is implicit, get() returns -1 (really UINT32_MAX) This simplifies upcoming lua bindings
This commit is contained in:
parent
9bcd01c0a1
commit
470255effa
@ -40,6 +40,7 @@ public:
|
||||
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);
|
||||
|
@ -45,15 +45,15 @@ ChanMapping::get(DataType t, uint32_t from, bool* valid)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user