add API to set pretty names for ardour ports
authorRobin Gareus <robin@gareus.org>
Sun, 17 Apr 2016 16:34:17 +0000 (18:34 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 17 Apr 2016 16:34:17 +0000 (18:34 +0200)
libs/ardour/ardour/port.h
libs/ardour/port.cc

index 6eca80a939034fc46a7d861d9949d56d51927308..4b6188fce4e087c14a705042b796347f7b878eeb 100644 (file)
@@ -57,6 +57,7 @@ public:
 
        /** @return Port human readable name */
        std::string pretty_name (bool fallback_to_name = false) const;
+       bool set_pretty_name (const std::string&);
 
        int set_name (std::string const &);
 
index 06169dd576634441afc378027c5df063ece1bd9f..a64d617ebadf7181756ab4bef40cfb10f1bab070 100644 (file)
@@ -103,6 +103,19 @@ Port::pretty_name(bool fallback_to_name) const
        return "";
 }
 
+bool
+Port::set_pretty_name(const std::string& n)
+{
+       if (_port_handle) {
+               if (0 == port_engine.set_port_property (_port_handle,
+                                       "http://jackaudio.org/metadata/pretty-name", n, ""))
+               {
+                       return true;
+               }
+       }
+       return false;
+}
+
 void
 Port::drop ()
 {