/*
- Copyright (C) 2009 Paul Davis
- Author: Dave Robillard
+ Copyright (C) 2009 Paul Davis
+ Author: David Robillard
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
uint32_t
-ChanMapping::get(DataType t, uint32_t from)
+ChanMapping::get(DataType t, uint32_t from, bool* valid)
{
Mappings::iterator tm = _mappings.find(t);
- assert(tm != _mappings.end());
+ if (tm == _mappings.end()) {
+ *valid = false;
+ return -1;
+ }
TypeMapping::iterator m = tm->second.find(from);
- assert(m != tm->second.end());
+ if (m == tm->second.end()) {
+ *valid = false;
+ return -1;
+ }
+ *valid = true;
return m->second;
}
o << "\t" << i->first << " => " << i->second << endl;
}
}
-
+
return o;
}