plugin-pin management.. nearly there
[ardour.git] / libs / ardour / port_manager.cc
index e4c066944f4b139d20da98d5cb83d9409dd52be5..874d36d8828ae19730fa968046d25449aa490f22 100644 (file)
@@ -75,20 +75,14 @@ PortManager::make_port_name_relative (const string& portname) const
                return portname;
        }
 
-       string::size_type len;
-       string::size_type n;
-       string self = _backend->my_name();
-
-       len = portname.length();
+       string::size_type colon = portname.find (':');
 
-       for (n = 0; n < len; ++n) {
-               if (portname[n] == ':') {
-                       break;
-               }
+       if (colon == string::npos) {
+               return portname;
        }
 
-       if ((n != len) && (portname.substr (0, n) == self)) {
-               return portname.substr (n+1);
+       if (portname.substr (0, colon) == _backend->my_name()) {
+               return portname.substr (colon+1);
        }
 
        return portname;
@@ -198,28 +192,6 @@ PortManager::n_physical_inputs () const
        return _backend->n_physical_inputs ();
 }
 
-bool
-PortManager::port_name_prefix_is_unique (const string& first_part_of_port_name) const
-{
-       if (!_backend) {
-               return boost::shared_ptr<Port>();
-       }
-
-       boost::shared_ptr<const Ports> pr = ports.reader();
-       const string::size_type len = first_part_of_port_name.length();
-
-       for (Ports::const_iterator x = pr->begin(); x != pr->end(); ++x) {
-
-               string prefix = x->first.substr (0, len);
-
-               if (strings_equal_ignore_case (prefix, first_part_of_port_name)) {
-                       return false;
-               }
-       }
-
-       return true;
-}
-
 /** @param name Full or short name of port
  *  @return Corresponding Port or 0.
  */