summaryrefslogtreecommitdiffstats
path: root/src/gui/PortMenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/PortMenu.cpp')
-rw-r--r--src/gui/PortMenu.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp
index a5b907c3..a23e3b84 100644
--- a/src/gui/PortMenu.cpp
+++ b/src/gui/PortMenu.cpp
@@ -121,9 +121,9 @@ PortMenu::on_menu_set_max()
void
PortMenu::on_menu_reset_range()
{
- const URIs& uris = _app->uris();
- SharedPtr<const PortModel> model = PtrCast<const PortModel>(_object);
- SharedPtr<const NodeModel> parent = PtrCast<const NodeModel>(_object->parent());
+ const URIs& uris = _app->uris();
+ SharedPtr<const PortModel> model = PtrCast<const PortModel>(_object);
+ SharedPtr<const BlockModel> parent = PtrCast<const BlockModel>(_object->parent());
float min, max;
parent->default_port_value_range(model, min, max);
@@ -142,12 +142,12 @@ PortMenu::on_menu_reset_range()
void
PortMenu::on_menu_expose()
{
- const URIs& uris = _app->uris();
- SharedPtr<const PortModel> port = PtrCast<const PortModel>(_object);
- SharedPtr<const NodeModel> node = PtrCast<const NodeModel>(port->parent());
+ const URIs& uris = _app->uris();
+ SharedPtr<const PortModel> port = PtrCast<const PortModel>(_object);
+ SharedPtr<const BlockModel> block = PtrCast<const BlockModel>(port->parent());
- const std::string label = node->label() + " " + node->port_label(port);
- const Raul::Path path = Raul::Path(node->path() + Raul::Symbol("_" + port->symbol()));
+ const std::string label = block->label() + " " + block->port_label(port);
+ const Raul::Path path = Raul::Path(block->path() + Raul::Symbol("_" + port->symbol()));
Ingen::Resource r(*_object.get());
r.remove_property(uris.lv2_index, uris.wildcard);
@@ -155,12 +155,12 @@ PortMenu::on_menu_expose()
r.set_property(uris.lv2_name, _app->forge().alloc(label.c_str()));
// TODO: Pretty kludgey coordinates
- const float node_x = node->get_property(uris.ingen_canvasX).get_float();
- const float node_y = node->get_property(uris.ingen_canvasY).get_float();
- const float x_off = (label.length() * 16.0f) * (port->is_input() ? -1 : 1);
- const float y_off = port->index() * 32.0f;
- r.set_property(uris.ingen_canvasX, _app->forge().make(node_x + x_off));
- r.set_property(uris.ingen_canvasY, _app->forge().make(node_y + y_off));
+ const float block_x = block->get_property(uris.ingen_canvasX).get_float();
+ const float block_y = block->get_property(uris.ingen_canvasY).get_float();
+ const float x_off = (label.length() * 16.0f) * (port->is_input() ? -1 : 1);
+ const float y_off = port->index() * 32.0f;
+ r.set_property(uris.ingen_canvasX, _app->forge().make(block_x + x_off));
+ r.set_property(uris.ingen_canvasY, _app->forge().make(block_y + y_off));
_app->interface()->put(GraphObject::path_to_uri(path), r.properties());