void PatchPortModule::store_location() { const float x = static_cast<float>(property_x()); const float y = static_cast<float>(property_y()); const LV2URIMap& uris = App::instance().uris(); const Atom& existing_x = _model->get_property(uris.ingenui_canvas_x); const Atom& existing_y = _model->get_property(uris.ingenui_canvas_y); if (existing_x.type() != Atom::FLOAT || existing_y.type() != Atom::FLOAT || existing_x.get_float() != x || existing_y.get_float() != y) { Resource::Properties props; props.insert(make_pair(uris.ingenui_canvas_x, Atom(x))); props.insert(make_pair(uris.ingenui_canvas_y, Atom(y))); App::instance().engine()->put(_model->path(), props, Resource::INTERNAL); } }
void PatchPortModule::property_changed(const URI& key, const Atom& value) { const LV2URIMap& uris = App::instance().uris(); switch (value.type()) { case Atom::FLOAT: if (key == uris.ingenui_canvas_x) { move_to(value.get_float(), property_y()); } else if (key == uris.ingenui_canvas_y) { move_to(property_x(), value.get_float()); } break; case Atom::STRING: if (key == uris.lv2_name && App::instance().configuration()->name_style() == Configuration::HUMAN) { set_name(value.get_string()); } else if (key == uris.lv2_symbol && App::instance().configuration()->name_style() == Configuration::PATH) { set_name(value.get_string()); } break; case Atom::BOOL: if (key == uris.ingen_polyphonic) { set_stacked_border(value.get_bool()); } else if (key == uris.ingen_selected) { if (value.get_bool() != selected()) { if (value.get_bool()) { _canvas->select_item(this); } else { _canvas->unselect_item(this); } } } default: break; } }
Gnome::Art::Point src_connection_point() { return Gnome::Art::Point(property_x(), property_y()); }