diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/App.cpp | 6 | ||||
-rw-r--r-- | src/gui/App.hpp | 2 | ||||
-rw-r--r-- | src/gui/Configuration.cpp | 4 | ||||
-rw-r--r-- | src/gui/ControlPanel.cpp | 3 | ||||
-rw-r--r-- | src/gui/Port.cpp | 2 | ||||
-rw-r--r-- | src/gui/PortMenu.cpp | 4 |
6 files changed, 11 insertions, 10 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp index 055b4ef7..8e234031 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -386,10 +386,10 @@ App::icon_destroyed(void* data) } bool -App::can_control(const Ingen::Port* port) const +App::can_control(const Client::PortModel* port) const { - return port->is_a(PortType::CONTROL) - || (port->is_a(PortType::VALUE) + return port->is_a(uris().lv2_ControlPort) + || (port->is_a(uris().atom_ValuePort) && (port->supports(uris().atom_Float32) || port->supports(uris().atom_String))); } diff --git a/src/gui/App.hpp b/src/gui/App.hpp index bd753078..2f26716f 100644 --- a/src/gui/App.hpp +++ b/src/gui/App.hpp @@ -86,7 +86,7 @@ public: void port_activity(Port* port); void activity_port_destroyed(Port* port); - bool can_control(const Ingen::Port* port) const; + bool can_control(const Client::PortModel* port) const; bool signal() const { return _enable_signal; } bool disable_signals() { bool old = _enable_signal; _enable_signal = false; return old; } diff --git a/src/gui/Configuration.cpp b/src/gui/Configuration.cpp index 5018cbf1..5e300bc1 100644 --- a/src/gui/Configuration.cpp +++ b/src/gui/Configuration.cpp @@ -84,13 +84,13 @@ Configuration::get_port_color(const PortModel* p) { assert(p != NULL); const Shared::LV2URIMap& uris = App::instance().uris(); - if (p->is_a(PortType::AUDIO)) { + if (p->is_a(uris.lv2_AudioPort)) { return _audio_port_color; } else if (p->supports(uris.atom_String)) { return _string_port_color; } else if (App::instance().can_control(p)) { return _control_port_color; - } else if (p->is_a(PortType::EVENTS) || p->is_a(PortType::MESSAGE)) { + } else if (p->is_a(uris.ev_EventPort) || p->is_a(uris.atom_MessagePort)) { return _event_port_color; } diff --git a/src/gui/ControlPanel.cpp b/src/gui/ControlPanel.cpp index 00ae05c8..06ae6491 100644 --- a/src/gui/ControlPanel.cpp +++ b/src/gui/ControlPanel.cpp @@ -16,7 +16,6 @@ */ #include "ingen/ServerInterface.hpp" -#include "ingen/PortType.hpp" #include "shared/LV2URIMap.hpp" #include "ingen/client/NodeModel.hpp" #include "ingen/client/PortModel.hpp" @@ -91,7 +90,7 @@ ControlPanel::add_port(SharedPtr<const PortModel> pm) ToggleControl* tc; WidgetFactory::get_widget_derived("toggle_control", tc); control = tc; - } else if (pm->is_a(PortType::CONTROL) + } else if (pm->is_a(App::instance().uris().lv2_ControlPort) || pm->supports(App::instance().uris().atom_Float32)) { SliderControl* sc; WidgetFactory::get_widget_derived("control_strip", sc); diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index b0c4ffcb..a3a7afb2 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -214,7 +214,7 @@ peak_color(float peak) void Port::activity(const Raul::Atom& value) { - if (model()->is_a(PortType::AUDIO)) { + if (model()->is_a(App::instance().uris().lv2_AudioPort)) { set_fill_color(peak_color(value.get_float())); } else { App::instance().port_activity(this); diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp index 8dafd83f..6e51ee45 100644 --- a/src/gui/PortMenu.cpp +++ b/src/gui/PortMenu.cpp @@ -43,6 +43,8 @@ PortMenu::PortMenu(BaseObjectType* cobject, void PortMenu::init(SharedPtr<const PortModel> port, bool patch_port) { + const LV2URIMap& uris = App::instance().uris(); + ObjectMenu::init(port); _patch_port = patch_port; @@ -61,7 +63,7 @@ PortMenu::init(SharedPtr<const PortModel> port, bool patch_port) _destroy_menuitem->set_sensitive(false); } - if (port->is_a(PortType::EVENTS)) + if (port->is_a(uris.ev_EventPort)) _polyphonic_menuitem->hide(); const bool is_control = App::instance().can_control(port.get()) |