Exemple #1
0
void
AtomWriter::forge_uri(const Raul::URI& uri)
{
	if (serd_uri_string_has_scheme((const uint8_t*)uri.c_str())) {
		lv2_atom_forge_urid(&_forge, _map.map_uri(uri.c_str()));
	} else {
		lv2_atom_forge_uri(&_forge, uri.c_str(), uri.length());
	}
}
Exemple #2
0
	explicit OSCClientSender(const Raul::URI& url,
	                         size_t           max_packet_size)
		: Shared::OSCSender(max_packet_size)
		, _url(url)
	{
		_address = lo_address_new_from_url(url.c_str());
	}
Exemple #3
0
Fichier : Port.cpp Projet : EQ4/lad
void
Port::on_uri_activated(const Raul::URI& uri)
{
	_app.set_property(model()->uri(),
	                  _app.world()->uris().ingen_value,
	                  _app.world()->forge().make_urid(
		                  _app.world()->uri_map().map_uri(uri.c_str())));
}
Exemple #4
0
void
BlockFactory::load_plugin(const Raul::URI& uri)
{
	if (_has_loaded || _plugins.find(uri) != _plugins.end()) {
		return;
	}

	LilvNode*          node  = lilv_new_uri(_world->lilv_world(), uri.c_str());
	const LilvPlugins* plugs = lilv_world_get_all_plugins(_world->lilv_world());
	const LilvPlugin*  plug  = lilv_plugins_get_by_uri(plugs, node);
	if (plug) {
		LV2Plugin* const ingen_plugin = new LV2Plugin(_lv2_info, uri);
		ingen_plugin->lilv_plugin(plug);
		_plugins.insert(make_pair(uri, ingen_plugin));
	}
	lilv_node_free(node);
}
Exemple #5
0
void
AtomWriter::set_property(const Raul::URI& subject,
                         const Raul::URI& predicate,
                         const Atom&      value)
{
	LV2_Atom_Forge_Frame msg;
	forge_request(&msg, _uris.patch_Set);
	lv2_atom_forge_key(&_forge, _uris.patch_subject);
	forge_uri(subject);
	lv2_atom_forge_key(&_forge, _uris.patch_property);
	lv2_atom_forge_urid(&_forge, _map.map_uri(predicate.c_str()));
	lv2_atom_forge_key(&_forge, _uris.patch_value);
	lv2_atom_forge_atom(&_forge, value.size(), value.type());
	lv2_atom_forge_write(&_forge, value.get_body(), value.size());

	lv2_atom_forge_pop(&_forge, &msg);
	finish_msg();
}
Exemple #6
0
void
PropertiesWindow::add_property(const Raul::URI& uri, const Atom& value)
{
	World* world = _app->world();

	const unsigned n_rows = _table->property_n_rows() + 1;
	_table->property_n_rows() = n_rows;

	// Column 0: Property
	LilvNode* prop = lilv_new_uri(world->lilv_world(), uri.c_str());
	Glib::ustring lab_text = RDFS::label(world, prop);
	if (lab_text.empty()) {
		lab_text = world->rdf_world()->prefixes().qualify(uri);
	}
	lab_text = Glib::ustring("<a href=\"") + uri + "\">"
		+ lab_text + "</a>";
	Gtk::Label* lab = manage(new Gtk::Label(lab_text, 1.0, 0.5));
	lab->set_use_markup(true);
	_table->attach(*lab, 0, 1, n_rows, n_rows + 1,
	               Gtk::FILL|Gtk::SHRINK, Gtk::SHRINK);
	lilv_node_free(prop);

	// Column 1: Value
	Gtk::Alignment*   align      = manage(new Gtk::Alignment(0.0, 0.5, 1.0, 0.0));
	Gtk::CheckButton* present    = manage(new Gtk::CheckButton());
	Gtk::Widget*      val_widget = create_value_widget(uri, value);
	present->set_active(true);
	if (val_widget) {
		align->add(*val_widget);
	}
	_table->attach(*align, 1, 2, n_rows, n_rows + 1,
	               Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK);
	_table->attach(*present, 2, 3, n_rows, n_rows + 1,
	               Gtk::FILL, Gtk::SHRINK);
	_records.insert(make_pair(uri, Record(value, align, n_rows, present)));
}
Exemple #7
0
Fichier : Node.hpp Projet : EQ4/lad
	static Raul::Path uri_to_path(const Raul::URI& uri) {
		return (uri == root_uri())
			? Raul::Path("/")
			: Raul::Path(uri.substr(root_uri().length()));
	}
Exemple #8
0
Fichier : Node.hpp Projet : EQ4/lad
	static bool uri_is_path(const Raul::URI& uri) {
		return uri == root_uri() ||
			uri.substr(0, root_uri().length() + 1) == root_uri() + "/";
	}