From df1447c665e6c3631961297a9d3e9aff4e94c47f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 12 Jan 2013 23:38:03 +0000 Subject: Remove Raul::SharedPtr and switch to std::shared_ptr. Use project local short type aliases for shared_ptr and friends. Move Raul::Disposable and Raul::Manageable into Raul::Maid. Use sets to store machina nodes and edges to avoid O(n) searches. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4939 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/BlockFactory.cpp | 8 ++++---- src/server/BlockFactory.hpp | 10 +++++----- src/server/Broadcaster.cpp | 8 ++++---- src/server/Broadcaster.hpp | 9 ++++----- src/server/Buffer.hpp | 2 +- src/server/BufferFactory.hpp | 6 +++--- src/server/CompiledGraph.hpp | 4 ++-- src/server/ControlBindings.cpp | 16 ++++++++-------- src/server/ControlBindings.hpp | 16 ++++++++-------- src/server/Engine.cpp | 22 +++++++++++----------- src/server/Engine.hpp | 32 ++++++++++++++++---------------- src/server/Event.hpp | 18 +++++++++--------- src/server/EventWriter.hpp | 12 ++++++------ src/server/GraphImpl.cpp | 8 ++++---- src/server/GraphImpl.hpp | 6 +++--- src/server/InputPort.hpp | 2 +- src/server/JackDriver.cpp | 4 ++-- src/server/LV2Block.cpp | 16 ++++++++-------- src/server/LV2Block.hpp | 26 +++++++++++++------------- src/server/LV2Info.cpp | 2 +- src/server/LV2Options.hpp | 6 +++--- src/server/LV2Plugin.cpp | 2 +- src/server/LV2Plugin.hpp | 10 +++++----- src/server/LV2ResizeFeature.hpp | 6 +++--- src/server/NodeImpl.hpp | 1 - src/server/Worker.cpp | 6 +++--- src/server/Worker.hpp | 6 +++--- src/server/events/Connect.cpp | 14 +++++++------- src/server/events/Connect.hpp | 14 +++++++------- src/server/events/CreateBlock.cpp | 2 +- src/server/events/CreateBlock.hpp | 2 +- src/server/events/CreateGraph.cpp | 2 +- src/server/events/CreateGraph.hpp | 2 +- src/server/events/CreatePort.cpp | 2 +- src/server/events/CreatePort.hpp | 2 +- src/server/events/Delete.cpp | 14 +++++++------- src/server/events/Delete.hpp | 32 ++++++++++++++++---------------- src/server/events/Delta.cpp | 18 +++++++++--------- src/server/events/Delta.hpp | 4 ++-- src/server/events/Disconnect.cpp | 12 ++++++------ src/server/events/Disconnect.hpp | 14 +++++++------- src/server/events/DisconnectAll.cpp | 12 ++++++------ src/server/events/DisconnectAll.hpp | 12 ++++++------ src/server/events/Get.cpp | 10 +++++----- src/server/events/Get.hpp | 10 +++++----- src/server/events/Move.cpp | 12 ++++++------ src/server/events/Move.hpp | 12 ++++++------ src/server/events/SetPortValue.cpp | 12 ++++++------ src/server/events/SetPortValue.hpp | 12 ++++++------ src/server/ingen_engine.cpp | 5 +++-- src/server/ingen_jack.cpp | 2 +- src/server/ingen_lv2.cpp | 31 ++++++++++++++++--------------- 52 files changed, 264 insertions(+), 264 deletions(-) (limited to 'src/server') diff --git a/src/server/BlockFactory.cpp b/src/server/BlockFactory.cpp index 61237ee4..a174c270 100644 --- a/src/server/BlockFactory.cpp +++ b/src/server/BlockFactory.cpp @@ -120,13 +120,13 @@ void BlockFactory::load_lv2_plugins() { // Build an array of port type nodes for checking compatibility - typedef std::vector< SharedPtr > Types; + typedef std::vector< SPtr > Types; Types types; for (unsigned t = PortType::ID::AUDIO; t <= PortType::ID::ATOM; ++t) { const Raul::URI& uri(PortType((PortType::ID)t).uri()); - types.push_back(SharedPtr( - lilv_new_uri(_world->lilv_world(), uri.c_str()), - lilv_node_free)); + types.push_back( + SPtr(lilv_new_uri(_world->lilv_world(), uri.c_str()), + lilv_node_free)); } const LilvPlugins* plugins = lilv_world_get_all_plugins(_world->lilv_world()); diff --git a/src/server/BlockFactory.hpp b/src/server/BlockFactory.hpp index a66b7913..877a860b 100644 --- a/src/server/BlockFactory.hpp +++ b/src/server/BlockFactory.hpp @@ -20,8 +20,8 @@ #include #include "ingen/World.hpp" +#include "ingen/types.hpp" #include "raul/Noncopyable.hpp" -#include "raul/SharedPtr.hpp" #include "raul/URI.hpp" namespace Ingen { @@ -51,10 +51,10 @@ private: void load_lv2_plugins(); void load_internal_plugins(); - Plugins _plugins; - Ingen::World* _world; - SharedPtr _lv2_info; - bool _has_loaded; + Plugins _plugins; + Ingen::World* _world; + SPtr _lv2_info; + bool _has_loaded; }; } // namespace Server diff --git a/src/server/Broadcaster.cpp b/src/server/Broadcaster.cpp index 49bc68ae..f3bc96f7 100644 --- a/src/server/Broadcaster.cpp +++ b/src/server/Broadcaster.cpp @@ -35,8 +35,8 @@ Broadcaster::~Broadcaster() /** Register a client to receive messages over the notification band. */ void -Broadcaster::register_client(const Raul::URI& uri, - SharedPtr client) +Broadcaster::register_client(const Raul::URI& uri, + SPtr client) { Glib::Mutex::Lock lock(_clients_mutex); _clients[uri] = client; @@ -57,7 +57,7 @@ Broadcaster::unregister_client(const Raul::URI& uri) /** Looks up the client with the given source @a uri (which is used as the * unique identifier for registered clients). */ -SharedPtr +SPtr Broadcaster::client(const Raul::URI& uri) { Glib::Mutex::Lock lock(_clients_mutex); @@ -65,7 +65,7 @@ Broadcaster::client(const Raul::URI& uri) if (i != _clients.end()) { return (*i).second; } else { - return SharedPtr(); + return SPtr(); } } diff --git a/src/server/Broadcaster.hpp b/src/server/Broadcaster.hpp index 33b438e5..3162742b 100644 --- a/src/server/Broadcaster.hpp +++ b/src/server/Broadcaster.hpp @@ -23,9 +23,8 @@ #include -#include "raul/SharedPtr.hpp" - #include "ingen/Interface.hpp" +#include "ingen/types.hpp" #include "BlockFactory.hpp" @@ -45,7 +44,7 @@ public: Broadcaster() : _bundle_depth(0) {} ~Broadcaster(); - void register_client(const Raul::URI& uri, SharedPtr client); + void register_client(const Raul::URI& uri, SPtr client); bool unregister_client(const Raul::URI& uri); /** A handle that represents a transfer of possibly several changes. @@ -68,7 +67,7 @@ public: Broadcaster& broadcaster; }; - SharedPtr client(const Raul::URI& uri); + SPtr client(const Raul::URI& uri); void send_plugins(const BlockFactory::Plugins& plugin_list); void send_plugins_to(Interface*, const BlockFactory::Plugins& plugin_list); @@ -134,7 +133,7 @@ public: private: friend class Transfer; - typedef std::map< Raul::URI, SharedPtr > Clients; + typedef std::map< Raul::URI, SPtr > Clients; Glib::Mutex _clients_mutex; Clients _clients; diff --git a/src/server/Buffer.hpp b/src/server/Buffer.hpp index 56325f16..14984de4 100644 --- a/src/server/Buffer.hpp +++ b/src/server/Buffer.hpp @@ -22,10 +22,10 @@ #include +#include "ingen/types.hpp" #include "lv2/lv2plug.in/ns/ext/atom/atom.h" #include "lv2/lv2plug.in/ns/ext/urid/urid.h" #include "raul/Deletable.hpp" -#include "raul/SharedPtr.hpp" #include "BufferFactory.hpp" #include "PortType.hpp" diff --git a/src/server/BufferFactory.hpp b/src/server/BufferFactory.hpp index 82180308..8c0f5db9 100644 --- a/src/server/BufferFactory.hpp +++ b/src/server/BufferFactory.hpp @@ -23,11 +23,11 @@ #undef nil #include -#include "raul/Atom.hpp" -#include "raul/RingBuffer.hpp" -#include "raul/SharedPtr.hpp" #include "ingen/Forge.hpp" #include "ingen/URIs.hpp" +#include "ingen/types.hpp" +#include "raul/Atom.hpp" +#include "raul/RingBuffer.hpp" #include "BufferRef.hpp" #include "PortType.hpp" diff --git a/src/server/CompiledGraph.hpp b/src/server/CompiledGraph.hpp index ee02a24e..21b93058 100644 --- a/src/server/CompiledGraph.hpp +++ b/src/server/CompiledGraph.hpp @@ -20,7 +20,7 @@ #include #include -#include "raul/Disposable.hpp" +#include "raul/Maid.hpp" #include "raul/Noncopyable.hpp" namespace Ingen { @@ -63,7 +63,7 @@ private: * before its providers, using this order as well as semaphores. */ class CompiledGraph : public std::vector - , public Raul::Disposable + , public Raul::Maid::Disposable , public Raul::Noncopyable { }; diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp index 25d49265..634c568a 100644 --- a/src/server/ControlBindings.cpp +++ b/src/server/ControlBindings.cpp @@ -350,13 +350,13 @@ ControlBindings::bind(ProcessContext& context, Key key) return true; } -SharedPtr +SPtr ControlBindings::remove(const Raul::Path& path) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); - SharedPtr old_bindings(_bindings); - SharedPtr copy(new Bindings(*_bindings.get())); + SPtr old_bindings(_bindings); + SPtr copy(new Bindings(*_bindings.get())); for (Bindings::iterator i = copy->begin(); i != copy->end();) { Bindings::iterator next = i; @@ -372,13 +372,13 @@ ControlBindings::remove(const Raul::Path& path) return old_bindings; } -SharedPtr +SPtr ControlBindings::remove(PortImpl* port) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); - SharedPtr old_bindings(_bindings); - SharedPtr copy(new Bindings(*_bindings.get())); + SPtr old_bindings(_bindings); + SPtr copy(new Bindings(*_bindings.get())); for (Bindings::iterator i = copy->begin(); i != copy->end();) { Bindings::iterator next = i; @@ -397,8 +397,8 @@ ControlBindings::remove(PortImpl* port) void ControlBindings::pre_process(ProcessContext& context, Buffer* buffer) { - uint16_t value = 0; - SharedPtr bindings = _bindings; + uint16_t value = 0; + SPtr bindings = _bindings; _feedback->clear(); Ingen::World* world = context.engine().world(); diff --git a/src/server/ControlBindings.hpp b/src/server/ControlBindings.hpp index 630ec18a..26e9dd93 100644 --- a/src/server/ControlBindings.hpp +++ b/src/server/ControlBindings.hpp @@ -20,10 +20,10 @@ #include #include +#include "ingen/types.hpp" #include "lv2/lv2plug.in/ns/ext/atom/forge.h" #include "raul/Atom.hpp" #include "raul/Path.hpp" -#include "raul/SharedPtr.hpp" #include "BufferFactory.hpp" @@ -82,13 +82,13 @@ public: * The caller must safely drop the returned reference in the * post-processing thread after at least one process thread has run. */ - SharedPtr remove(const Raul::Path& path); + SPtr remove(const Raul::Path& path); /** Remove binding for a particular port. * The caller must safely drop the returned reference in the * post-processing thread after at least one process thread has run. */ - SharedPtr remove(PortImpl* port); + SPtr remove(PortImpl* port); private: Key midi_event_key(uint16_t size, const uint8_t* buf, uint16_t& value); @@ -106,11 +106,11 @@ private: Type type, const Raul::Atom& value) const; - Engine& _engine; - PortImpl* _learn_port; - SharedPtr _bindings; - BufferRef _feedback; - LV2_Atom_Forge _forge; + Engine& _engine; + PortImpl* _learn_port; + SPtr _bindings; + BufferRef _feedback; + LV2_Atom_Forge _forge; }; } // namespace Server diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index 5002feca..165f6412 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -18,12 +18,12 @@ #include "events/CreatePort.hpp" #include "ingen/Configuration.hpp" +#include "ingen/Log.hpp" #include "ingen/Store.hpp" #include "ingen/URIs.hpp" #include "ingen/World.hpp" -#include "ingen/Log.hpp" +#include "ingen/types.hpp" #include "raul/Maid.hpp" -#include "raul/SharedPtr.hpp" #include "BlockFactory.hpp" #include "Broadcaster.hpp" @@ -68,7 +68,7 @@ Engine::Engine(Ingen::World* world) , _direct_driver(true) { if (!world->store()) { - world->set_store(SharedPtr(new Store())); + world->set_store(SPtr(new Store())); } _control_bindings = new ControlBindings(*this); @@ -82,16 +82,16 @@ Engine::~Engine() _root_graph = NULL; deactivate(); - const SharedPtr store = this->store(); + const SPtr store = this->store(); if (store) { for (auto& s : *store.get()) { - if (!PtrCast(s.second)->parent()) { + if (!dynamic_ptr_cast(s.second)->parent()) { s.second.reset(); } } } - _world->set_store(SharedPtr()); + _world->set_store(SPtr()); delete _maid; delete _pre_processor; @@ -109,7 +109,7 @@ Engine::~Engine() munlockall(); } -SharedPtr +SPtr Engine::store() const { return _world->store(); @@ -136,7 +136,7 @@ Engine::main_iteration() } void -Engine::set_driver(SharedPtr driver) +Engine::set_driver(SPtr driver) { _driver = driver; } @@ -174,7 +174,7 @@ execute_and_delete_event(ProcessContext& context, Event* ev) void Engine::init(double sample_rate, uint32_t block_length) { - set_driver(SharedPtr(new DirectDriver(sample_rate, block_length))); + set_driver(SPtr(new DirectDriver(sample_rate, block_length))); _direct_driver = true; } @@ -240,7 +240,7 @@ Engine::activate() Resource::Property(forge.make(32.0f), Resource::Graph::EXTERNAL))); - SharedPtr respondee; + SPtr respondee; execute_and_delete_event( context, new Events::CreatePort( *this, respondee, -1, 0, Raul::Path("/control_in"), @@ -340,7 +340,7 @@ Engine::process_events() } void -Engine::register_client(const Raul::URI& uri, SharedPtr client) +Engine::register_client(const Raul::URI& uri, SPtr client) { log().info(Raul::fmt("Registering client <%1%>\n") % uri.c_str()); _broadcaster->register_client(uri, client); diff --git a/src/server/Engine.hpp b/src/server/Engine.hpp index 692fbee8..e7327ef4 100644 --- a/src/server/Engine.hpp +++ b/src/server/Engine.hpp @@ -21,7 +21,7 @@ #include "ingen/EngineBase.hpp" #include "ingen/Interface.hpp" -#include "raul/SharedPtr.hpp" +#include "ingen/types.hpp" #include "ProcessContext.hpp" @@ -73,10 +73,10 @@ public: virtual void quit(); virtual bool main_iteration(); virtual void register_client(const Raul::URI& uri, - SharedPtr client); + SPtr client); virtual bool unregister_client(const Raul::URI& uri); - void set_driver(SharedPtr driver); + void set_driver(SPtr driver); SampleCount event_time(); @@ -106,25 +106,25 @@ public: ProcessContext& process_context() { return _process_context; } - SharedPtr store() const; + SPtr store() const; size_t event_queue_size() const; private: Ingen::World* _world; - BlockFactory* _block_factory; - Broadcaster* _broadcaster; - BufferFactory* _buffer_factory; - ControlBindings* _control_bindings; - SharedPtr _driver; - EventWriter* _event_writer; - Raul::Maid* _maid; - SharedPtr _options; - PreProcessor* _pre_processor; - PostProcessor* _post_processor; - GraphImpl* _root_graph; - Worker* _worker; + BlockFactory* _block_factory; + Broadcaster* _broadcaster; + BufferFactory* _buffer_factory; + ControlBindings* _control_bindings; + SPtr _driver; + EventWriter* _event_writer; + Raul::Maid* _maid; + SPtr _options; + PreProcessor* _pre_processor; + PostProcessor* _post_processor; + GraphImpl* _root_graph; + Worker* _worker; ProcessContext _process_context; diff --git a/src/server/Event.hpp b/src/server/Event.hpp index e2000d09..21af45c5 100644 --- a/src/server/Event.hpp +++ b/src/server/Event.hpp @@ -22,11 +22,11 @@ #include "raul/Deletable.hpp" #include "raul/Noncopyable.hpp" #include "raul/Path.hpp" -#include "raul/SharedPtr.hpp" #include "ingen/Interface.hpp" #include "ingen/Node.hpp" #include "ingen/Status.hpp" +#include "ingen/types.hpp" #include "types.hpp" @@ -81,7 +81,7 @@ public: Status status() const { return _status; } protected: - Event(Engine& engine, SharedPtr client, int32_t id, FrameTime time) + Event(Engine& engine, SPtr client, int32_t id, FrameTime time) : _engine(engine) , _next(NULL) , _request_client(client) @@ -122,13 +122,13 @@ protected: return _status; } - Engine& _engine; - std::atomic _next; - SharedPtr _request_client; - int32_t _request_id; - FrameTime _time; - Status _status; - std::string _err_subject; + Engine& _engine; + std::atomic _next; + SPtr _request_client; + int32_t _request_id; + FrameTime _time; + Status _status; + std::string _err_subject; }; } // namespace Server diff --git a/src/server/EventWriter.hpp b/src/server/EventWriter.hpp index 68f93cbd..6d0fd2d2 100644 --- a/src/server/EventWriter.hpp +++ b/src/server/EventWriter.hpp @@ -23,7 +23,7 @@ #include "ingen/Interface.hpp" #include "ingen/Resource.hpp" -#include "raul/SharedPtr.hpp" +#include "ingen/types.hpp" #include "types.hpp" @@ -42,11 +42,11 @@ public: Raul::URI uri() const { return Raul::URI("ingen:/clients/event_writer"); } - virtual SharedPtr respondee() const { + virtual SPtr respondee() const { return _respondee; } - virtual void set_respondee(SharedPtr respondee) { + virtual void set_respondee(SPtr respondee) { _respondee = respondee; } @@ -89,9 +89,9 @@ public: virtual void error(const std::string& msg) {} ///< N/A protected: - Engine& _engine; - SharedPtr _respondee; - int32_t _request_id; + Engine& _engine; + SPtr _respondee; + int32_t _request_id; private: SampleCount now() const; diff --git a/src/server/GraphImpl.cpp b/src/server/GraphImpl.cpp index 14af654c..081b5b16 100644 --- a/src/server/GraphImpl.cpp +++ b/src/server/GraphImpl.cpp @@ -198,7 +198,7 @@ GraphImpl::remove_block(BlockImpl& block) } void -GraphImpl::add_arc(SharedPtr a) +GraphImpl::add_arc(SPtr a) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); _arcs.insert(make_pair(make_pair(a->tail(), a->head()), a)); @@ -207,17 +207,17 @@ GraphImpl::add_arc(SharedPtr a) /** Remove an arc. * Preprocessing thread only. */ -SharedPtr +SPtr GraphImpl::remove_arc(const PortImpl* tail, const PortImpl* dst_port) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); Arcs::iterator i = _arcs.find(make_pair(tail, dst_port)); if (i != _arcs.end()) { - SharedPtr arc = PtrCast(i->second); + SPtr arc = dynamic_ptr_cast(i->second); _arcs.erase(i); return arc; } else { - return SharedPtr(); + return SPtr(); } } diff --git a/src/server/GraphImpl.hpp b/src/server/GraphImpl.hpp index 450318ba..b6f3cf73 100644 --- a/src/server/GraphImpl.hpp +++ b/src/server/GraphImpl.hpp @@ -128,10 +128,10 @@ public: void remove_port(DuplexPort& port); void clear_ports(); - void add_arc(SharedPtr arc); + void add_arc(SPtr arc); - SharedPtr remove_arc(const PortImpl* tail, - const PortImpl* head); + SPtr remove_arc(const PortImpl* tail, + const PortImpl* head); bool has_arc(const PortImpl* tail, const PortImpl* head) const; diff --git a/src/server/InputPort.hpp b/src/server/InputPort.hpp index faf323f0..1f82425e 100644 --- a/src/server/InputPort.hpp +++ b/src/server/InputPort.hpp @@ -22,7 +22,7 @@ #include -#include "raul/SharedPtr.hpp" +#include "ingen/types.hpp" #include "ArcImpl.hpp" #include "PortImpl.hpp" diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp index 33d11e92..20abb787 100644 --- a/src/server/JackDriver.cpp +++ b/src/server/JackDriver.cpp @@ -473,9 +473,9 @@ JackDriver::_session_cb(jack_session_event_t* event) % jack_get_client_name(_client) % event->client_uuid).str(); - SharedPtr serialiser = _engine.world()->serialiser(); + SPtr serialiser = _engine.world()->serialiser(); if (serialiser) { - SharedPtr root(_engine.root_graph(), NullDeleter); + SPtr root(_engine.root_graph(), NullDeleter); serialiser->write_bundle(root, string("file://") + event->session_dir); } diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp index e334c1f9..1d05137b 100644 --- a/src/server/LV2Block.cpp +++ b/src/server/LV2Block.cpp @@ -69,7 +69,7 @@ LV2Block::~LV2Block() delete _instances; } -SharedPtr +SPtr LV2Block::make_instance(URIs& uris, SampleRate rate, uint32_t voice, @@ -82,7 +82,7 @@ LV2Block::make_instance(URIs& uris, parent_graph()->engine().log().error( Raul::fmt("Failed to instantiate <%1%>\n") % _lv2_plugin->uri().c_str()); - return SharedPtr(); + return SPtr(); } const LV2_Options_Interface* options_iface = (const LV2_Options_Interface*) @@ -134,7 +134,7 @@ LV2Block::make_instance(URIs& uris, parent_graph()->engine().log().error( Raul::fmt("%1% auto-morphed to unknown type %2%\n") % port->path().c_str() % type); - return SharedPtr(); + return SPtr(); } } else { parent_graph()->engine().log().error( @@ -145,7 +145,7 @@ LV2Block::make_instance(URIs& uris, } } - return SharedPtr(inst, lilv_instance_free); + return SPtr(inst, lilv_instance_free); } bool @@ -161,9 +161,9 @@ LV2Block::prepare_poly(BufferFactory& bufs, uint32_t poly) const SampleRate rate = bufs.engine().driver()->sample_rate(); assert(!_prepared_instances); - _prepared_instances = new Instances(poly, *_instances, SharedPtr()); + _prepared_instances = new Instances(poly, *_instances, SPtr()); for (uint32_t i = _polyphony; i < _prepared_instances->size(); ++i) { - SharedPtr inst = make_instance(bufs.uris(), rate, i, true); + SPtr inst = make_instance(bufs.uris(), rate, i, true); if (!inst) { return false; } @@ -206,7 +206,7 @@ bool LV2Block::instantiate(BufferFactory& bufs) { const Ingen::URIs& uris = bufs.uris(); - SharedPtr info = _lv2_plugin->lv2_info(); + SPtr info = _lv2_plugin->lv2_info(); const LilvPlugin* plug = _lv2_plugin->lilv_plugin(); Ingen::Forge& forge = bufs.forge(); const uint32_t num_ports = lilv_plugin_get_num_ports(plug); @@ -401,7 +401,7 @@ LV2Block::instantiate(BufferFactory& bufs) // Actually create plugin instances and port buffers. const SampleRate rate = bufs.engine().driver()->sample_rate(); - _instances = new Instances(_polyphony, SharedPtr()); + _instances = new Instances(_polyphony, SPtr()); for (uint32_t i = 0; i < _polyphony; ++i) { _instances->at(i) = make_instance(bufs.uris(), rate, i, false); if (!_instances->at(i)) { diff --git a/src/server/LV2Block.hpp b/src/server/LV2Block.hpp index 2e45d350..a9cf0afc 100644 --- a/src/server/LV2Block.hpp +++ b/src/server/LV2Block.hpp @@ -19,7 +19,7 @@ #include "lilv/lilv.h" #include "lv2/lv2plug.in/ns/ext/worker/worker.h" -#include "raul/Disposable.hpp" +#include "raul/Maid.hpp" #include "BufferRef.hpp" #include "BlockImpl.hpp" @@ -63,18 +63,18 @@ public: BufferRef buf); protected: - SharedPtr make_instance(URIs& uris, - SampleRate rate, - uint32_t voice, - bool preparing); + SPtr make_instance(URIs& uris, + SampleRate rate, + uint32_t voice, + bool preparing); inline LilvInstance* instance(uint32_t voice) { return (LilvInstance*)(*_instances)[voice].get(); } - typedef Raul::Array< SharedPtr > Instances; + typedef Raul::Array< SPtr > Instances; - struct Response : public Raul::Disposable + struct Response : public Raul::Maid::Disposable , public Raul::Noncopyable , public boost::intrusive::slist_base_hook<> { @@ -101,12 +101,12 @@ protected: static LV2_Worker_Status work_respond( LV2_Worker_Respond_Handle handle, uint32_t size, const void* data); - LV2Plugin* _lv2_plugin; - Instances* _instances; - Instances* _prepared_instances; - const LV2_Worker_Interface* _worker_iface; - Responses _responses; - SharedPtr _features; + LV2Plugin* _lv2_plugin; + Instances* _instances; + Instances* _prepared_instances; + const LV2_Worker_Interface* _worker_iface; + Responses _responses; + SPtr _features; }; } // namespace Server diff --git a/src/server/LV2Info.cpp b/src/server/LV2Info.cpp index 841ee0fd..1e4b2aec 100644 --- a/src/server/LV2Info.cpp +++ b/src/server/LV2Info.cpp @@ -51,7 +51,7 @@ LV2Info::LV2Info(Ingen::World* world) , _world(world) { world->lv2_features().add_feature( - SharedPtr(new ResizeFeature())); + SPtr(new ResizeFeature())); } LV2Info::~LV2Info() diff --git a/src/server/LV2Options.hpp b/src/server/LV2Options.hpp index 19ddfd4b..cc42d68c 100644 --- a/src/server/LV2Options.hpp +++ b/src/server/LV2Options.hpp @@ -51,10 +51,10 @@ struct LV2Options : public Ingen::LV2Features::Feature { const char* uri() const { return LV2_OPTIONS__options; } - SharedPtr feature(World* w, Node* n) { + SPtr feature(World* w, Node* n) { BlockImpl* block = dynamic_cast(n); if (!block) { - return SharedPtr(); + return SPtr(); } Engine& engine = block->parent_graph()->engine(); URIs& uris = engine.world()->uris(); @@ -72,7 +72,7 @@ struct LV2Options : public Ingen::LV2Features::Feature { f->URI = LV2_OPTIONS__options; f->data = malloc(sizeof(options)); memcpy(f->data, options, sizeof(options)); - return SharedPtr(f, &delete_feature); + return SPtr(f, &delete_feature); } private: diff --git a/src/server/LV2Plugin.cpp b/src/server/LV2Plugin.cpp index cc0aee4c..22e7e9c4 100644 --- a/src/server/LV2Plugin.cpp +++ b/src/server/LV2Plugin.cpp @@ -28,7 +28,7 @@ using namespace std; namespace Ingen { namespace Server { -LV2Plugin::LV2Plugin(SharedPtr lv2_info, const Raul::URI& uri) +LV2Plugin::LV2Plugin(SPtr lv2_info, const Raul::URI& uri) : PluginImpl(lv2_info->world().uris(), Plugin::LV2, uri) , _lilv_plugin(NULL) , _lv2_info(lv2_info) diff --git a/src/server/LV2Plugin.hpp b/src/server/LV2Plugin.hpp index bec1b588..1bd4822a 100644 --- a/src/server/LV2Plugin.hpp +++ b/src/server/LV2Plugin.hpp @@ -19,8 +19,8 @@ #include +#include "ingen/types.hpp" #include "lilv/lilv.h" -#include "raul/SharedPtr.hpp" #include "raul/URI.hpp" #include "PluginImpl.hpp" @@ -37,7 +37,7 @@ class BlockImpl; class LV2Plugin : public PluginImpl { public: - LV2Plugin(SharedPtr lv2_info, const Raul::URI& uri); + LV2Plugin(SPtr lv2_info, const Raul::URI& uri); BlockImpl* instantiate(BufferFactory& bufs, const Raul::Symbol& symbol, @@ -47,14 +47,14 @@ public: const Raul::Symbol symbol() const; - SharedPtr lv2_info() const { return _lv2_info; } + SPtr lv2_info() const { return _lv2_info; } const LilvPlugin* lilv_plugin() const { return _lilv_plugin; } void lilv_plugin(const LilvPlugin* p); private: - const LilvPlugin* _lilv_plugin; - SharedPtr _lv2_info; + const LilvPlugin* _lilv_plugin; + SPtr _lv2_info; }; } // namespace Server diff --git a/src/server/LV2ResizeFeature.hpp b/src/server/LV2ResizeFeature.hpp index aeabe47a..6712c74b 100644 --- a/src/server/LV2ResizeFeature.hpp +++ b/src/server/LV2ResizeFeature.hpp @@ -49,10 +49,10 @@ struct ResizeFeature : public Ingen::LV2Features::Feature { const char* uri() const { return LV2_RESIZE_PORT_URI; } - SharedPtr feature(World* w, Node* n) { + SPtr feature(World* w, Node* n) { BlockImpl* block = dynamic_cast(n); if (!block) - return SharedPtr(); + return SPtr(); LV2_Resize_Port_Resize* data = (LV2_Resize_Port_Resize*)malloc(sizeof(LV2_Resize_Port_Resize)); data->data = block; @@ -60,7 +60,7 @@ struct ResizeFeature : public Ingen::LV2Features::Feature { LV2_Feature* f = (LV2_Feature*)malloc(sizeof(LV2_Feature)); f->URI = LV2_RESIZE_PORT_URI; f->data = data; - return SharedPtr(f, &delete_feature); + return SPtr(f, &delete_feature); } }; diff --git a/src/server/NodeImpl.hpp b/src/server/NodeImpl.hpp index 937d4dea..60aa2d3d 100644 --- a/src/server/NodeImpl.hpp +++ b/src/server/NodeImpl.hpp @@ -25,7 +25,6 @@ #include "ingen/Resource.hpp" #include "raul/Deletable.hpp" #include "raul/Path.hpp" -#include "raul/SharedPtr.hpp" namespace Raul { class Maid; } diff --git a/src/server/Worker.cpp b/src/server/Worker.cpp index 5bf20609..8afc8a20 100644 --- a/src/server/Worker.cpp +++ b/src/server/Worker.cpp @@ -79,12 +79,12 @@ delete_feature(LV2_Feature* feature) free(feature); } -SharedPtr +SPtr Worker::Schedule::feature(World* world, Node* n) { LV2Block* block = dynamic_cast(n); if (!block) { - return SharedPtr(); + return SPtr(); } LV2_Worker_Schedule* data = (LV2_Worker_Schedule*)malloc( @@ -96,7 +96,7 @@ Worker::Schedule::feature(World* world, Node* n) f->URI = LV2_WORKER__schedule; f->data = data; - return SharedPtr(f, &delete_feature); + return SPtr(f, &delete_feature); } diff --git a/src/server/Worker.hpp b/src/server/Worker.hpp index 69597439..b90e117e 100644 --- a/src/server/Worker.hpp +++ b/src/server/Worker.hpp @@ -40,17 +40,17 @@ public: struct Schedule : public LV2Features::Feature { const char* uri() const { return LV2_WORKER__schedule; } - SharedPtr feature(World* world, Node* n); + SPtr feature(World* world, Node* n); }; LV2_Worker_Status request(LV2Block* block, uint32_t size, const void* data); - SharedPtr schedule_feature() { return _schedule; } + SPtr schedule_feature() { return _schedule; } private: - SharedPtr _schedule; + SPtr _schedule; Log& _log; Raul::Semaphore _sem; diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index cbdb67c5..4c4a3974 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -34,12 +34,12 @@ namespace Ingen { namespace Server { namespace Events { -Connect::Connect(Engine& engine, - SharedPtr client, - int32_t id, - SampleCount timestamp, - const Raul::Path& tail_path, - const Raul::Path& head_path) +Connect::Connect(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::Path& tail_path, + const Raul::Path& head_path) : Event(engine, client, id, timestamp) , _tail_path(tail_path) , _head_path(head_path) @@ -106,7 +106,7 @@ Connect::pre_process() return Event::pre_process_done(Status::EXISTS, _head_path); } - _arc = SharedPtr(new ArcImpl(tail_output, _head)); + _arc = SPtr(new ArcImpl(tail_output, _head)); rlock.release(); diff --git a/src/server/events/Connect.hpp b/src/server/events/Connect.hpp index a84b9fcf..4b515087 100644 --- a/src/server/events/Connect.hpp +++ b/src/server/events/Connect.hpp @@ -45,12 +45,12 @@ namespace Events { class Connect : public Event { public: - Connect(Engine& engine, - SharedPtr client, - int32_t id, - SampleCount timestamp, - const Raul::Path& tail, - const Raul::Path& head); + Connect(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::Path& tail, + const Raul::Path& head); bool pre_process(); void execute(ProcessContext& context); @@ -62,7 +62,7 @@ private: GraphImpl* _graph; InputPort* _head; CompiledGraph* _compiled_graph; - SharedPtr _arc; + SPtr _arc; Raul::Array* _buffers; }; diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp index 90a76c1d..63b05b58 100644 --- a/src/server/events/CreateBlock.cpp +++ b/src/server/events/CreateBlock.cpp @@ -33,7 +33,7 @@ namespace Server { namespace Events { CreateBlock::CreateBlock(Engine& engine, - SharedPtr client, + SPtr client, int32_t id, SampleCount timestamp, const Raul::Path& path, diff --git a/src/server/events/CreateBlock.hpp b/src/server/events/CreateBlock.hpp index 4b706e53..36e35775 100644 --- a/src/server/events/CreateBlock.hpp +++ b/src/server/events/CreateBlock.hpp @@ -41,7 +41,7 @@ class CreateBlock : public Event { public: CreateBlock(Engine& engine, - SharedPtr client, + SPtr client, int32_t id, SampleCount timestamp, const Raul::Path& block_path, diff --git a/src/server/events/CreateGraph.cpp b/src/server/events/CreateGraph.cpp index f2131246..8ab05a2e 100644 --- a/src/server/events/CreateGraph.cpp +++ b/src/server/events/CreateGraph.cpp @@ -30,7 +30,7 @@ namespace Server { namespace Events { CreateGraph::CreateGraph(Engine& engine, - SharedPtr client, + SPtr client, int32_t id, SampleCount timestamp, const Raul::Path& path, diff --git a/src/server/events/CreateGraph.hpp b/src/server/events/CreateGraph.hpp index 0f6a95dd..64fb92bd 100644 --- a/src/server/events/CreateGraph.hpp +++ b/src/server/events/CreateGraph.hpp @@ -36,7 +36,7 @@ class CreateGraph : public Event { public: CreateGraph(Engine& engine, - SharedPtr client, + SPtr client, int32_t id, SampleCount timestamp, const Raul::Path& path, diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp index 818b0438..2e3e4d42 100644 --- a/src/server/events/CreatePort.cpp +++ b/src/server/events/CreatePort.cpp @@ -37,7 +37,7 @@ namespace Server { namespace Events { CreatePort::CreatePort(Engine& engine, - SharedPtr client, + SPtr client, int32_t id, SampleCount timestamp, const Raul::Path& path, diff --git a/src/server/events/CreatePort.hpp b/src/server/events/CreatePort.hpp index d35b58af..d5e2b29c 100644 --- a/src/server/events/CreatePort.hpp +++ b/src/server/events/CreatePort.hpp @@ -43,7 +43,7 @@ class CreatePort : public Event { public: CreatePort(Engine& engine, - SharedPtr client, + SPtr client, int32_t id, SampleCount timestamp, const Raul::Path& path, diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp index bcfb209a..f21e0faf 100644 --- a/src/server/events/Delete.cpp +++ b/src/server/events/Delete.cpp @@ -34,11 +34,11 @@ namespace Ingen { namespace Server { namespace Events { -Delete::Delete(Engine& engine, - SharedPtr client, - int32_t id, - FrameTime time, - const Raul::URI& uri) +Delete::Delete(Engine& engine, + SPtr client, + int32_t id, + FrameTime time, + const Raul::URI& uri) : Event(engine, client, id, time) , _uri(uri) , _engine_port(NULL) @@ -73,8 +73,8 @@ Delete::pre_process() return Event::pre_process_done(Status::NOT_FOUND, _path); } - if (!(_block = PtrCast(iter->second))) { - _port = PtrCast(iter->second); + if (!(_block = dynamic_ptr_cast(iter->second))) { + _port = dynamic_ptr_cast(iter->second); } if (!_block && !_port) { diff --git a/src/server/events/Delete.hpp b/src/server/events/Delete.hpp index 74046f82..3cf9a2dc 100644 --- a/src/server/events/Delete.hpp +++ b/src/server/events/Delete.hpp @@ -57,11 +57,11 @@ class DisconnectAll; class Delete : public Event { public: - Delete(Engine& engine, - SharedPtr client, - int32_t id, - FrameTime timestamp, - const Raul::URI& uri); + Delete(Engine& engine, + SPtr client, + int32_t id, + FrameTime timestamp, + const Raul::URI& uri); ~Delete(); @@ -70,17 +70,17 @@ public: void post_process(); private: - Raul::URI _uri; - Raul::Path _path; - SharedPtr _block; ///< Non-NULL iff a block - SharedPtr _port; ///< Non-NULL iff a port - EnginePort* _engine_port; - Raul::Array* _ports_array; ///< New (external) ports for Graph - CompiledGraph* _compiled_graph; ///< Graph's new process order - DisconnectAll* _disconnect_event; - - SharedPtr _removed_bindings; - Store::Objects _removed_objects; + Raul::URI _uri; + Raul::Path _path; + SPtr _block; ///< Non-NULL iff a block + SPtr _port; ///< Non-NULL iff a port + EnginePort* _engine_port; + Raul::Array* _ports_array; ///< New (external) ports for Graph + CompiledGraph* _compiled_graph; ///< Graph's new process order + DisconnectAll* _disconnect_event; + + SPtr _removed_bindings; + Store::Objects _removed_objects; Glib::RWLock::WriterLock _lock; }; diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index 352aa56c..c7836ebd 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -44,15 +44,15 @@ namespace Events { typedef Resource::Properties Properties; -Delta::Delta(Engine& engine, - SharedPtr client, - int32_t id, - SampleCount timestamp, - bool create, - Resource::Graph context, - const Raul::URI& subject, - const Properties& properties, - const Properties& remove) +Delta::Delta(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + bool create, + Resource::Graph context, + const Raul::URI& subject, + const Properties& properties, + const Properties& remove) : Event(engine, client, id, timestamp) , _create_event(NULL) , _subject(subject) diff --git a/src/server/events/Delta.hpp b/src/server/events/Delta.hpp index 34319591..7e3f5257 100644 --- a/src/server/events/Delta.hpp +++ b/src/server/events/Delta.hpp @@ -70,7 +70,7 @@ class Delta : public Event { public: Delta(Engine& engine, - SharedPtr client, + SPtr client, int32_t id, SampleCount timestamp, bool create, @@ -111,7 +111,7 @@ private: ControlBindings::Key _binding; bool _create; - SharedPtr _old_bindings; + SPtr _old_bindings; }; } // namespace Events diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp index 874e0d99..a7f31316 100644 --- a/src/server/events/Disconnect.cpp +++ b/src/server/events/Disconnect.cpp @@ -39,12 +39,12 @@ namespace Ingen { namespace Server { namespace Events { -Disconnect::Disconnect(Engine& engine, - SharedPtr client, - int32_t id, - SampleCount timestamp, - const Raul::Path& tail_path, - const Raul::Path& head_path) +Disconnect::Disconnect(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::Path& tail_path, + const Raul::Path& head_path) : Event(engine, client, id, timestamp) , _tail_path(tail_path) , _head_path(head_path) diff --git a/src/server/events/Disconnect.hpp b/src/server/events/Disconnect.hpp index b0c9408c..58efba9f 100644 --- a/src/server/events/Disconnect.hpp +++ b/src/server/events/Disconnect.hpp @@ -45,12 +45,12 @@ namespace Events { class Disconnect : public Event { public: - Disconnect(Engine& engine, - SharedPtr client, - int32_t id, - SampleCount timestamp, - const Raul::Path& tail_path, - const Raul::Path& head_path); + Disconnect(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::Path& tail_path, + const Raul::Path& head_path); bool pre_process(); void execute(ProcessContext& context); @@ -72,7 +72,7 @@ public: OutputPort* _src_output_port; InputPort* _dst_input_port; GraphImpl* _graph; - SharedPtr _arc; + SPtr _arc; Raul::Array* _buffers; }; diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp index a3df4e77..c366508b 100644 --- a/src/server/events/DisconnectAll.cpp +++ b/src/server/events/DisconnectAll.cpp @@ -40,12 +40,12 @@ namespace Ingen { namespace Server { namespace Events { -DisconnectAll::DisconnectAll(Engine& engine, - SharedPtr client, - int32_t id, - SampleCount timestamp, - const Raul::Path& parent_path, - const Raul::Path& path) +DisconnectAll::DisconnectAll(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::Path& parent_path, + const Raul::Path& path) : Event(engine, client, id, timestamp) , _parent_path(parent_path) , _path(path) diff --git a/src/server/events/DisconnectAll.hpp b/src/server/events/DisconnectAll.hpp index 7db53bfa..43c3ec2b 100644 --- a/src/server/events/DisconnectAll.hpp +++ b/src/server/events/DisconnectAll.hpp @@ -43,12 +43,12 @@ class Disconnect; class DisconnectAll : public Event { public: - DisconnectAll(Engine& engine, - SharedPtr client, - int32_t id, - SampleCount timestamp, - const Raul::Path& parent, - const Raul::Path& object); + DisconnectAll(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::Path& parent, + const Raul::Path& object); DisconnectAll(Engine& engine, GraphImpl* parent, diff --git a/src/server/events/Get.cpp b/src/server/events/Get.cpp index f16654f7..9a5dd1fa 100644 --- a/src/server/events/Get.cpp +++ b/src/server/events/Get.cpp @@ -37,11 +37,11 @@ namespace Events { static void send_graph(Interface* client, const GraphImpl* graph); -Get::Get(Engine& engine, - SharedPtr client, - int32_t id, - SampleCount timestamp, - const Raul::URI& uri) +Get::Get(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::URI& uri) : Event(engine, client, id, timestamp) , _uri(uri) , _object(NULL) diff --git a/src/server/events/Get.hpp b/src/server/events/Get.hpp index 12f48b09..7a5830a3 100644 --- a/src/server/events/Get.hpp +++ b/src/server/events/Get.hpp @@ -37,11 +37,11 @@ namespace Events { class Get : public Event { public: - Get(Engine& engine, - SharedPtr client, - int32_t id, - SampleCount timestamp, - const Raul::URI& uri); + Get(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::URI& uri); bool pre_process(); void execute(ProcessContext& context) {} diff --git a/src/server/events/Move.cpp b/src/server/events/Move.cpp index 700d5814..44939525 100644 --- a/src/server/events/Move.cpp +++ b/src/server/events/Move.cpp @@ -31,12 +31,12 @@ namespace Ingen { namespace Server { namespace Events { -Move::Move(Engine& engine, - SharedPtr client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - const Raul::Path& new_path) +Move::Move(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + const Raul::Path& new_path) : Event(engine, client, id, timestamp) , _old_path(path) , _new_path(new_path) diff --git a/src/server/events/Move.hpp b/src/server/events/Move.hpp index 6e30cba6..666ad7bd 100644 --- a/src/server/events/Move.hpp +++ b/src/server/events/Move.hpp @@ -46,12 +46,12 @@ namespace Events { class Move : public Event { public: - Move(Engine& engine, - SharedPtr client, - int32_t id, - SampleCount timestamp, - const Raul::Path& old_path, - const Raul::Path& new_path); + Move(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + const Raul::Path& old_path, + const Raul::Path& new_path); ~Move(); diff --git a/src/server/events/SetPortValue.cpp b/src/server/events/SetPortValue.cpp index f2399d8e..edef9e8c 100644 --- a/src/server/events/SetPortValue.cpp +++ b/src/server/events/SetPortValue.cpp @@ -34,12 +34,12 @@ namespace Server { namespace Events { /** Internal */ -SetPortValue::SetPortValue(Engine& engine, - SharedPtr client, - int32_t id, - SampleCount timestamp, - PortImpl* port, - const Raul::Atom& value) +SetPortValue::SetPortValue(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + PortImpl* port, + const Raul::Atom& value) : Event(engine, client, id, timestamp) , _port(port) , _value(value) diff --git a/src/server/events/SetPortValue.hpp b/src/server/events/SetPortValue.hpp index a82553f5..32e8f768 100644 --- a/src/server/events/SetPortValue.hpp +++ b/src/server/events/SetPortValue.hpp @@ -37,12 +37,12 @@ namespace Events { class SetPortValue : public Event { public: - SetPortValue(Engine& engine, - SharedPtr client, - int32_t id, - SampleCount timestamp, - PortImpl* port, - const Raul::Atom& value); + SetPortValue(Engine& engine, + SPtr client, + int32_t id, + SampleCount timestamp, + PortImpl* port, + const Raul::Atom& value); ~SetPortValue(); diff --git a/src/server/ingen_engine.cpp b/src/server/ingen_engine.cpp index b020e28b..cd470f44 100644 --- a/src/server/ingen_engine.cpp +++ b/src/server/ingen_engine.cpp @@ -25,10 +25,11 @@ using namespace Ingen; struct IngenEngineModule : public Ingen::Module { virtual void load(Ingen::World* world) { Server::set_denormal_flags(world->log()); - SharedPtr engine(new Server::Engine(world)); + SPtr engine(new Server::Engine(world)); world->set_engine(engine); if (!world->interface()) { - world->set_interface(SharedPtr(engine->interface(), NullDeleter)); + world->set_interface( + SPtr(engine->interface(), NullDeleter)); } } }; diff --git a/src/server/ingen_jack.cpp b/src/server/ingen_jack.cpp index f273a209..9ebb0481 100644 --- a/src/server/ingen_jack.cpp +++ b/src/server/ingen_jack.cpp @@ -44,7 +44,7 @@ struct IngenJackModule : public Ingen::Module { world->conf().option("jack-name").get_string(), NULL); ((Server::Engine*)world->engine().get())->set_driver( - SharedPtr(driver)); + SPtr(driver)); } }; diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index e866ea0e..e6fab92a 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -42,8 +42,8 @@ #include "ingen/runtime_paths.hpp" #include "ingen/serialisation/Parser.hpp" #include "ingen/serialisation/Serialiser.hpp" +#include "ingen/types.hpp" #include "raul/Semaphore.hpp" -#include "raul/SharedPtr.hpp" #include "raul/Thread.hpp" #include "Buffer.hpp" @@ -74,7 +74,7 @@ class Lib { public: explicit Lib(const char* bundle_path); - typedef std::vector< SharedPtr > Graphs; + typedef std::vector< Ingen::SPtr > Graphs; Graphs graphs; }; @@ -401,8 +401,8 @@ using namespace Ingen::Server; class MainThread : public Raul::Thread { public: - explicit MainThread(SharedPtr engine, - LV2Driver* driver) + explicit MainThread(SPtr engine, + LV2Driver* driver) : Raul::Thread() , _engine(engine) , _driver(driver) @@ -424,8 +424,8 @@ private: } } - SharedPtr _engine; - LV2Driver* _driver; + SPtr _engine; + LV2Driver* _driver; }; struct IngenPlugin { @@ -466,8 +466,9 @@ find_graphs(const Glib::ustring& manifest_uri) if (!f.end()) { const uint8_t* file_uri = f.get_object().to_u_string(); uint8_t* file_path = serd_file_uri_parse(file_uri, NULL); - graphs.push_back(boost::shared_ptr( - new LV2Graph(graph_uri, (const char*)file_path))); + graphs.push_back( + SPtr( + new LV2Graph(graph_uri, (const char*)file_path))); free(file_path); } } @@ -568,11 +569,11 @@ ingen_instantiate(const LV2_Descriptor* descriptor, "queue-size", plugin->world->forge().make(std::max(block_length, seq_size) * 4)); - SharedPtr engine(new Server::Engine(plugin->world)); + SPtr engine(new Server::Engine(plugin->world)); plugin->world->set_engine(engine); - SharedPtr interface = - SharedPtr(engine->interface(), NullDeleter); + SPtr interface = SPtr(engine->interface(), + NullDeleter); plugin->world->set_interface(interface); @@ -580,7 +581,7 @@ ingen_instantiate(const LV2_Descriptor* descriptor, Server::ThreadManager::single_threaded = true; LV2Driver* driver = new LV2Driver(*engine.get(), block_length, rate); - engine->set_driver(SharedPtr(driver)); + engine->set_driver(SPtr(driver)); plugin->main = new MainThread(engine, driver); @@ -604,7 +605,7 @@ ingen_instantiate(const LV2_Descriptor* descriptor, /* Register client after loading graph so the to-ui ring does not overflow. Since we are not yet rolling, it won't be drained, causing a deadlock. */ - SharedPtr client(&driver->writer(), NullDeleter); + SPtr client(&driver->writer(), NullDeleter); interface->set_respondee(client); engine->register_client(Raul::URI("ingen:/clients/lv2"), client); @@ -660,8 +661,8 @@ static void ingen_cleanup(LV2_Handle instance) { IngenPlugin* me = (IngenPlugin*)instance; - me->world->set_engine(SharedPtr()); - me->world->set_interface(SharedPtr()); + me->world->set_engine(SPtr()); + me->world->set_interface(SPtr()); delete me->world; delete me; } -- cgit v1.2.1