diff options
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/Engine.cpp | 7 | ||||
-rw-r--r-- | src/server/Worker.cpp | 3 | ||||
-rw-r--r-- | src/server/events/CreateGraph.cpp | 54 | ||||
-rw-r--r-- | src/server/events/Delete.cpp | 5 | ||||
-rw-r--r-- | src/server/events/Delta.cpp | 11 | ||||
-rw-r--r-- | src/server/events/Disconnect.cpp | 10 | ||||
-rw-r--r-- | src/server/ingen_lv2.cpp | 4 |
7 files changed, 52 insertions, 42 deletions
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index c72d98df..b48b291f 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -58,7 +58,6 @@ #include "ingen/URI.hpp" #include "ingen/URIs.hpp" #include "ingen/World.hpp" -#include "ingen/memory.hpp" #include "lv2/buf-size/buf-size.h" #include "lv2/state/state.h" #include "raul/Maid.hpp" @@ -114,9 +113,9 @@ Engine::Engine(ingen::World& world) for (int i = 0; i < world.conf().option("threads").get<int32_t>(); ++i) { _notifications.emplace_back( - make_unique<raul::RingBuffer>(uint32_t(24 * event_queue_size()))); + std::make_unique<raul::RingBuffer>(uint32_t(24 * event_queue_size()))); _run_contexts.emplace_back( - make_unique<RunContext>( + std::make_unique<RunContext>( *this, _notifications.back().get(), unsigned(i), i > 0)); } @@ -189,7 +188,7 @@ void Engine::listen() { #ifdef HAVE_SOCKET - _listener = make_unique<SocketListener>(*this); + _listener = std::make_unique<SocketListener>(*this); #endif } diff --git a/src/server/Worker.cpp b/src/server/Worker.cpp index 8e8f3e5e..77d98612 100644 --- a/src/server/Worker.cpp +++ b/src/server/Worker.cpp @@ -22,7 +22,6 @@ #include "ingen/Log.hpp" #include "ingen/Node.hpp" -#include "ingen/memory.hpp" #include "lv2/core/lv2.h" #include "lv2/worker/worker.h" @@ -127,7 +126,7 @@ Worker::Worker(Log& log, uint32_t buffer_size, bool synchronous) , _synchronous(synchronous) { if (!synchronous) { - _thread = make_unique<std::thread>(&Worker::run, this); + _thread = std::make_unique<std::thread>(&Worker::run, this); } } diff --git a/src/server/events/CreateGraph.cpp b/src/server/events/CreateGraph.cpp index 6b85281d..2a74ddf0 100644 --- a/src/server/events/CreateGraph.cpp +++ b/src/server/events/CreateGraph.cpp @@ -34,7 +34,6 @@ #include "ingen/URI.hpp" #include "ingen/URIs.hpp" #include "ingen/World.hpp" -#include "ingen/memory.hpp" #include "ingen/paths.hpp" #include "raul/Maid.hpp" #include "raul/Path.hpp" @@ -61,7 +60,8 @@ CreateGraph::CreateGraph(Engine& engine, , _properties(properties) , _graph(nullptr) , _parent(nullptr) -{} +{ +} CreateGraph::~CreateGraph() = default; @@ -84,30 +84,40 @@ CreateGraph::build_child_events() in_properties.put(uris.lv2_index, uris.forge.make(0)); in_properties.put(uris.lv2_name, uris.forge.alloc("Control")); in_properties.put(uris.rdf_type, uris.lv2_InputPort); - in_properties.put(uris.ingen_canvasX, uris.forge.make(32.0f), + in_properties.put(uris.ingen_canvasX, + uris.forge.make(32.0f), Resource::Graph::EXTERNAL); - in_properties.put(uris.ingen_canvasY, uris.forge.make(32.0f), + in_properties.put(uris.ingen_canvasY, + uris.forge.make(32.0f), Resource::Graph::EXTERNAL); - _child_events.push_back( - make_unique<events::CreatePort>(_engine, _request_client, -1, _time, - _path.child(raul::Symbol("control")), - in_properties)); + _child_events.push_back(std::make_unique<events::CreatePort>( + _engine, + _request_client, + -1, + _time, + _path.child(raul::Symbol("control")), + in_properties)); // Add notify port (message respond) Properties out_properties(control_properties); out_properties.put(uris.lv2_index, uris.forge.make(1)); out_properties.put(uris.lv2_name, uris.forge.alloc("Notify")); out_properties.put(uris.rdf_type, uris.lv2_OutputPort); - out_properties.put(uris.ingen_canvasX, uris.forge.make(128.0f), + out_properties.put(uris.ingen_canvasX, + uris.forge.make(128.0f), Resource::Graph::EXTERNAL); - out_properties.put(uris.ingen_canvasY, uris.forge.make(32.0f), + out_properties.put(uris.ingen_canvasY, + uris.forge.make(32.0f), Resource::Graph::EXTERNAL); _child_events.push_back( - make_unique<events::CreatePort>(_engine, _request_client, -1, _time, - _path.child(raul::Symbol("notify")), - out_properties)); + std::make_unique<events::CreatePort>(_engine, + _request_client, + -1, + _time, + _path.child(raul::Symbol("notify")), + out_properties)); } bool @@ -151,24 +161,28 @@ CreateGraph::pre_process(PreProcessContext& ctx) t = _properties.find(uris.lv2_prototype); } - if (t != _properties.end() && - uris.forge.is_uri(t->second) && + if (t != _properties.end() && uris.forge.is_uri(t->second) && URI::is_valid(uris.forge.str(t->second, false)) && uri_is_path(URI(uris.forge.str(t->second, false)))) { // Create a duplicate of an existing graph const URI prototype(uris.forge.str(t->second, false)); GraphImpl* ancestor = dynamic_cast<GraphImpl*>( - _engine.store()->get(uri_to_path(prototype))); + _engine.store()->get(uri_to_path(prototype))); if (!ancestor) { - return Event::pre_process_done(Status::PROTOTYPE_NOT_FOUND, prototype); + return Event::pre_process_done(Status::PROTOTYPE_NOT_FOUND, + prototype); } else if (!(_graph = dynamic_cast<GraphImpl*>( - ancestor->duplicate(_engine, symbol, _parent)))) { + ancestor->duplicate(_engine, symbol, _parent)))) { return Event::pre_process_done(Status::CREATION_FAILED, _path); } } else { // Create a new graph - _graph = new GraphImpl(_engine, symbol, ext_poly, _parent, - _engine.sample_rate(), int_poly); + _graph = new GraphImpl(_engine, + symbol, + ext_poly, + _parent, + _engine.sample_rate(), + int_poly); _graph->add_property(uris.rdf_type, uris.ingen_Graph.urid_atom()); _graph->add_property(uris.rdf_type, Property(uris.ingen_Block, diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp index 7b284902..3347b549 100644 --- a/src/server/events/Delete.cpp +++ b/src/server/events/Delete.cpp @@ -38,7 +38,6 @@ #include "ingen/URI.hpp" #include "ingen/URIs.hpp" #include "ingen/World.hpp" -#include "ingen/memory.hpp" #include "ingen/paths.hpp" #include "raul/Array.hpp" #include "raul/Maid.hpp" @@ -114,13 +113,13 @@ Delete::pre_process(PreProcessContext& ctx) if (_block) { parent->remove_block(*_block); _disconnect_event = - make_unique<DisconnectAll>(_engine, parent, _block.get()); + std::make_unique<DisconnectAll>(_engine, parent, _block.get()); _disconnect_event->pre_process(ctx); _compiled_graph = ctx.maybe_compile(*_engine.maid(), *parent); } else if (_port) { parent->remove_port(*_port); _disconnect_event = - make_unique<DisconnectAll>(_engine, parent, _port.get()); + std::make_unique<DisconnectAll>(_engine, parent, _port.get()); _disconnect_event->pre_process(ctx); _compiled_graph = ctx.maybe_compile(*_engine.maid(), *parent); diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index 034b2194..b4d46fb9 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -43,7 +43,6 @@ #include "ingen/Store.hpp" #include "ingen/URIs.hpp" #include "ingen/World.hpp" -#include "ingen/memory.hpp" #include "ingen/paths.hpp" #include "lilv/lilv.h" #include "raul/Maid.hpp" @@ -153,7 +152,7 @@ Delta::add_set_event(const char* port_symbol, } _set_events.emplace_back( - make_unique<SetPortValue>( + std::make_unique<SetPortValue>( _engine, _request_client, _request_id, _time, port, Atom(size, type, value), false, true)); } @@ -249,13 +248,13 @@ Delta::pre_process(PreProcessContext& ctx) ingen::Resource::type(uris, _properties, is_graph, is_block, is_port, is_output); if (is_graph) { - _create_event = make_unique<CreateGraph>( + _create_event = std::make_unique<CreateGraph>( _engine, _request_client, _request_id, _time, path, _properties); } else if (is_block) { - _create_event = make_unique<CreateBlock>( + _create_event = std::make_unique<CreateBlock>( _engine, _request_client, _request_id, _time, path, _properties); } else if (is_port) { - _create_event = make_unique<CreatePort>( + _create_event = std::make_unique<CreatePort>( _engine, _request_client, _request_id, _time, path, _properties); } @@ -351,7 +350,7 @@ Delta::pre_process(PreProcessContext& ctx) } } else if (key == uris.ingen_value || key == uris.ingen_activity) { _set_events.emplace_back( - make_unique<SetPortValue>( + std::make_unique<SetPortValue>( _engine, _request_client, _request_id, _time, port, value, key == uris.ingen_activity)); } else if (key == uris.midi_binding) { diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp index 93e271af..ea6bb8f0 100644 --- a/src/server/events/Disconnect.cpp +++ b/src/server/events/Disconnect.cpp @@ -35,13 +35,13 @@ #include "ingen/Node.hpp" #include "ingen/Status.hpp" #include "ingen/Store.hpp" -#include "ingen/memory.hpp" #include "raul/Array.hpp" #include "raul/Maid.hpp" #include "raul/Path.hpp" #include <cassert> #include <cstdint> +#include <memory> #include <mutex> #include <set> #include <string> @@ -167,10 +167,10 @@ Disconnect::pre_process(PreProcessContext& ctx) return Event::pre_process_done(Status::PARENT_NOT_FOUND, _msg.head); } - _impl = make_unique<Impl>(_engine, - _graph, - dynamic_cast<PortImpl*>(tail), - dynamic_cast<InputPort*>(head)); + _impl = std::make_unique<Impl>(_engine, + _graph, + dynamic_cast<PortImpl*>(tail), + dynamic_cast<InputPort*>(head)); _compiled_graph = ctx.maybe_compile(*_engine.maid(), *_graph); diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index d709e41a..90b9d944 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -533,7 +533,7 @@ ingen_instantiate(const LV2_Descriptor* descriptor, auto* plugin = new IngenPlugin(); plugin->map = map; - plugin->world = make_unique<ingen::World>(map, unmap, log); + plugin->world = std::make_unique<ingen::World>(map, unmap, log); plugin->world->load_configuration(plugin->argc, plugin->argv); LV2_URID bufsz_max = map->map(map->handle, LV2_BUF_SIZE__maxBlockLength); @@ -633,7 +633,7 @@ ingen_activate(LV2_Handle instance) auto engine = std::static_pointer_cast<Engine>(me->world->engine()); const auto driver = std::static_pointer_cast<LV2Driver>(engine->driver()); engine->activate(); - me->main = make_unique<std::thread>(ingen_lv2_main, engine, driver); + me->main = std::make_unique<std::thread>(ingen_lv2_main, engine, driver); } static void |