From a2792bd09212eed55bba1aa30dc09043a6955486 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 31 Aug 2014 01:24:57 +0000 Subject: Use float sequences for sample-accurate control ports. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5462 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/NodeModule.cpp | 3 ++- src/gui/Port.cpp | 3 +++ src/gui/Style.cpp | 11 ++++++++++- src/gui/Style.hpp | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index b9798339..0bacb70b 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -186,7 +186,8 @@ NodeModule::port_value_changed(uint32_t index, const Atom& value) return; } - if (value.type() == uris.atom_Float) { + if (value.type() == uris.atom_Float && + _block->get_port(index)->is_numeric()) { _plugin_ui->port_event(index, sizeof(float), 0, value.ptr()); } else { _plugin_ui->port_event(index, diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index b04e93b5..e123a571 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -83,6 +83,7 @@ Port::Port(App& app, assert(pm); set_border_width(1.0); + set_dash_length(app.style()->get_port_dash_length(pm.get())); if (app.can_control(pm.get())) { show_control(); @@ -367,6 +368,8 @@ Port::activity(const Atom& value) { if (model()->is_a(_app.uris().lv2_AudioPort)) { set_fill_color(peak_color(value.get())); + } else if (_app.can_control(model().get()) && value.type() == _app.uris().atom_Float) { + Ganv::Port::set_control_value(value.get()); } else { _app.port_activity(this); } diff --git a/src/gui/Style.cpp b/src/gui/Style.cpp index 1c61d995..287a1496 100644 --- a/src/gui/Style.cpp +++ b/src/gui/Style.cpp @@ -82,7 +82,6 @@ Style::apply_settings() uint32_t Style::get_port_color(const Client::PortModel* p) { - assert(p != NULL); const URIs& uris = _app.uris(); if (p->is_a(uris.lv2_AudioPort)) { return _audio_port_color; @@ -102,5 +101,15 @@ Style::get_port_color(const Client::PortModel* p) return 0x666666FF; } +uint32_t +Style::get_port_dash_length(const Client::PortModel* p) +{ + const URIs& uris = _app.uris(); + if (p->is_a(uris.atom_AtomPort)) { + return 4.0; + } + return 0.0; +} + } // namespace GUI } // namespace Ingen diff --git a/src/gui/Style.hpp b/src/gui/Style.hpp index 13fa0546..a52a3d01 100644 --- a/src/gui/Style.hpp +++ b/src/gui/Style.hpp @@ -41,6 +41,7 @@ public: void apply_settings(); uint32_t get_port_color(const Client::PortModel* p); + uint32_t get_port_dash_length(const Client::PortModel* p); private: App& _app; -- cgit v1.2.1