summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-11 01:29:18 +0000
committerDavid Robillard <d@drobilla.net>2012-05-11 01:29:18 +0000
commite77d4fcf31bfdad0b34e184e4743b4750848472c (patch)
treedd3e9aa6d8b8d1e54cae56138ab25f92eba8624a
parent00957dd74a97252d9a790141cb7f475573da1a91 (diff)
downloadingen-e77d4fcf31bfdad0b34e184e4743b4750848472c.tar.gz
ingen-e77d4fcf31bfdad0b34e184e4743b4750848472c.tar.bz2
ingen-e77d4fcf31bfdad0b34e184e4743b4750848472c.zip
Use more reasonable names for the world's interface and engine (if present).
Don't require separate Configuration initialisation from World (simplify API). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4343 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--ingen/shared/World.hpp30
-rw-r--r--src/bindings/ingen_bindings.cpp4
-rw-r--r--src/client/PluginUI.cpp14
-rw-r--r--src/gui/App.cpp18
-rw-r--r--src/gui/App.hpp10
-rw-r--r--src/gui/ConnectWindow.cpp57
-rw-r--r--src/gui/LoadPluginWindow.cpp2
-rw-r--r--src/gui/NewSubpatchWindow.cpp4
-rw-r--r--src/gui/NodeMenu.cpp14
-rw-r--r--src/gui/NodeModule.cpp10
-rw-r--r--src/gui/ObjectMenu.cpp8
-rw-r--r--src/gui/PatchBox.cpp2
-rw-r--r--src/gui/PatchCanvas.cpp16
-rw-r--r--src/gui/PatchPortModule.cpp4
-rw-r--r--src/gui/PatchTreeWindow.cpp4
-rw-r--r--src/gui/PatchView.cpp8
-rw-r--r--src/gui/Port.cpp12
-rw-r--r--src/gui/PortMenu.cpp20
-rw-r--r--src/gui/PortPropertiesWindow.cpp2
-rw-r--r--src/gui/PropertiesWindow.cpp2
-rw-r--r--src/gui/RenameWindow.cpp4
-rw-r--r--src/gui/SubpatchModule.cpp4
-rw-r--r--src/gui/ThreadedLoader.cpp2
-rw-r--r--src/gui/ingen_gui_lv2.cpp11
-rw-r--r--src/ingen/main.cpp58
-rw-r--r--src/server/Engine.cpp2
-rw-r--r--src/server/JackDriver.cpp6
-rw-r--r--src/server/LV2RequestRunFeature.hpp4
-rw-r--r--src/server/ingen_engine.cpp8
-rw-r--r--src/server/ingen_jack.cpp10
-rw-r--r--src/server/ingen_lv2.cpp39
-rw-r--r--src/shared/World.cpp33
-rw-r--r--src/socket/SocketListener.cpp6
33 files changed, 203 insertions, 225 deletions
diff --git a/ingen/shared/World.hpp b/ingen/shared/World.hpp
index 5f162a9b..0fe75953 100644
--- a/ingen/shared/World.hpp
+++ b/ingen/shared/World.hpp
@@ -19,14 +19,12 @@
#include <string>
-#include <boost/shared_ptr.hpp>
-#include <boost/utility.hpp>
-
+#include "ingen/shared/Configuration.hpp"
#include "ingen/shared/Forge.hpp"
#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
#include "raul/Atom.hpp"
-#include "raul/Configuration.hpp"
#include "raul/SharedPtr.hpp"
+#include "raul/Noncopyable.hpp"
typedef struct LilvWorldImpl LilvWorld;
@@ -58,13 +56,12 @@ class Store;
* using World::load, e.g. loading the "ingen_serialisation" module will
* set World::serialiser and World::parser to valid objects.
*/
-class World : public boost::noncopyable {
+class World : public Raul::Noncopyable {
public:
- World(Raul::Configuration* conf,
- int& argc,
- char**& argv,
- LV2_URID_Map* map,
- LV2_URID_Unmap* unmap);
+ World(int& argc,
+ char**& argv,
+ LV2_URID_Map* map,
+ LV2_URID_Unmap* unmap);
virtual ~World();
@@ -81,21 +78,21 @@ public:
virtual void add_interface_factory(const std::string& scheme,
InterfaceFactory factory);
- virtual SharedPtr<Interface> interface(
+ virtual SharedPtr<Interface> new_interface(
const std::string& engine_url,
SharedPtr<Interface> respondee);
virtual bool run(const std::string& mime_type,
const std::string& filename);
- virtual void set_local_engine(SharedPtr<EngineBase> e);
- virtual void set_engine(SharedPtr<Interface> e);
+ virtual void set_engine(SharedPtr<EngineBase> e);
+ virtual void set_interface(SharedPtr<Interface> e);
virtual void set_serialiser(SharedPtr<Serialisation::Serialiser> s);
virtual void set_parser(SharedPtr<Serialisation::Parser> p);
virtual void set_store(SharedPtr<Store> s);
- virtual SharedPtr<EngineBase> local_engine();
- virtual SharedPtr<Interface> engine();
+ virtual SharedPtr<EngineBase> engine();
+ virtual SharedPtr<Interface> interface();
virtual SharedPtr<Serialisation::Serialiser> serialiser();
virtual SharedPtr<Serialisation::Parser> parser();
virtual SharedPtr<Store> store();
@@ -108,8 +105,7 @@ public:
virtual int& argc();
virtual char**& argv();
- virtual Raul::Configuration* conf();
- virtual void set_conf(Raul::Configuration* c);
+ virtual Configuration& conf();
virtual Ingen::Forge& forge();
diff --git a/src/bindings/ingen_bindings.cpp b/src/bindings/ingen_bindings.cpp
index b71e9dd4..6c92d7bb 100644
--- a/src/bindings/ingen_bindings.cpp
+++ b/src/bindings/ingen_bindings.cpp
@@ -55,8 +55,8 @@ ingen_module_load()
void
script_iteration(Ingen::Shared::World* world)
{
- if (world->local_engine())
- world->local_engine()->main_iteration();
+ if (world->engine())
+ world->engine()->main_iteration();
}
} // extern "C"
diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp
index 59d4c1b4..5cdf5ab2 100644
--- a/src/client/PluginUI.cpp
+++ b/src/client/PluginUI.cpp
@@ -41,8 +41,8 @@ lv2_ui_write(SuilController controller,
const NodeModel::Ports& ports = ui->node()->ports();
if (port_index >= ports.size()) {
- Raul::error << (Raul::fmt("%1% UI tried to write to invalid port %2%")
- % ui->node()->plugin()->uri() % port_index) << endl;
+ Raul::error(Raul::fmt("%1% UI tried to write to invalid port %2%\n")
+ % ui->node()->plugin()->uri() % port_index);
return;
}
@@ -56,7 +56,7 @@ lv2_ui_write(SuilController controller,
if (*(float*)buffer == port->value().get_float())
return; // do nothing (handle stupid plugin UIs that feed back)
- ui->world()->engine()->set_property(
+ ui->world()->interface()->set_property(
port->path(),
uris.ingen_value,
ui->world()->forge().make(*(float*)buffer));
@@ -65,9 +65,9 @@ lv2_ui_write(SuilController controller,
LV2_Atom* atom = (LV2_Atom*)buffer;
Raul::Atom val = ui->world()->forge().alloc(
atom->size, atom->type, LV2_ATOM_BODY(atom));
- ui->world()->engine()->set_property(port->path(),
- uris.ingen_value,
- val);
+ ui->world()->interface()->set_property(port->path(),
+ uris.ingen_value,
+ val);
} else {
Raul::warn(Raul::fmt("Unknown value format %1% from LV2 UI\n")
@@ -144,7 +144,7 @@ PluginUI::create(Ingen::Shared::World* world,
if (instance) {
ret->_instance = instance;
} else {
- Raul::error << "Failed to instantiate LV2 UI" << endl;
+ Raul::error("Failed to instantiate LV2 UI\n");
ret.reset();
}
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 3b3fa6f9..f56f6f41 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -159,13 +159,13 @@ App::attach(SharedPtr<SigClientInterface> client)
assert(!_store);
assert(!_loader);
- if (_world->local_engine()) {
- _world->local_engine()->register_client(client->uri(), client);
+ if (_world->engine()) {
+ _world->engine()->register_client(client->uri(), client);
}
_client = client;
- _store = SharedPtr<ClientStore>(new ClientStore(_world->uris(), _world->engine(), client));
- _loader = SharedPtr<ThreadedLoader>(new ThreadedLoader(*this, _world->engine()));
+ _store = SharedPtr<ClientStore>(new ClientStore(_world->uris(), _world->interface(), client));
+ _loader = SharedPtr<ThreadedLoader>(new ThreadedLoader(*this, _world->interface()));
_patch_tree_window->init(*this, *_store);
@@ -180,14 +180,14 @@ App::attach(SharedPtr<SigClientInterface> client)
void
App::detach()
{
- if (_world->engine()) {
+ if (_world->interface()) {
_window_factory->clear();
_store->clear();
_loader.reset();
_store.reset();
_client.reset();
- _world->set_engine(SharedPtr<Interface>());
+ _world->set_interface(SharedPtr<Interface>());
}
}
@@ -292,8 +292,8 @@ App::gtk_main_iteration()
if (!_client)
return false;
- if (_world->local_engine()) {
- if (!_world->local_engine()->main_iteration()) {
+ if (_world->engine()) {
+ if (!_world->engine()->main_iteration()) {
Gtk::Main::quit();
return false;
}
@@ -320,7 +320,7 @@ bool
App::quit(Gtk::Window* dialog_parent)
{
bool quit = true;
- if (_world->local_engine()) {
+ if (_world->engine()) {
Gtk::MessageDialog d(
"The engine is running in this process. Quitting will terminate Ingen."
"\n\n" "Are you sure you want to quit?",
diff --git a/src/gui/App.hpp b/src/gui/App.hpp
index a66a83a8..64eed0ff 100644
--- a/src/gui/App.hpp
+++ b/src/gui/App.hpp
@@ -105,11 +105,11 @@ public:
Glib::RefPtr<Gdk::Pixbuf> icon_from_path(const std::string& path, int size);
- Ingen::Forge& forge() const { return _world->forge(); }
- SharedPtr<Ingen::Interface> engine() const { return _world->engine(); }
- SharedPtr<Client::SigClientInterface> client() const { return _client; }
- SharedPtr<Client::ClientStore> store() const { return _store; }
- SharedPtr<ThreadedLoader> loader() const { return _loader; }
+ Ingen::Forge& forge() const { return _world->forge(); }
+ SharedPtr<Ingen::Interface> interface() const { return _world->interface(); }
+ SharedPtr<Client::SigClientInterface> client() const { return _client; }
+ SharedPtr<Client::ClientStore> store() const { return _store; }
+ SharedPtr<ThreadedLoader> loader() const { return _loader; }
SharedPtr<Serialisation::Serialiser> serialiser();
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp
index b08efb85..b27a9f70 100644
--- a/src/gui/ConnectWindow.cpp
+++ b/src/gui/ConnectWindow.cpp
@@ -61,22 +61,21 @@ ConnectWindow::start(App& app, Ingen::Shared::World* world)
{
_app = &app;
- if (world->local_engine()) {
+ if (world->engine()) {
_mode = INTERNAL;
if (_widgets_loaded) {
_internal_radio->set_active(true);
}
}
- set_connected_to(world->engine());
-
- connect(world->engine());
+ set_connected_to(world->interface());
+ connect(world->interface());
}
void
ConnectWindow::set_connected_to(SharedPtr<Ingen::Interface> engine)
{
- _app->world()->set_engine(engine);
+ _app->world()->set_interface(engine);
if (!_widgets_loaded)
return;
@@ -98,7 +97,7 @@ ConnectWindow::set_connected_to(SharedPtr<Ingen::Interface> engine)
_connect_button->set_sensitive(true);
_disconnect_button->set_sensitive(false);
- if (_app->world()->local_engine())
+ if (_app->world()->engine())
_internal_radio->set_sensitive(true);
else
_internal_radio->set_sensitive(false);
@@ -158,17 +157,17 @@ ConnectWindow::connect(bool existing)
}
if (existing) {
- uri = world->engine()->uri().str();
+ uri = world->interface()->uri().str();
}
SharedPtr<ThreadedSigClientInterface> tsci;
- if (world->engine()) {
+ if (world->interface()) {
tsci = PtrCast<ThreadedSigClientInterface>(
- world->engine()->respondee());
+ world->interface()->respondee());
}
if (!tsci) {
- world->set_engine(world->interface(uri, tsci));
+ world->set_interface(world->new_interface(uri, tsci));
}
_app->attach(tsci);
@@ -187,7 +186,7 @@ ConnectWindow::connect(bool existing)
const std::string engine_uri = string("tcp://localhost:").append(port_str);
SharedPtr<ThreadedSigClientInterface> tsci(new ThreadedSigClientInterface(1024));
- world->set_engine(world->interface(engine_uri, tsci));
+ world->set_interface(world->new_interface(engine_uri, tsci));
_app->attach(tsci);
_app->register_callbacks();
@@ -201,15 +200,15 @@ ConnectWindow::connect(bool existing)
} else
#endif
if (_mode == INTERNAL) {
- if (!world->local_engine()) {
+ if (!world->engine()) {
world->load_module("server");
world->load_module("jack");
- world->local_engine()->activate();
+ world->engine()->activate();
}
SharedPtr<SigClientInterface> client(new SigClientInterface());
- world->engine()->set_respondee(client);
+ world->interface()->set_respondee(client);
_app->attach(client);
_app->register_callbacks();
@@ -241,17 +240,17 @@ ConnectWindow::disconnect()
void
ConnectWindow::activate()
{
- _app->engine()->set_property("ingen:driver",
- "ingen:enabled",
- _app->forge().make(true));
+ _app->interface()->set_property("ingen:driver",
+ "ingen:enabled",
+ _app->forge().make(true));
}
void
ConnectWindow::deactivate()
{
- _app->engine()->set_property("ingen:driver",
- "ingen:enabled",
- _app->forge().make(false));
+ _app->interface()->set_property("ingen:driver",
+ "ingen:enabled",
+ _app->forge().make(false));
}
void
@@ -260,7 +259,7 @@ ConnectWindow::on_show()
if (!_widgets_loaded) {
load_widgets();
if (_attached)
- set_connected_to(_app->engine());
+ set_connected_to(_app->interface());
}
Gtk::Dialog::on_show();
@@ -375,8 +374,8 @@ ConnectWindow::gtk_callback()
sigc::mem_fun(this, &ConnectWindow::ingen_response));
_ping_id = abs(rand()) / 2 * 2; // avoid -1
- _app->engine()->set_response_id(_ping_id);
- _app->engine()->get("ingen:engine");
+ _app->interface()->set_response_id(_ping_id);
+ _app->interface()->get("ingen:engine");
if (_widgets_loaded) {
_progress_label->set_text("Connecting to engine...");
@@ -392,13 +391,13 @@ ConnectWindow::gtk_callback()
const float ms_since_last = (now.tv_sec - last.tv_sec) * 1000.0f +
(now.tv_usec - last.tv_usec) * 0.001f;
if (ms_since_last > 1000) {
- _app->engine()->set_response_id(_ping_id);
- _app->engine()->get("ingen:engine");
+ _app->interface()->set_response_id(_ping_id);
+ _app->interface()->get("ingen:engine");
last = now;
}
}
} else if (_connect_stage == 2) {
- _app->engine()->get(Path("/"));
+ _app->interface()->get(Path("/"));
if (_widgets_loaded)
_progress_label->set_text(string("Requesting root patch..."));
++_connect_stage;
@@ -407,16 +406,16 @@ ConnectWindow::gtk_callback()
SharedPtr<const PatchModel> root = PtrCast<const PatchModel>(
_app->store()->object("/"));
if (root) {
- set_connected_to(_app->engine());
+ set_connected_to(_app->interface());
_app->window_factory()->present_patch(root);
- _app->engine()->get("ingen:plugins");
+ _app->interface()->get("ingen:plugins");
if (_widgets_loaded)
_progress_label->set_text(string("Loading plugins..."));
++_connect_stage;
}
}
} else if (_connect_stage == 4) {
- _app->engine()->get("ingen:plugins");
+ _app->interface()->get("ingen:plugins");
hide();
if (_widgets_loaded)
_progress_label->set_text("Connected to engine");
diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp
index 09830642..8eda5400 100644
--- a/src/gui/LoadPluginWindow.cpp
+++ b/src/gui/LoadPluginWindow.cpp
@@ -352,7 +352,7 @@ LoadPluginWindow::load_plugin(const Gtk::TreeModel::iterator& iter)
Raul::warn << "FIXME: polyphonic" << std::endl;
//props.insert(make_pair(uris.ingen_polyphonic,
// _app->forge().make(polyphonic)));
- _app->engine()->put(path, props);
+ _app->interface()->put(path, props);
if (_selection->get_selected_rows().size() == 1) {
_name_offset = (_name_offset == 0) ? 2 : _name_offset + 1;
diff --git a/src/gui/NewSubpatchWindow.cpp b/src/gui/NewSubpatchWindow.cpp
index 8b99a921..9e815df1 100644
--- a/src/gui/NewSubpatchWindow.cpp
+++ b/src/gui/NewSubpatchWindow.cpp
@@ -100,12 +100,12 @@ NewSubpatchWindow::ok_clicked()
props.insert(make_pair(_app->uris().rdf_type, _app->uris().ingen_Patch));
props.insert(make_pair(_app->uris().ingen_polyphony, _app->forge().make(int32_t(poly))));
props.insert(make_pair(_app->uris().ingen_enabled, _app->forge().make(bool(true))));
- _app->engine()->put(path, props, Resource::INTERNAL);
+ _app->interface()->put(path, props, Resource::INTERNAL);
// Set external (node perspective) properties
props = _initial_data;
props.insert(make_pair(_app->uris().rdf_type, _app->uris().ingen_Patch));
- _app->engine()->put(path, _initial_data, Resource::EXTERNAL);
+ _app->interface()->put(path, _initial_data, Resource::EXTERNAL);
hide();
}
diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp
index 750baf08..c184384e 100644
--- a/src/gui/NodeMenu.cpp
+++ b/src/gui/NodeMenu.cpp
@@ -144,7 +144,7 @@ NodeMenu::on_menu_embed_gui()
void
NodeMenu::on_menu_randomize()
{
- _app->engine()->bundle_begin();
+ _app->interface()->bundle_begin();
const NodeModel* const nm = (NodeModel*)_object.get();
for (NodeModel::Ports::const_iterator i = nm->ports().begin(); i != nm->ports().end(); ++i) {
@@ -152,20 +152,20 @@ NodeMenu::on_menu_randomize()
float min = 0.0f, max = 1.0f;
nm->port_value_range(*i, min, max, _app->sample_rate());
const float val = ((rand() / (float)RAND_MAX) * (max - min) + min);
- _app->engine()->set_property(
+ _app->interface()->set_property(
(*i)->path(),
_app->uris().ingen_value,
_app->forge().make(val));
}
}
- _app->engine()->bundle_end();
+ _app->interface()->bundle_end();
}
void
NodeMenu::on_menu_disconnect()
{
- _app->engine()->disconnect_all(_object->parent()->path(), _object->path());
+ _app->interface()->disconnect_all(_object->parent()->path(), _object->path());
}
void
@@ -186,7 +186,7 @@ NodeMenu::on_preset_activated(const std::string& uri)
subject,
port_pred,
NULL);
- _app->engine()->bundle_begin();
+ _app->interface()->bundle_begin();
LILV_FOREACH(nodes, i, ports) {
const LilvNode* uri = lilv_nodes_get(ports, i);
LilvNodes* values = lilv_world_find_nodes(
@@ -196,13 +196,13 @@ NodeMenu::on_preset_activated(const std::string& uri)
if (values && symbols) {
const LilvNode* val = lilv_nodes_get_first(values);
const LilvNode* sym = lilv_nodes_get_first(symbols);
- _app->engine()->set_property(
+ _app->interface()->set_property(
node->path().base() + lilv_node_as_string(sym),
_app->uris().ingen_value,
_app->forge().make(lilv_node_as_float(val)));
}
}
- _app->engine()->bundle_end();
+ _app->interface()->bundle_end();
lilv_nodes_free(ports);
lilv_node_free(value_pred);
lilv_node_free(symbol_pred);
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index b471d525..7d9fa2f6 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -194,7 +194,7 @@ void
NodeModule::on_embed_gui_toggled(bool embed)
{
embed_gui(embed);
- app().engine()->set_property(_node->path(),
+ app().interface()->set_property(_node->path(),
app().uris().ingen_uiEmbedded,
app().forge().make(embed));
}
@@ -376,7 +376,7 @@ NodeModule::store_location(double ax, double ay)
Resource::Properties add;
add.insert(make_pair(uris.ingen_canvasX, x));
add.insert(make_pair(uris.ingen_canvasY, y));
- app().engine()->delta(_node->path(), remove, add);
+ app().interface()->delta(_node->path(), remove, add);
}
}
@@ -434,9 +434,9 @@ NodeModule::set_selected(gboolean b)
}
}
if (app().signal()) {
- app().engine()->set_property(_node->path(),
- uris.ingen_selected,
- app().forge().make(b));
+ app().interface()->set_property(_node->path(),
+ uris.ingen_selected,
+ app().forge().make(b));
}
}
}
diff --git a/src/gui/ObjectMenu.cpp b/src/gui/ObjectMenu.cpp
index b1d1a766..3b8ac66f 100644
--- a/src/gui/ObjectMenu.cpp
+++ b/src/gui/ObjectMenu.cpp
@@ -96,7 +96,7 @@ ObjectMenu::init(App& app, SharedPtr<const ObjectModel> object)
void
ObjectMenu::on_menu_learn()
{
- _app->engine()->set_property(_object->path(),
+ _app->interface()->set_property(_object->path(),
_app->uris().ingen_controlBinding,
_app->uris().wildcard);
}
@@ -108,14 +108,14 @@ ObjectMenu::on_menu_unlearn()
remove.insert(std::make_pair(
_app->uris().ingen_controlBinding,
_app->uris().wildcard));
- _app->engine()->delta(_object->path(), remove, Resource::Properties());
+ _app->interface()->delta(_object->path(), remove, Resource::Properties());
}
void
ObjectMenu::on_menu_polyphonic()
{
if (_enable_signal)
- _app->engine()->set_property(
+ _app->interface()->set_property(
_object->path(),
_app->uris().ingen_polyphonic,
_app->forge().make(bool(_polyphonic_menuitem->get_active())));
@@ -134,7 +134,7 @@ ObjectMenu::property_changed(const URI& predicate, const Atom& value)
void
ObjectMenu::on_menu_destroy()
{
- _app->engine()->del(_object->path());
+ _app->interface()->del(_object->path());
}
void
diff --git a/src/gui/PatchBox.cpp b/src/gui/PatchBox.cpp
index 9988b252..dbf011ce 100644
--- a/src/gui/PatchBox.cpp
+++ b/src/gui/PatchBox.cpp
@@ -172,7 +172,7 @@ PatchBox::init_box(App& app)
{
_app = &app;
- std::string engine_name = _app->engine()->uri().str();
+ std::string engine_name = _app->interface()->uri().str();
if (engine_name == "http://drobilla.net/ns/ingen#internal") {
engine_name = "internal engine";
}
diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp
index 9bbf3bc5..c8347bcb 100644
--- a/src/gui/PatchCanvas.cpp
+++ b/src/gui/PatchCanvas.cpp
@@ -511,7 +511,7 @@ PatchCanvas::connect(Ganv::Node* tail,
if (!src || !dst)
return;
- _app.engine()->connect(src->model()->path(), dst->model()->path());
+ _app.interface()->connect(src->model()->path(), dst->model()->path());
}
void
@@ -521,7 +521,7 @@ PatchCanvas::disconnect(Ganv::Node* tail,
const Ingen::GUI::Port* const t = dynamic_cast<Ingen::GUI::Port*>(tail);
const Ingen::GUI::Port* const h = dynamic_cast<Ingen::GUI::Port*>(head);
- _app.engine()->disconnect(t->model()->path(), h->model()->path());
+ _app.interface()->disconnect(t->model()->path(), h->model()->path());
}
void
@@ -608,11 +608,11 @@ destroy_node(GanvNode* node, void* data)
NodeModule* node_module = dynamic_cast<NodeModule*>(module);
if (node_module) {
- app->engine()->del(node_module->node()->path());
+ app->interface()->del(node_module->node()->path());
} else {
PatchPortModule* port_module = dynamic_cast<PatchPortModule*>(module);
if (port_module) {
- app->engine()->del(port_module->port()->path());
+ app->interface()->del(port_module->port()->path());
}
}
}
@@ -625,7 +625,7 @@ destroy_edge(GanvEdge* edge, void* data)
Port* tail = dynamic_cast<Port*>(edgemm->get_tail());
Port* head = dynamic_cast<Port*>(edgemm->get_head());
- app->engine()->disconnect(tail->model()->path(), head->model()->path());
+ app->interface()->disconnect(tail->model()->path(), head->model()->path());
}
void
@@ -688,7 +688,7 @@ PatchCanvas::paste()
const URIs& uris = _app.uris();
- Builder builder(_app.world()->uris(), *_app.engine());
+ Builder builder(_app.world()->uris(), *_app.interface());
ClientStore clipboard(_app.world()->uris());
clipboard.set_plugins(_app.store()->plugins());
@@ -792,7 +792,7 @@ PatchCanvas::menu_add_port(const string& sym_base, const string& name_base,
_app.forge().make(int32_t(_patch->num_ports()))));
props.insert(make_pair(uris.lv2_name,
_app.forge().alloc(name.c_str())));
- _app.engine()->put(path, props);
+ _app.interface()->put(path, props);
}
void
@@ -818,7 +818,7 @@ PatchCanvas::load_plugin(WeakPtr<PluginModel> weak_plugin)
props.insert(make_pair(uris.rdf_type, uris.ingen_Node));
props.insert(make_pair(uris.ingen_prototype,
uris.forge.alloc_uri(plugin->uri().str())));
- _app.engine()->put(path, props);
+ _app.interface()->put(path, props);
}
/** Try to guess a suitable location for a new module.
diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp
index c663f926..3961eacf 100644
--- a/src/gui/PatchPortModule.cpp
+++ b/src/gui/PatchPortModule.cpp
@@ -109,7 +109,7 @@ PatchPortModule::store_location(double ax, double ay)
Resource::Property(x, Resource::INTERNAL)));
add.insert(make_pair(uris.ingen_canvasY,
Resource::Property(y, Resource::INTERNAL)));
- app().engine()->delta(_model->path(), remove, add);
+ app().interface()->delta(_model->path(), remove, add);
}
}
@@ -165,7 +165,7 @@ PatchPortModule::set_selected(gboolean b)
if (b != get_selected()) {
Module::set_selected(b);
if (app().signal())
- app().engine()->set_property(
+ app().interface()->set_property(
_model->path(),
app().uris().ingen_selected,
app().forge().make(b));
diff --git a/src/gui/PatchTreeWindow.cpp b/src/gui/PatchTreeWindow.cpp
index b17e8a71..29dc3721 100644
--- a/src/gui/PatchTreeWindow.cpp
+++ b/src/gui/PatchTreeWindow.cpp
@@ -93,7 +93,7 @@ PatchTreeWindow::add_patch(SharedPtr<PatchModel> pm)
Gtk::TreeModel::iterator iter = _patch_treestore->append();
Gtk::TreeModel::Row row = *iter;
if (pm->path().is_root()) {
- row[_patch_tree_columns.name_col] = _app->engine()->uri().str();
+ row[_patch_tree_columns.name_col] = _app->interface()->uri().str();
} else {
row[_patch_tree_columns.name_col] = pm->symbol().c_str();
}
@@ -188,7 +188,7 @@ PatchTreeWindow::event_patch_enabled_toggled(const Glib::ustring& path_str)
assert(pm);
if (_enable_signal)
- _app->engine()->set_property(
+ _app->interface()->set_property(
pm->path(),
_app->uris().ingen_enabled,
_app->forge().make((bool)!pm->enabled()));
diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp
index 4d54f4dc..d8e00ac2 100644
--- a/src/gui/PatchView.cpp
+++ b/src/gui/PatchView.cpp
@@ -162,7 +162,7 @@ PatchView::process_toggled()
if (!_enable_signal)
return;
- _app->engine()->set_property(
+ _app->interface()->set_property(
_patch->path(),
_app->uris().ingen_enabled,
_app->forge().make((bool)_process_but->get_active()));
@@ -171,7 +171,7 @@ PatchView::process_toggled()
void
PatchView::poly_changed()
{
- _app->engine()->set_property(
+ _app->interface()->set_property(
_patch->path(),
_app->uris().ingen_polyphony,
_app->forge().make(_poly_spin->get_value_as_int()));
@@ -180,9 +180,9 @@ PatchView::poly_changed()
void
PatchView::refresh_clicked()
{
- _app->engine()->get(_patch->path());
+ _app->interface()->get(_patch->path());
Raul::warn("Refreshing plugins\n");
- _app->engine()->get("ingen:plugins");
+ _app->interface()->get("ingen:plugins");
}
void
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp
index 7d84abca..fb32a9ac 100644
--- a/src/gui/Port.cpp
+++ b/src/gui/Port.cpp
@@ -143,9 +143,9 @@ Port::on_value_changed(GVariant* value)
const Raul::Atom atom = _app.forge().make(float(g_variant_get_double(value)));
if (atom != model()->value()) {
Ingen::Shared::World* const world = _app.world();
- _app.engine()->set_property(model()->path(),
- world->uris()->ingen_value,
- atom);
+ _app.interface()->set_property(model()->path(),
+ world->uris()->ingen_value,
+ atom);
}
PatchBox* box = get_patch_box();
@@ -165,9 +165,9 @@ Port::value_changed(const Atom& value)
void
Port::on_scale_point_activated(float f)
{
- _app.engine()->set_property(model()->path(),
- _app.world()->uris()->ingen_value,
- _app.world()->forge().make(f));
+ _app.interface()->set_property(model()->path(),
+ _app.world()->uris()->ingen_value,
+ _app.world()->forge().make(f));
}
Gtk::Menu*
diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp
index 19a6770a..378e48cc 100644
--- a/src/gui/PortMenu.cpp
+++ b/src/gui/PortMenu.cpp
@@ -93,10 +93,10 @@ void
PortMenu::on_menu_disconnect()
{
if (_patch_port) {
- _app->engine()->disconnect_all(
+ _app->interface()->disconnect_all(
_object->parent()->path(), _object->path());
} else {
- _app->engine()->disconnect_all(
+ _app->interface()->disconnect_all(
_object->parent()->path().parent(), _object->path());
}
}
@@ -108,7 +108,7 @@ PortMenu::on_menu_set_min()
SharedPtr<const PortModel> model = PtrCast<const PortModel>(_object);
const Raul::Atom& value = model->get_property(uris.ingen_value);
if (value.is_valid())
- _app->engine()->set_property(_object->path(), uris.lv2_minimum, value);
+ _app->interface()->set_property(_object->path(), uris.lv2_minimum, value);
}
void
@@ -118,7 +118,7 @@ PortMenu::on_menu_set_max()
SharedPtr<const PortModel> model = PtrCast<const PortModel>(_object);
const Raul::Atom& value = model->get_property(uris.ingen_value);
if (value.is_valid())
- _app->engine()->set_property(_object->path(), uris.lv2_maximum, value);
+ _app->interface()->set_property(_object->path(), uris.lv2_maximum, value);
}
void
@@ -132,14 +132,14 @@ PortMenu::on_menu_reset_range()
parent->default_port_value_range(model, min, max);
if (!std::isnan(min))
- _app->engine()->set_property(_object->path(),
- uris.lv2_minimum,
- _app->forge().make(min));
+ _app->interface()->set_property(_object->path(),
+ uris.lv2_minimum,
+ _app->forge().make(min));
if (!std::isnan(max))
- _app->engine()->set_property(_object->path(),
- uris.lv2_maximum,
- _app->forge().make(max));
+ _app->interface()->set_property(_object->path(),
+ uris.lv2_maximum,
+ _app->forge().make(max));
}
} // namespace GUI
diff --git a/src/gui/PortPropertiesWindow.cpp b/src/gui/PortPropertiesWindow.cpp
index ca48e239..b7df2445 100644
--- a/src/gui/PortPropertiesWindow.cpp
+++ b/src/gui/PortPropertiesWindow.cpp
@@ -158,7 +158,7 @@ PortPropertiesWindow::ok()
props.insert(
make_pair(uris.lv2_maximum,
_app->forge().make(float(_max_spinner->get_value()))));
- _app->engine()->put(_port_model->path(), props);
+ _app->interface()->put(_port_model->path(), props);
hide();
}
diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp
index 098640ec..07e01d0f 100644
--- a/src/gui/PropertiesWindow.cpp
+++ b/src/gui/PropertiesWindow.cpp
@@ -282,7 +282,7 @@ PropertiesWindow::apply_clicked()
}
}
- _app->engine()->put(_model->path(), properties);
+ _app->interface()->put(_model->path(), properties);
LOG(debug) << "}" << endl;
}
diff --git a/src/gui/RenameWindow.cpp b/src/gui/RenameWindow.cpp
index e10c3fcf..097b9aea 100644
--- a/src/gui/RenameWindow.cpp
+++ b/src/gui/RenameWindow.cpp
@@ -128,12 +128,12 @@ RenameWindow::ok_clicked()
const Symbol& symbol(symbol_str);
if (symbol != _object->symbol()) {
path = _object->path().parent().child(symbol);
- _app->engine()->move(_object->path(), path);
+ _app->interface()->move(_object->path(), path);
}
}
if (!label.empty() && (!name_atom.is_valid() || label != name_atom.get_string())) {
- _app->engine()->set_property(path,
+ _app->interface()->set_property(path,
uris.lv2_name,
_app->forge().alloc(label));
}
diff --git a/src/gui/SubpatchModule.cpp b/src/gui/SubpatchModule.cpp
index 6c74ec69..dcc55e20 100644
--- a/src/gui/SubpatchModule.cpp
+++ b/src/gui/SubpatchModule.cpp
@@ -80,7 +80,7 @@ SubpatchModule::store_location(double ax, double ay)
Resource::Property(x, Resource::EXTERNAL)));
add.insert(make_pair(uris.ingen_canvasY,
Resource::Property(y, Resource::EXTERNAL)));
- app().engine()->delta(_node->path(), remove, add);
+ app().interface()->delta(_node->path(), remove, add);
}
}
@@ -104,7 +104,7 @@ SubpatchModule::browse_to_patch()
void
SubpatchModule::menu_remove()
{
- app().engine()->del(_patch->path());
+ app().interface()->del(_patch->path());
}
} // namespace GUI
diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp
index 4800d003..81bec1eb 100644
--- a/src/gui/ThreadedLoader.cpp
+++ b/src/gui/ThreadedLoader.cpp
@@ -89,7 +89,7 @@ ThreadedLoader::load_patch(bool merge,
sigc::bind(sigc::mem_fun(world->parser().get(),
&Ingen::Serialisation::Parser::parse_file),
_app.world(),
- _app.world()->engine().get(),
+ _app.world()->interface().get(),
document_uri,
engine_parent,
engine_symbol,
diff --git a/src/gui/ingen_gui_lv2.cpp b/src/gui/ingen_gui_lv2.cpp
index 3448f4a9..6afe7f68 100644
--- a/src/gui/ingen_gui_lv2.cpp
+++ b/src/gui/ingen_gui_lv2.cpp
@@ -55,15 +55,12 @@ struct IngenLV2AtomSink : public Ingen::Shared::AtomSink {
struct IngenLV2UI {
IngenLV2UI()
- : conf()
- , sink(NULL)
- {
- }
+ : sink(NULL)
+ {}
int argc;
char** argv;
Ingen::Forge* forge;
- Ingen::Shared::Configuration conf;
Ingen::Shared::World* world;
IngenLV2AtomSink* sink;
SharedPtr<Ingen::GUI::App> app;
@@ -97,7 +94,7 @@ instantiate(const LV2UI_Descriptor* descriptor,
}
ui->world = new Ingen::Shared::World(
- &ui->conf, ui->argc, ui->argv, map, unmap);
+ ui->argc, ui->argv, map, unmap);
ui->forge = new Ingen::Forge(*ui->world->uri_map().get());
@@ -115,7 +112,7 @@ instantiate(const LV2UI_Descriptor* descriptor,
*ui->world->uris().get(),
*ui->sink));
- ui->world->set_engine(ui->engine);
+ ui->world->set_interface(ui->engine);
// Create App and client
ui->app = Ingen::GUI::App::create(ui->world);
diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp
index 2798d7eb..e8cfbcd8 100644
--- a/src/ingen/main.cpp
+++ b/src/ingen/main.cpp
@@ -63,8 +63,8 @@ ingen_interrupt(int signal)
exit(EXIT_FAILURE);
} else {
cout << "ingen: Interrupted" << endl;
- if (world && world->local_engine()) {
- world->local_engine()->quit();
+ if (world && world->engine()) {
+ world->engine()->quit();
}
}
}
@@ -82,47 +82,39 @@ ingen_try(bool cond, const char* msg)
int
main(int argc, char** argv)
{
- Shared::Configuration conf;
+ Glib::thread_init();
+ Shared::set_bundle_path_from_code((void*)&main);
- // Parse command line options
+ // Create world
try {
- conf.parse(argc, argv);
+ world = new Ingen::Shared::World(argc, argv, NULL, NULL);
+ if (argc <= 1) {
+ world->conf().print_usage("ingen", cout);
+ return EXIT_FAILURE;
+ } else if (world->conf().option("help").get_bool()) {
+ world->conf().print_usage("ingen", cout);
+ return EXIT_SUCCESS;
+ }
} catch (std::exception& e) {
cout << "ingen: " << e.what() << endl;
return EXIT_FAILURE;
}
- // Verify option sanity
- if (argc <= 1) {
- conf.print_usage("ingen", cout);
- return EXIT_FAILURE;
- } else if (conf.option("help").get_bool()) {
- conf.print_usage("ingen", cout);
- return EXIT_SUCCESS;
- }
-
- // Set bundle path from executable location so resources can be found
- Shared::set_bundle_path_from_code((void*)&main);
-
- SharedPtr<Interface> engine_interface;
-
- Glib::thread_init();
-
- world = new Ingen::Shared::World(&conf, argc, argv, NULL, NULL);
-
+ Shared::Configuration& conf = world->conf();
if (conf.option("uuid").is_valid()) {
world->set_jack_uuid(conf.option("uuid").get_string());
}
// Run engine
+ SharedPtr<Interface> engine_interface;
if (conf.option("engine").get_bool()) {
ingen_try(world->load_module("server"),
"Unable to load server module");
- ingen_try(world->local_engine(),
+ ingen_try(world->engine(),
"Unable to create engine");
- engine_interface = world->engine();
+ engine_interface = world->interface();
#ifdef HAVE_SOCKET
ingen_try(world->load_module("socket_server"),
@@ -140,11 +132,11 @@ main(int argc, char** argv)
#endif
const char* const uri = conf.option("connect").get_string();
SharedPtr<Interface> client(new Client::ThreadedSigClientInterface(1024));
- ingen_try((engine_interface = world->interface(uri, client)),
+ ingen_try((engine_interface = world->new_interface(uri, client)),
(string("Unable to create interface to `") + uri + "'").c_str());
}
- world->set_engine(engine_interface);
+ world->set_interface(engine_interface);
// Load necessary modules before activating engine (and Jack driver)
@@ -159,10 +151,10 @@ main(int argc, char** argv)
}
// Activate the engine, if we have one
- if (world->local_engine()) {
+ if (world->engine()) {
ingen_try(world->load_module("jack"),
"Unable to load jack module");
- world->local_engine()->activate();
+ world->engine()->activate();
}
// Load a patch
@@ -209,7 +201,7 @@ main(int argc, char** argv)
cerr << "This build of ingen does not support scripting." << endl;
#endif
- } else if (world->local_engine() && !conf.option("gui").get_bool()) {
+ } else if (world->engine() && !conf.option("gui").get_bool()) {
// Run main loop
// Set up signal handlers that will set quit_flag on interrupt
@@ -217,15 +209,15 @@ main(int argc, char** argv)
signal(SIGTERM, ingen_interrupt);
// Run engine main loop until interrupt
- while (world->local_engine()->main_iteration()) {
+ while (world->engine()->main_iteration()) {
Glib::usleep(125000); // 1/8 second
}
Raul::info("Finished main loop\n");
}
// Shut down
- if (world->local_engine())
- world->local_engine()->deactivate();
+ if (world->engine())
+ world->engine()->deactivate();
delete world;
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp
index 971b41e0..5652db27 100644
--- a/src/server/Engine.cpp
+++ b/src/server/Engine.cpp
@@ -106,7 +106,7 @@ Engine::engine_store() const
size_t
Engine::event_queue_size() const
{
- return world()->conf()->option("queue-size").get_int();
+ return world()->conf().option("queue-size").get_int();
}
void
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index 6fa1f890..8803c0c6 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -267,15 +267,15 @@ JackDriver::activate()
}
if (!_client)
- attach(world->conf()->option("jack-server").get_string(),
- world->conf()->option("jack-client").get_string(), NULL);
+ attach(world->conf().option("jack-server").get_string(),
+ world->conf().option("jack-client").get_string(), NULL);
jack_set_process_callback(_client, process_cb, this);
_is_activated = true;
_engine.process_context().activate(
- world->conf()->option("parallelism").get_int(),
+ world->conf().option("parallelism").get_int(),
is_realtime());
if (jack_activate(_client)) {
diff --git a/src/server/LV2RequestRunFeature.hpp b/src/server/LV2RequestRunFeature.hpp
index b15100d2..fddab4b8 100644
--- a/src/server/LV2RequestRunFeature.hpp
+++ b/src/server/LV2RequestRunFeature.hpp
@@ -45,10 +45,10 @@ struct RequestRunFeature : public Ingen::Shared::LV2Features::Feature {
const void* data)
{
Info* info = reinterpret_cast<Info*>(handle);
- if (!info->world->local_engine())
+ if (!info->world->engine())
return LV2_WORKER_ERR_UNKNOWN;
- Engine* engine = (Engine*)info->world->local_engine().get();
+ Engine* engine = (Engine*)info->world->engine().get();
engine->message_context()->run(
dynamic_cast<NodeImpl*>(info->node),
engine->driver()->frame_time());
diff --git a/src/server/ingen_engine.cpp b/src/server/ingen_engine.cpp
index 917e83cf..6e5665cb 100644
--- a/src/server/ingen_engine.cpp
+++ b/src/server/ingen_engine.cpp
@@ -26,11 +26,11 @@ struct IngenEngineModule : public Ingen::Shared::Module {
virtual void load(Ingen::Shared::World* world) {
Server::set_denormal_flags();
SharedPtr<Server::Engine> engine(new Server::Engine(world));
- world->set_local_engine(engine);
- if (!world->engine()) {
- world->set_engine(SharedPtr<Interface>(engine->interface(), NullDeleter<Interface>));
+ world->set_engine(engine);
+ if (!world->interface()) {
+ world->set_interface(SharedPtr<Interface>(engine->interface(), NullDeleter<Interface>));
}
- assert(world->local_engine() == engine);
+ assert(world->engine() == engine);
}
};
diff --git a/src/server/ingen_jack.cpp b/src/server/ingen_jack.cpp
index f47cbff2..a1f068fe 100644
--- a/src/server/ingen_jack.cpp
+++ b/src/server/ingen_jack.cpp
@@ -26,19 +26,19 @@ using namespace Ingen;
struct IngenJackModule : public Ingen::Shared::Module {
void load(Ingen::Shared::World* world) {
- if (((Server::Engine*)world->local_engine().get())->driver()) {
+ if (((Server::Engine*)world->engine().get())->driver()) {
Raul::warn << "Engine already has a driver" << std::endl;
return;
}
Server::JackDriver* driver = new Server::JackDriver(
- *(Server::Engine*)world->local_engine().get());
- const Raul::Configuration::Value& s = world->conf()->option("jack-server");
+ *(Server::Engine*)world->engine().get());
+ const Raul::Configuration::Value& s = world->conf().option("jack-server");
const std::string server_name = s.is_valid() ? s.get_string() : "";
driver->attach(server_name,
- world->conf()->option("jack-client").get_string(),
+ world->conf().option("jack-client").get_string(),
NULL);
- ((Server::Engine*)world->local_engine().get())->set_driver(
+ ((Server::Engine*)world->engine().get())->set_driver(
SharedPtr<Server::Driver>(driver));
}
};
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index df88f7d8..3d3a367c 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -34,7 +34,6 @@
#include "ingen/serialisation/Serialiser.hpp"
#include "ingen/shared/AtomReader.hpp"
#include "ingen/shared/AtomWriter.hpp"
-#include "ingen/shared/Configuration.hpp"
#include "ingen/shared/Store.hpp"
#include "ingen/shared/World.hpp"
#include "ingen/shared/runtime_paths.hpp"
@@ -144,7 +143,7 @@ public:
, _reader(*engine.world()->uri_map().get(),
*engine.world()->uris().get(),
engine.world()->forge(),
- *engine.world()->engine().get())
+ *engine.world()->interface().get())
, _writer(*engine.world()->uri_map().get(),
*engine.world()->uris().get(),
*this)
@@ -330,13 +329,12 @@ private:
};
struct IngenPlugin {
- Ingen::Forge forge;
- Ingen::Shared::Configuration* conf;
- Ingen::Shared::World* world;
- MainThread* main;
- LV2_URID_Map* map;
- int argc;
- char** argv;
+ Ingen::Forge forge;
+ Ingen::Shared::World* world;
+ MainThread* main;
+ LV2_URID_Map* map;
+ int argc;
+ char** argv;
};
static Lib::Patches
@@ -402,7 +400,6 @@ ingen_instantiate(const LV2_Descriptor* descriptor,
}
IngenPlugin* plugin = (IngenPlugin*)malloc(sizeof(IngenPlugin));
- plugin->conf = new Ingen::Shared::Configuration();
plugin->main = NULL;
plugin->map = NULL;
LV2_URID_Unmap* unmap = NULL;
@@ -415,21 +412,21 @@ ingen_instantiate(const LV2_Descriptor* descriptor,
}
plugin->world = new Ingen::Shared::World(
- plugin->conf, plugin->argc, plugin->argv, plugin->map, unmap);
+ plugin->argc, plugin->argv, plugin->map, unmap);
if (!plugin->world->load_module("serialisation")) {
delete plugin->world;
return NULL;
}
SharedPtr<Server::Engine> engine(new Server::Engine(plugin->world));
- plugin->world->set_local_engine(engine);
+ plugin->world->set_engine(engine);
plugin->main = new MainThread(engine);
plugin->main->set_name("Main");
SharedPtr<EventWriter> interface =
SharedPtr<EventWriter>(engine->interface(), NullDeleter<EventWriter>);
- plugin->world->set_engine(interface);
+ plugin->world->set_interface(interface);
Raul::Thread::get().set_context(Server::THREAD_PRE_PROCESS);
Server::ThreadManager::single_threaded = true;
@@ -453,7 +450,7 @@ ingen_instantiate(const LV2_Descriptor* descriptor,
engine->post_processor()->process();
plugin->world->parser()->parse_file(plugin->world,
- plugin->world->engine().get(),
+ plugin->world->interface().get(),
patch->filename);
while (engine->pending_events()) {
@@ -472,7 +469,7 @@ ingen_connect_port(LV2_Handle instance, uint32_t port, void* data)
using namespace Ingen::Server;
IngenPlugin* me = (IngenPlugin*)instance;
- Server::Engine* engine = (Server::Engine*)me->world->local_engine().get();
+ Server::Engine* engine = (Server::Engine*)me->world->engine().get();
LV2Driver* driver = (LV2Driver*)engine->driver();
if (port < driver->ports().size()) {
driver->ports().at(port)->set_buffer(data);
@@ -487,7 +484,7 @@ static void
ingen_activate(LV2_Handle instance)
{
IngenPlugin* me = (IngenPlugin*)instance;
- me->world->local_engine()->activate();
+ me->world->engine()->activate();
//((EventWriter*)me->world->engine().get())->start();
me->main->start();
}
@@ -496,7 +493,7 @@ static void
ingen_run(LV2_Handle instance, uint32_t sample_count)
{
IngenPlugin* me = (IngenPlugin*)instance;
- Server::Engine* engine = (Server::Engine*)me->world->local_engine().get();
+ Server::Engine* engine = (Server::Engine*)me->world->engine().get();
// FIXME: don't do this every call
Raul::Thread::get().set_context(Ingen::Server::THREAD_PROCESS);
((LV2Driver*)engine->driver())->run(sample_count);
@@ -506,15 +503,15 @@ static void
ingen_deactivate(LV2_Handle instance)
{
IngenPlugin* me = (IngenPlugin*)instance;
- me->world->local_engine()->deactivate();
+ me->world->engine()->deactivate();
}
static void
ingen_cleanup(LV2_Handle instance)
{
IngenPlugin* me = (IngenPlugin*)instance;
- me->world->set_local_engine(SharedPtr<Ingen::Server::Engine>());
- me->world->set_engine(SharedPtr<Ingen::Interface>());
+ me->world->set_engine(SharedPtr<Ingen::Server::Engine>());
+ me->world->set_interface(SharedPtr<Ingen::Interface>());
delete me->world;
free(instance);
}
@@ -607,7 +604,7 @@ ingen_restore(LV2_Handle instance,
char* real_path = map_path->absolute_path(map_path->handle, state_path);
plugin->world->parser()->parse_file(plugin->world,
- plugin->world->engine().get(),
+ plugin->world->interface().get(),
real_path);
free(real_path);
return LV2_STATE_SUCCESS;
diff --git a/src/shared/World.cpp b/src/shared/World.cpp
index 28ad1a34..1012a157 100644
--- a/src/shared/World.cpp
+++ b/src/shared/World.cpp
@@ -98,14 +98,12 @@ ingen_load_module(const string& name)
class World::Pimpl {
public:
- Pimpl(Raul::Configuration* conf,
- int& a_argc,
+ Pimpl(int& a_argc,
char**& a_argv,
LV2_URID_Map* map,
LV2_URID_Unmap* unmap)
: argc(a_argc)
, argv(a_argv)
- , conf(conf)
, lv2_features(NULL)
, rdf_world(new Sord::World())
, uri_map(new Ingen::Shared::URIMap(map, unmap))
@@ -113,6 +111,7 @@ public:
, uris(new Shared::URIs(*forge, uri_map.get()))
, lilv_world(lilv_world_new())
{
+ conf.parse(argc, argv);
lv2_features = new Ingen::Shared::LV2Features();
lv2_features->add_feature(uri_map->urid_map_feature());
lv2_features->add_feature(uri_map->urid_unmap_feature());
@@ -136,7 +135,7 @@ public:
serialiser.reset();
parser.reset();
- local_engine.reset();
+ engine.reset();
store.reset();
modules.clear();
@@ -169,14 +168,14 @@ public:
int& argc;
char**& argv;
- Raul::Configuration* conf;
+ Shared::Configuration conf;
LV2Features* lv2_features;
Sord::World* rdf_world;
SharedPtr<URIMap> uri_map;
Ingen::Forge* forge;
SharedPtr<URIs> uris;
- SharedPtr<Interface> engine;
- SharedPtr<EngineBase> local_engine;
+ SharedPtr<Interface> interface;
+ SharedPtr<EngineBase> engine;
SharedPtr<Serialisation::Serialiser> serialiser;
SharedPtr<Serialisation::Parser> parser;
SharedPtr<Store> store;
@@ -184,12 +183,11 @@ public:
std::string jack_uuid;
};
-World::World(Raul::Configuration* conf,
- int& argc,
+World::World(int& argc,
char**& argv,
LV2_URID_Map* map,
LV2_URID_Unmap* unmap)
- : _impl(new Pimpl(conf, argc, argv, map, unmap))
+ : _impl(new Pimpl(argc, argv, map, unmap))
{
}
@@ -199,21 +197,20 @@ World::~World()
delete _impl;
}
-void World::set_local_engine(SharedPtr<EngineBase> e) { _impl->local_engine = e; }
-void World::set_engine(SharedPtr<Interface> e) { _impl->engine = e; }
+void World::set_engine(SharedPtr<EngineBase> e) { _impl->engine = e; }
+void World::set_interface(SharedPtr<Interface> i) { _impl->interface = i; }
void World::set_serialiser(SharedPtr<Serialisation::Serialiser> s) { _impl->serialiser = s; }
void World::set_parser(SharedPtr<Serialisation::Parser> p) { _impl->parser = p; }
void World::set_store(SharedPtr<Store> s) { _impl->store = s; }
-void World::set_conf(Raul::Configuration* c) { _impl->conf = c; }
int& World::argc() { return _impl->argc; }
char**& World::argv() { return _impl->argv; }
-SharedPtr<EngineBase> World::local_engine() { return _impl->local_engine; }
-SharedPtr<Interface> World::engine() { return _impl->engine; }
+SharedPtr<EngineBase> World::engine() { return _impl->engine; }
+SharedPtr<Interface> World::interface() { return _impl->interface; }
SharedPtr<Serialisation::Serialiser> World::serialiser() { return _impl->serialiser; }
SharedPtr<Serialisation::Parser> World::parser() { return _impl->parser; }
SharedPtr<Store> World::store() { return _impl->store; }
-Raul::Configuration* World::conf() { return _impl->conf; }
+Shared::Configuration& World::conf() { return _impl->conf; }
Ingen::Forge& World::forge() { return *_impl->forge; }
LV2Features* World::lv2_features() { return _impl->lv2_features; }
@@ -271,8 +268,8 @@ World::unload_modules()
/** Get an interface for a remote engine at @a url
*/
SharedPtr<Interface>
-World::interface(const std::string& engine_url,
- SharedPtr<Interface> respondee)
+World::new_interface(const std::string& engine_url,
+ SharedPtr<Interface> respondee)
{
const string scheme = engine_url.substr(0, engine_url.find(":"));
const Pimpl::InterfaceFactories::const_iterator i = _impl->interface_factories.find(scheme);
diff --git a/src/socket/SocketListener.cpp b/src/socket/SocketListener.cpp
index fa58ff44..6861a717 100644
--- a/src/socket/SocketListener.cpp
+++ b/src/socket/SocketListener.cpp
@@ -44,7 +44,7 @@ SocketListener::SocketListener(Ingen::Shared::World& world)
set_name("SocketListener");
// Create UNIX socket
- _unix_path = world.conf()->option("socket").get_string();
+ _unix_path = world.conf().option("socket").get_string();
const std::string unix_uri = "unix://" + _unix_path;
if (!_unix_sock.bind(unix_uri) || !_unix_sock.listen()) {
LOG(Raul::error) << "Failed to create UNIX socket" << std::endl;
@@ -52,7 +52,7 @@ SocketListener::SocketListener(Ingen::Shared::World& world)
}
// Create TCP socket
- int port = world.conf()->option("engine-port").get_int();
+ int port = world.conf().option("engine-port").get_int();
std::ostringstream ss;
ss << "tcp:///localhost:";
ss << port;
@@ -76,7 +76,7 @@ SocketListener::~SocketListener()
void
SocketListener::_run()
{
- Server::Engine* engine = (Server::Engine*)_world.local_engine().get();
+ Server::Engine* engine = (Server::Engine*)_world.engine().get();
struct pollfd pfds[2];
int nfds = 0;