summaryrefslogtreecommitdiffstats
path: root/src/gui/Port.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-11-22 03:06:25 +0000
committerDavid Robillard <d@drobilla.net>2009-11-22 03:06:25 +0000
commite479da3c26d41e977cf55b8e2355db45991be09f (patch)
treef6887a9b19eaee951dafd17fea8021556bff1169 /src/gui/Port.cpp
parent58807f5840592959c31b415f7e2d64967594b5ee (diff)
downloadingen-e479da3c26d41e977cf55b8e2355db45991be09f.tar.gz
ingen-e479da3c26d41e977cf55b8e2355db45991be09f.tar.bz2
ingen-e479da3c26d41e977cf55b8e2355db45991be09f.zip
Partial support for message/value ports and the message context.
This use case now works: - Add an event input and the "print" plugin from imum.lv2 to ingen - Connect the event input to the input of "print" - Hook Ingen up to JACK and play some MIDI events (or get events to the print plugin from anywhere else) - The "print" plugin will print the received events to the console in the message context (i.e. the audio thread is realtime safe) git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2281 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/Port.cpp')
-rw-r--r--src/gui/Port.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp
index 012e8fcd..ba4e0482 100644
--- a/src/gui/Port.cpp
+++ b/src/gui/Port.cpp
@@ -35,6 +35,7 @@ namespace Ingen {
using namespace Shared;
namespace GUI {
+ArtVpathDash* Port::_dash;
/** @a flip Make an input port appear as an output port, and vice versa.
*/
@@ -55,6 +56,10 @@ Port::Port(
delete _menu;
_menu = NULL;
+ ArtVpathDash* dash = this->dash();
+ _rect->property_dash() = dash;
+ set_border_width(dash ? 2.0 : 0.0);
+
pm->signal_moved.connect(sigc::mem_fun(this, &Port::moved));
if (pm->type().is_control()) {
@@ -148,9 +153,37 @@ Port::property_changed(const URI& key, const Atom& value)
} else if (value.type() == Atom::BOOL) {
if ((key.str() == "lv2:toggled"))
set_toggled(value.get_bool());
+ } else if (value.type() == Atom::URI) {
+ ArtVpathDash* dash = this->dash();
+ _rect->property_dash() = dash;
+ set_border_width(dash ? 2.0 : 0.0);
}
}
+ArtVpathDash*
+Port::dash()
+{
+ SharedPtr<PortModel> pm = _port_model.lock();
+ if (!pm)
+ return NULL;
+
+ const Raul::Atom& context = pm->get_property("ctx:context");
+ if (!context.is_valid() || context.type() != Atom::URI
+ || !strcmp(context.get_uri(), "ctx:AudioContext"))
+ return NULL;
+
+ if (!_dash) {
+ _dash = new ArtVpathDash();
+ _dash->n_dash = 2;
+ _dash->dash = art_new(double, 2);
+ _dash->dash[0] = 4;
+ _dash->dash[1] = 4;
+ }
+
+ return _dash;
+}
+
+
} // namespace GUI
} // namespace Ingen