i18n updates (specifically .de from edgar a, but also contains results of ./waf i18n
[ardour.git] / libs / ardour / chan_mapping.cc
index 653d45d58f46b91f34b12c335f7054e9dd42258f..5c5bb17de67a292c3094eb4584dbf25e84779603 100644 (file)
@@ -1,6 +1,6 @@
 /*
-    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
@@ -41,12 +41,19 @@ ChanMapping::ChanMapping(ChanCount identity)
 }
 
 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;
 }
 
@@ -99,7 +106,7 @@ std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanMapping& cm)
                        o << "\t" << i->first << " => " << i->second << endl;
                }
        }
-       
+
        return o;
 }