Beispiel #1
0
void
HTTPEngineSender::set_property(const URI&  subject,
                               const URI&  predicate,
                               const Atom& value)
{
	Resource::Properties prop;
	prop.insert(make_pair(predicate, value));
	put(subject, prop);
}
Beispiel #2
0
void
ClientUpdate::put_port(const PortImpl* port)
{
    const URIs& uris = port->bufs().uris();
    if (port->is_a(PortType::CONTROL) || port->is_a(PortType::CV)) {
        Resource::Properties props = port->properties();
        props.erase(uris.ingen_value);
        props.insert(std::make_pair(uris.ingen_value, port->value()));
        put(port->uri(), props);
    } else {
        put(port->uri(), port->properties());
    }
}
Beispiel #3
0
void
GraphPortModule::store_location(double ax, double ay)
{
	const URIs& uris = app().uris();

	const Atom x(app().forge().make(static_cast<float>(ax)));
	const Atom y(app().forge().make(static_cast<float>(ay)));

	if (x != _model->get_property(uris.ingen_canvasX) ||
	    y != _model->get_property(uris.ingen_canvasY))
	{
		Resource::Properties remove;
		remove.insert(make_pair(uris.ingen_canvasX,
		                        Resource::Property(uris.patch_wildcard)));
		remove.insert(make_pair(uris.ingen_canvasY,
		                        Resource::Property(uris.patch_wildcard)));
		Resource::Properties add;
		add.insert(make_pair(uris.ingen_canvasX,
		                     Resource::Property(x, Resource::Graph::INTERNAL)));
		add.insert(make_pair(uris.ingen_canvasY,
		                     Resource::Property(y, Resource::Graph::INTERNAL)));
		app().interface()->delta(_model->uri(), remove, add);
	}
}
Beispiel #4
0
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);
	}
}