32 if (identity == ChanCount::INFINITE) {
37 for (
size_t i = 0; i < identity.
get(*t); ++i) {
44 ChanMapping::get(
DataType t, uint32_t from,
bool* valid)
46 Mappings::iterator tm = _mappings.find(t);
47 if (tm == _mappings.end()) {
51 TypeMapping::iterator m = tm->second.find(from);
52 if (m == tm->second.end()) {
61 ChanMapping::set(
DataType t, uint32_t from, uint32_t to)
63 assert(t != DataType::NIL);
64 Mappings::iterator tm = _mappings.find(t);
65 if (tm == _mappings.end()) {
66 tm = _mappings.insert(std::make_pair(t,
TypeMapping())).first;
68 tm->second.insert(std::make_pair(from, to));
73 ChanMapping::offset_from(
DataType t, int32_t delta)
75 Mappings::iterator tm = _mappings.find(t);
76 if (tm != _mappings.end()) {
78 for (TypeMapping::iterator m = tm->second.begin(); m != tm->second.end(); ++m) {
79 new_map.insert(make_pair(m->first + delta, m->second));
87 ChanMapping::offset_to(
DataType t, int32_t delta)
89 Mappings::iterator tm = _mappings.find(t);
90 if (tm != _mappings.end()) {
91 for (TypeMapping::iterator m = tm->second.begin(); m != tm->second.end(); ++m) {
101 for (ARDOUR::ChanMapping::Mappings::const_iterator tm = cm.
mappings().begin();
103 o << tm->first.to_string() << endl;
104 for (ARDOUR::ChanMapping::TypeMapping::const_iterator i = tm->second.begin();
105 i != tm->second.end(); ++i) {
106 o <<
"\t" << i->first <<
" => " << i->second << endl;
uint32_t get(DataType t) const
std::ostream & operator<<(std::ostream &o, const ARDOUR::ChanMapping &cm)
std::map< uint32_t, uint32_t > TypeMapping