#include "ardour/port_manager.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace ARDOUR;
using namespace PBD;
ardour_port_flags_to_jack_flags (PortFlags flags)
{
uint32_t jack_flags = 0;
-
+
if (flags & IsInput) {
jack_flags |= JackPortIsInput;
}
jack_uuid_t uuid = jack_port_uuid((jack_port_t*) port);
rv = jack_get_property(uuid, key.c_str(), &cvalue, &ctype);
- if (0 == rv) {
+ if (0 == rv && cvalue) {
value = cvalue;
- type = ctype;
- jack_free(cvalue);
- jack_free(ctype);
+ if (ctype) {
+ type = ctype;
+ }
+ } else {
+ rv = -1;
}
+
+ jack_free(cvalue);
+ jack_free(ctype);
+ return rv;
+#else
+ return -1;
+#endif
+}
+
+int
+JACKAudioBackend::set_port_property (PortHandle port, const std::string& key, const std::string& value, const std::string& type)
+{
+#ifdef HAVE_JACK_METADATA // really everyone ought to have this by now.
+ int rv = -1;
+ jack_client_t* client = _jack_connection->jack();
+ jack_uuid_t uuid = jack_port_uuid((jack_port_t*) port);
+ return jack_set_property(client, uuid, key.c_str(), value.c_str(), type.c_str());
return rv;
#else
return -1;
jack_port_t* port = (jack_port_t*) p;
const char** ports;
-
+
if (process_callback_safe) {
ports = jack_port_get_connections ((jack_port_t*)port);
} else {
}
jack_free (ports);
-
+
return s.size();
}
JACKAudioBackend::connect (const std::string& src, const std::string& dst)
{
GET_PRIVATE_JACK_POINTER_RET (_priv_jack, -1);
-
+
int r = jack_connect (_priv_jack, src.c_str(), dst.c_str());
return r;
}
}
int
-JACKAudioBackend::midi_event_get (pframes_t& timestamp, size_t& size, uint8_t** buf, void* port_buffer, uint32_t event_index)
+JACKAudioBackend::midi_event_get (pframes_t& timestamp, size_t& size, uint8_t const** buf, void* port_buffer, uint32_t event_index)
{
jack_midi_event_t ev;
int ret;
JACKAudioBackend::set_latency_range (PortHandle port, bool for_playback, LatencyRange r)
{
jack_latency_range_t range;
-
+
range.min = r.min;
range.max = r.max;
{
jack_latency_range_t range;
LatencyRange ret;
-
+
jack_port_get_latency_range ((jack_port_t*) port, for_playback ? JackPlaybackLatency : JackCaptureLatency, &range);
ret.min = range.min;