add a real check for functioning JACK metadata API; remove configure time option...
[ardour.git] / libs / backends / jack / jack_portengine.cc
index 1fe77fbb70fd4a000aad17f65116d3a5e54c2026..1f0515b0e8c2b19eb084ffe8f1e02dc19efd05a0 100644 (file)
@@ -24,7 +24,6 @@
 
 #include "jack_audiobackend.h"
 #include "jack_connection.h"
-#include "jack/midiport.h"
 
 #include "ardour/port_manager.h"
 
@@ -116,6 +115,29 @@ JACKAudioBackend::get_port_name (PortHandle port) const
        return jack_port_name ((jack_port_t*) port);
 }
 
+int
+JACKAudioBackend::get_port_property (PortHandle port, const std::string& key, std::string& value, std::string& type) const
+{
+#ifdef HAVE_JACK_METADATA // really everyone ought to have this by now.
+       int rv = -1;
+       char *cvalue = NULL;
+       char *ctype = NULL;
+
+       jack_uuid_t uuid = jack_port_uuid((jack_port_t*) port);
+       rv = jack_get_property(uuid, key.c_str(), &cvalue, &ctype);
+
+       if (0 == rv) {
+               value = cvalue;
+               type = ctype;
+               jack_free(cvalue);
+               jack_free(ctype);
+       }
+       return rv;
+#else
+       return -1;
+#endif
+}
+
 PortEngine::PortHandle
 JACKAudioBackend:: get_port_by_name (const std::string& name) const
 {