diff options
author | David Robillard <d@drobilla.net> | 2016-07-29 11:36:17 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-07-29 13:51:35 -0400 |
commit | 9ff60e9058080ccbea85eee603642a577dd258cf (patch) | |
tree | 728540389e8419c32a96d04b781ee36eb250b902 | |
parent | 77c9b5518299ee401e95cb81aaf18a27900341c8 (diff) | |
download | ingen-9ff60e9058080ccbea85eee603642a577dd258cf.tar.gz ingen-9ff60e9058080ccbea85eee603642a577dd258cf.tar.bz2 ingen-9ff60e9058080ccbea85eee603642a577dd258cf.zip |
Remove Forge dependency from AtomReader
-rw-r--r-- | ingen/AtomReader.hpp | 3 | ||||
-rw-r--r-- | src/AtomReader.cpp | 18 | ||||
-rw-r--r-- | src/SocketReader.cpp | 6 | ||||
-rw-r--r-- | src/gui/ingen_gui_lv2.cpp | 1 | ||||
-rw-r--r-- | src/server/ingen_lv2.cpp | 1 | ||||
-rw-r--r-- | tests/ingen_test.cpp | 1 |
6 files changed, 7 insertions, 23 deletions
diff --git a/ingen/AtomReader.hpp b/ingen/AtomReader.hpp index 370286d8..7bb4b359 100644 --- a/ingen/AtomReader.hpp +++ b/ingen/AtomReader.hpp @@ -28,7 +28,6 @@ namespace Ingen { class AtomSink; -class Forge; class Log; class URIMap; @@ -41,7 +40,6 @@ public: AtomReader(URIMap& map, URIs& uris, Log& log, - Forge& forge, Interface& iface); ~AtomReader() {} @@ -61,7 +59,6 @@ private: URIMap& _map; URIs& _uris; Log& _log; - Forge& _forge; Interface& _iface; }; diff --git a/src/AtomReader.cpp b/src/AtomReader.cpp index ef59e1b5..9f0119d5 100644 --- a/src/AtomReader.cpp +++ b/src/AtomReader.cpp @@ -25,18 +25,12 @@ namespace Ingen { -AtomReader::AtomReader(URIMap& map, - URIs& uris, - Log& log, - Forge& forge, - Interface& iface) +AtomReader::AtomReader(URIMap& map, URIs& uris, Log& log, Interface& iface) : _map(map) , _uris(uris) , _log(log) - , _forge(forge) , _iface(iface) -{ -} +{} void AtomReader::get_atom(const LV2_Atom* in, Atom& out) @@ -46,12 +40,12 @@ AtomReader::get_atom(const LV2_Atom* in, Atom& out) const LV2_Atom_URID* urid = (const LV2_Atom_URID*)in; const char* uri = _map.unmap_uri(urid->body); if (uri) { - out = _forge.make_urid(urid->body); + out = Atom(sizeof(int32_t), _uris.atom_URID, &urid->body); } else { _log.error(fmt("Unable to unmap URID %1%\n") % urid->body); } } else { - out = _forge.alloc(in->size, in->type, LV2_ATOM_BODY_CONST(in)); + out = Atom(in->size, in->type, LV2_ATOM_BODY_CONST(in)); } } } @@ -61,8 +55,8 @@ AtomReader::get_props(const LV2_Atom_Object* obj, Ingen::Resource::Properties& props) { if (obj->body.otype) { - props.insert(std::make_pair(_uris.rdf_type, - _forge.make_urid(obj->body.otype))); + const Atom type(sizeof(int32_t), _uris.atom_URID, &obj->body.otype); + props.insert(std::make_pair(_uris.rdf_type, type)); } LV2_ATOM_OBJECT_FOREACH(obj, p) { Atom val; diff --git a/src/SocketReader.cpp b/src/SocketReader.cpp index c9b31cb5..32552c24 100644 --- a/src/SocketReader.cpp +++ b/src/SocketReader.cpp @@ -135,11 +135,7 @@ SocketReader::run() serd_reader_start_stream(reader, f, (const uint8_t*)"(socket)", false); // Make an AtomReader to call Ingen Interface methods based on Atom - AtomReader ar(_world.uri_map(), - _world.uris(), - _world.log(), - _world.forge(), - _iface); + AtomReader ar(_world.uri_map(), _world.uris(), _world.log(), _iface); struct pollfd pfd; pfd.fd = _socket->fd(); diff --git a/src/gui/ingen_gui_lv2.cpp b/src/gui/ingen_gui_lv2.cpp index c81d48a0..6d1dfdba 100644 --- a/src/gui/ingen_gui_lv2.cpp +++ b/src/gui/ingen_gui_lv2.cpp @@ -140,7 +140,6 @@ instantiate(const LV2UI_Descriptor* descriptor, new Ingen::AtomReader(ui->world->uri_map(), ui->world->uris(), ui->world->log(), - ui->world->forge(), *ui->client.get())); // Create empty root graph model diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index d74a829b..217833bc 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -100,7 +100,6 @@ public: , _reader(engine.world()->uri_map(), engine.world()->uris(), engine.world()->log(), - engine.world()->forge(), *engine.world()->interface().get()) , _writer(engine.world()->uri_map(), engine.world()->uris(), diff --git a/tests/ingen_test.cpp b/tests/ingen_test.cpp index 1ebb897f..542636a2 100644 --- a/tests/ingen_test.cpp +++ b/tests/ingen_test.cpp @@ -197,7 +197,6 @@ main(int argc, char** argv) AtomReader atom_reader(world->uri_map(), world->uris(), world->log(), - world->forge(), *world->interface().get()); // AtomWriter to serialise responses from the engine |