summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-05-05 14:39:24 +0000
committerDavid Robillard <d@drobilla.net>2014-05-05 14:39:24 +0000
commit9c2bcd14a5c3f72164a8395defce46e319189806 (patch)
treeaf80f798158eda2f6ceb633ce1574d1ec7f5c0f0
parent99f86fd6a05ec00c8343d2f45a57e082c3c573fe (diff)
downloadingen-9c2bcd14a5c3f72164a8395defce46e319189806.tar.gz
ingen-9c2bcd14a5c3f72164a8395defce46e319189806.tar.bz2
ingen-9c2bcd14a5c3f72164a8395defce46e319189806.zip
Add support for Jack CV via metadata.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5400 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/server/JackDriver.cpp12
-rw-r--r--src/server/jackey.h61
2 files changed, 71 insertions, 2 deletions
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index 9b1bf512..04a07cc6 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -27,6 +27,7 @@
#endif
#ifdef HAVE_JACK_METADATA
#include <jack/metadata.h>
+#include "jackey.h"
#endif
#include "ingen/Configuration.hpp"
@@ -223,7 +224,8 @@ JackDriver::register_port(EnginePort& port)
jack_port_t* jack_port = jack_port_register(
_client,
port.graph_port()->path().substr(1).c_str(),
- (port.graph_port()->is_a(PortType::AUDIO)
+ ((port.graph_port()->is_a(PortType::AUDIO) ||
+ port.graph_port()->is_a(PortType::CV))
? JACK_DEFAULT_AUDIO_TYPE : JACK_DEFAULT_MIDI_TYPE),
(port.graph_port()->is_input()
? JackPortIsInput : JackPortIsOutput),
@@ -281,7 +283,12 @@ JackDriver::port_property_internal(const jack_port_t* jport,
#ifdef HAVE_JACK_METADATA
if (uri == _engine.world()->uris().lv2_name) {
jack_set_property(_client, jack_port_uuid(jport),
- JACK_METADATA_PRETTY_NAME, value.ptr<char>(), NULL);
+ JACK_METADATA_PRETTY_NAME, value.ptr<char>(), "text/plain");
+ } else if (uri == _engine.world()->uris().rdf_type) {
+ if (value == _engine.world()->uris().lv2_CVPort) {
+ jack_set_property(_client, jack_port_uuid(jport),
+ JACKEY_SIGNAL_TYPE, "CV", "text/plain");
+ }
}
#endif
}
@@ -291,6 +298,7 @@ JackDriver::create_port(DuplexPort* graph_port)
{
if (graph_port &&
(graph_port->is_a(PortType::AUDIO) ||
+ graph_port->is_a(PortType::CV) ||
(graph_port->is_a(PortType::ATOM) &&
graph_port->buffer_type() == _engine.world()->uris().atom_Sequence))) {
EnginePort* eport = new EnginePort(graph_port);
diff --git a/src/server/jackey.h b/src/server/jackey.h
new file mode 100644
index 00000000..6695f3db
--- /dev/null
+++ b/src/server/jackey.h
@@ -0,0 +1,61 @@
+/*
+ Copyright 2014 David Robillard <http://drobilla.net>
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+
+/**
+ The supported event types of an event port.
+
+ This is a kludge around Jack only supporting MIDI, particularly for OSC.
+ This property is a comma-separated list of event types, currently "MIDI" or
+ "OSC". If this contains "OSC", the port may carry OSC bundles (first byte
+ '#') or OSC messages (first byte '/'). Note that the "status byte" of both
+ OSC events is not a valid MIDI status byte, so MIDI clients that check the
+ status byte will gracefully ignore OSC messages if the user makes an
+ inappropriate connection.
+*/
+#define JACKEY_EVENT_TYPES "http://jackaudio.org/metadata/event-types"
+
+/**
+ The type of an audio signal.
+
+ This property allows audio ports to be tagged with a "meaning". The value
+ is a simple string. Currently, the only type is "CV", for "control voltage"
+ ports. Hosts SHOULD be take care to not treat CV ports as audibile and send
+ their output directly to speakers. In particular, CV ports are not
+ necessarily periodic at all and may have very high DC.
+*/
+#define JACKEY_SIGNAL_TYPE "http://jackaudio.org/metadata/signal-type"
+
+/**
+ The name of the icon for the subject (typically client).
+
+ This is used for looking up icons on the system, possibly with many sizes or
+ themes. Icons should be searched for according to the freedesktop Icon
+ Theme Specification:
+
+ http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
+*/
+#define JACKEY_ICON_NAME "http://jackaudio.org/metadata/icon-name"
+
+/**
+ Channel designation for a port.
+
+ This allows ports to be tagged with a meaningful designation like "left",
+ "right", "lfe", etc.
+
+ The value MUST be a URI. An extensive set of URIs for designating audio
+ channels can be found at http://lv2plug.in/ns/ext/port-groups
+*/
+#define JACKEY_DESIGNATION "http://lv2plug.in/ns/lv2core#designation"