diff options
author | David Robillard <d@drobilla.net> | 2013-01-12 23:38:03 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-01-12 23:38:03 +0000 |
commit | df1447c665e6c3631961297a9d3e9aff4e94c47f (patch) | |
tree | c0ff117c362e6d571f430f886ab62f372b59af08 /src/server | |
parent | bb335dca695273622b7a4ebbefbe9e089edb9ab4 (diff) | |
download | ingen-df1447c665e6c3631961297a9d3e9aff4e94c47f.tar.gz ingen-df1447c665e6c3631961297a9d3e9aff4e94c47f.tar.bz2 ingen-df1447c665e6c3631961297a9d3e9aff4e94c47f.zip |
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
Diffstat (limited to 'src/server')
52 files changed, 264 insertions, 264 deletions
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<LilvNode> > Types; + typedef std::vector< SPtr<LilvNode> > 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<LilvNode>( - lilv_new_uri(_world->lilv_world(), uri.c_str()), - lilv_node_free)); + types.push_back( + SPtr<LilvNode>(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 <map> #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<LV2Info> _lv2_info; - bool _has_loaded; + Plugins _plugins; + Ingen::World* _world; + SPtr<LV2Info> _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<Interface> client) +Broadcaster::register_client(const Raul::URI& uri, + SPtr<Interface> 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<Interface> +SPtr<Interface> 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<Interface>(); + return SPtr<Interface>(); } } 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 <glibmm/thread.h> -#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<Interface> client); + void register_client(const Raul::URI& uri, SPtr<Interface> 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<Interface> client(const Raul::URI& uri); + SPtr<Interface> 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<Interface> > Clients; + typedef std::map< Raul::URI, SPtr<Interface> > 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 <boost/utility.hpp> +#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 <glibmm/thread.h> -#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 <vector> #include <list> -#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<CompiledBlock> - , 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<ControlBindings::Bindings> +SPtr<ControlBindings::Bindings> ControlBindings::remove(const Raul::Path& path) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); - SharedPtr<Bindings> old_bindings(_bindings); - SharedPtr<Bindings> copy(new Bindings(*_bindings.get())); + SPtr<Bindings> old_bindings(_bindings); + SPtr<Bindings> 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<ControlBindings::Bindings> +SPtr<ControlBindings::Bindings> ControlBindings::remove(PortImpl* port) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); - SharedPtr<Bindings> old_bindings(_bindings); - SharedPtr<Bindings> copy(new Bindings(*_bindings.get())); + SPtr<Bindings> old_bindings(_bindings); + SPtr<Bindings> 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 = _bindings; + uint16_t value = 0; + SPtr<Bindings> 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 <map> #include <stdint.h> +#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<Bindings> remove(const Raul::Path& path); + SPtr<Bindings> 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<Bindings> remove(PortImpl* port); + SPtr<Bindings> 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> _bindings; - BufferRef _feedback; - LV2_Atom_Forge _forge; + Engine& _engine; + PortImpl* _learn_port; + SPtr<Bindings> _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<Ingen::Store>(new Store())); + world->set_store(SPtr<Ingen::Store>(new Store())); } _control_bindings = new ControlBindings(*this); @@ -82,16 +82,16 @@ Engine::~Engine() _root_graph = NULL; deactivate(); - const SharedPtr<Store> store = this->store(); + const SPtr<Store> store = this->store(); if (store) { for (auto& s : *store.get()) { - if (!PtrCast<NodeImpl>(s.second)->parent()) { + if (!dynamic_ptr_cast<NodeImpl>(s.second)->parent()) { s.second.reset(); } } } - _world->set_store(SharedPtr<Ingen::Store>()); + _world->set_store(SPtr<Ingen::Store>()); delete _maid; delete _pre_processor; @@ -109,7 +109,7 @@ Engine::~Engine() munlockall(); } -SharedPtr<Store> +SPtr<Store> Engine::store() const { return _world->store(); @@ -136,7 +136,7 @@ Engine::main_iteration() } void -Engine::set_driver(SharedPtr<Driver> driver) +Engine::set_driver(SPtr<Driver> 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<Driver>(new DirectDriver(sample_rate, block_length))); + set_driver(SPtr<Driver>(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<Interface> respondee; + SPtr<Interface> 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<Interface> client) +Engine::register_client(const Raul::URI& uri, SPtr<Interface> 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<Interface> client); + SPtr<Interface> client); virtual bool unregister_client(const Raul::URI& uri); - void set_driver(SharedPtr<Driver> driver); + void set_driver(SPtr<Driver> driver); SampleCount event_time(); @@ -106,25 +106,25 @@ public: ProcessContext& process_context() { return _process_context; } - SharedPtr<Store> store() const; + SPtr<Store> 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> _driver; - EventWriter* _event_writer; - Raul::Maid* _maid; - SharedPtr<LV2Options> _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> _driver; + EventWriter* _event_writer; + Raul::Maid* _maid; + SPtr<LV2Options> _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<Interface> client, int32_t id, FrameTime time) + Event(Engine& engine, SPtr<Interface> client, int32_t id, FrameTime time) : _engine(engine) , _next(NULL) , _request_client(client) @@ -122,13 +122,13 @@ protected: return _status; } - Engine& _engine; - std::atomic<Event*> _next; - SharedPtr<Interface> _request_client; - int32_t _request_id; - FrameTime _time; - Status _status; - std::string _err_subject; + Engine& _engine; + std::atomic<Event*> _next; + SPtr<Interface> _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<Interface> respondee() const { + virtual SPtr<Interface> respondee() const { return _respondee; } - virtual void set_respondee(SharedPtr<Interface> respondee) { + virtual void set_respondee(SPtr<Interface> respondee) { _respondee = respondee; } @@ -89,9 +89,9 @@ public: virtual void error(const std::string& msg) {} ///< N/A protected: - Engine& _engine; - SharedPtr<Interface> _respondee; - int32_t _request_id; + Engine& _engine; + SPtr<Interface> _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<ArcImpl> a) +GraphImpl::add_arc(SPtr<ArcImpl> 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<ArcImpl> a) /** Remove an arc. * Preprocessing thread only. */ -SharedPtr<ArcImpl> +SPtr<ArcImpl> 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<ArcImpl> arc = PtrCast<ArcImpl>(i->second); + SPtr<ArcImpl> arc = dynamic_ptr_cast<ArcImpl>(i->second); _arcs.erase(i); return arc; } else { - return SharedPtr<ArcImpl>(); + return SPtr<ArcImpl>(); } } 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<ArcImpl> arc); + void add_arc(SPtr<ArcImpl> arc); - SharedPtr<ArcImpl> remove_arc(const PortImpl* tail, - const PortImpl* head); + SPtr<ArcImpl> 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 <boost/intrusive/slist.hpp> -#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<Serialisation::Serialiser> serialiser = _engine.world()->serialiser(); + SPtr<Serialisation::Serialiser> serialiser = _engine.world()->serialiser(); if (serialiser) { - SharedPtr<Node> root(_engine.root_graph(), NullDeleter<Node>); + SPtr<Node> root(_engine.root_graph(), NullDeleter<Node>); 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<LilvInstance> +SPtr<LilvInstance> 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<LilvInstance>(); + return SPtr<LilvInstance>(); } 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<LilvInstance>(); + return SPtr<LilvInstance>(); } } else { parent_graph()->engine().log().error( @@ -145,7 +145,7 @@ LV2Block::make_instance(URIs& uris, } } - return SharedPtr<LilvInstance>(inst, lilv_instance_free); + return SPtr<LilvInstance>(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<void>()); + _prepared_instances = new Instances(poly, *_instances, SPtr<void>()); for (uint32_t i = _polyphony; i < _prepared_instances->size(); ++i) { - SharedPtr<LilvInstance> inst = make_instance(bufs.uris(), rate, i, true); + SPtr<LilvInstance> 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<LV2Info> info = _lv2_plugin->lv2_info(); + SPtr<LV2Info> 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<void>()); + _instances = new Instances(_polyphony, SPtr<void>()); 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<LilvInstance> make_instance(URIs& uris, - SampleRate rate, - uint32_t voice, - bool preparing); + SPtr<LilvInstance> 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<void> > Instances; + typedef Raul::Array< SPtr<void> > 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<LV2Features::FeatureArray> _features; + LV2Plugin* _lv2_plugin; + Instances* _instances; + Instances* _prepared_instances; + const LV2_Worker_Interface* _worker_iface; + Responses _responses; + SPtr<LV2Features::FeatureArray> _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<LV2Features::Feature>(new ResizeFeature())); + SPtr<LV2Features::Feature>(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<LV2_Feature> feature(World* w, Node* n) { + SPtr<LV2_Feature> feature(World* w, Node* n) { BlockImpl* block = dynamic_cast<BlockImpl*>(n); if (!block) { - return SharedPtr<LV2_Feature>(); + return SPtr<LV2_Feature>(); } 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<LV2_Feature>(f, &delete_feature); + return SPtr<LV2_Feature>(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<LV2Info> lv2_info, const Raul::URI& uri) +LV2Plugin::LV2Plugin(SPtr<LV2Info> 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 <cstdlib> +#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<LV2Info> lv2_info, const Raul::URI& uri); + LV2Plugin(SPtr<LV2Info> 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<LV2Info> lv2_info() const { return _lv2_info; } + SPtr<LV2Info> 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<LV2Info> _lv2_info; + const LilvPlugin* _lilv_plugin; + SPtr<LV2Info> _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<LV2_Feature> feature(World* w, Node* n) { + SPtr<LV2_Feature> feature(World* w, Node* n) { BlockImpl* block = dynamic_cast<BlockImpl*>(n); if (!block) - return SharedPtr<LV2_Feature>(); + return SPtr<LV2_Feature>(); 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<LV2_Feature>(f, &delete_feature); + return SPtr<LV2_Feature>(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<LV2_Feature> +SPtr<LV2_Feature> Worker::Schedule::feature(World* world, Node* n) { LV2Block* block = dynamic_cast<LV2Block*>(n); if (!block) { - return SharedPtr<LV2_Feature>(); + return SPtr<LV2_Feature>(); } 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<LV2_Feature>(f, &delete_feature); + return SPtr<LV2_Feature>(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<LV2_Feature> feature(World* world, Node* n); + SPtr<LV2_Feature> feature(World* world, Node* n); }; LV2_Worker_Status request(LV2Block* block, uint32_t size, const void* data); - SharedPtr<Schedule> schedule_feature() { return _schedule; } + SPtr<Schedule> schedule_feature() { return _schedule; } private: - SharedPtr<Schedule> _schedule; + SPtr<Schedule> _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<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& tail_path, - const Raul::Path& head_path) +Connect::Connect(Engine& engine, + SPtr<Interface> 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<ArcImpl>(new ArcImpl(tail_output, _head)); + _arc = SPtr<ArcImpl>(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<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& tail, - const Raul::Path& head); + Connect(Engine& engine, + SPtr<Interface> 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<ArcImpl> _arc; + SPtr<ArcImpl> _arc; Raul::Array<BufferRef>* _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<Interface> client, + SPtr<Interface> 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<Interface> client, + SPtr<Interface> 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<Interface> client, + SPtr<Interface> 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<Interface> client, + SPtr<Interface> 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<Interface> client, + SPtr<Interface> 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<Interface> client, + SPtr<Interface> 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<Interface> client, - int32_t id, - FrameTime time, - const Raul::URI& uri) +Delete::Delete(Engine& engine, + SPtr<Interface> 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<BlockImpl>(iter->second))) { - _port = PtrCast<DuplexPort>(iter->second); + if (!(_block = dynamic_ptr_cast<BlockImpl>(iter->second))) { + _port = dynamic_ptr_cast<DuplexPort>(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<Interface> client, - int32_t id, - FrameTime timestamp, - const Raul::URI& uri); + Delete(Engine& engine, + SPtr<Interface> 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<BlockImpl> _block; ///< Non-NULL iff a block - SharedPtr<DuplexPort> _port; ///< Non-NULL iff a port - EnginePort* _engine_port; - Raul::Array<PortImpl*>* _ports_array; ///< New (external) ports for Graph - CompiledGraph* _compiled_graph; ///< Graph's new process order - DisconnectAll* _disconnect_event; - - SharedPtr<ControlBindings::Bindings> _removed_bindings; - Store::Objects _removed_objects; + Raul::URI _uri; + Raul::Path _path; + SPtr<BlockImpl> _block; ///< Non-NULL iff a block + SPtr<DuplexPort> _port; ///< Non-NULL iff a port + EnginePort* _engine_port; + Raul::Array<PortImpl*>* _ports_array; ///< New (external) ports for Graph + CompiledGraph* _compiled_graph; ///< Graph's new process order + DisconnectAll* _disconnect_event; + + SPtr<ControlBindings::Bindings> _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<Interface> 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<Interface> 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<Interface> client, + SPtr<Interface> client, int32_t id, SampleCount timestamp, bool create, @@ -111,7 +111,7 @@ private: ControlBindings::Key _binding; bool _create; - SharedPtr<ControlBindings::Bindings> _old_bindings; + SPtr<ControlBindings::Bindings> _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<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& tail_path, - const Raul::Path& head_path) +Disconnect::Disconnect(Engine& engine, + SPtr<Interface> 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<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& tail_path, - const Raul::Path& head_path); + Disconnect(Engine& engine, + SPtr<Interface> 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<ArcImpl> _arc; + SPtr<ArcImpl> _arc; Raul::Array<BufferRef>* _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<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& parent_path, - const Raul::Path& path) +DisconnectAll::DisconnectAll(Engine& engine, + SPtr<Interface> 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<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& parent, - const Raul::Path& object); + DisconnectAll(Engine& engine, + SPtr<Interface> 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<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::URI& uri) +Get::Get(Engine& engine, + SPtr<Interface> 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<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::URI& uri); + Get(Engine& engine, + SPtr<Interface> 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<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - const Raul::Path& new_path) +Move::Move(Engine& engine, + SPtr<Interface> 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<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& old_path, - const Raul::Path& new_path); + Move(Engine& engine, + SPtr<Interface> 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<Interface> client, - int32_t id, - SampleCount timestamp, - PortImpl* port, - const Raul::Atom& value) +SetPortValue::SetPortValue(Engine& engine, + SPtr<Interface> 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<Interface> client, - int32_t id, - SampleCount timestamp, - PortImpl* port, - const Raul::Atom& value); + SetPortValue(Engine& engine, + SPtr<Interface> 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<Server::Engine> engine(new Server::Engine(world)); + SPtr<Server::Engine> engine(new Server::Engine(world)); world->set_engine(engine); if (!world->interface()) { - world->set_interface(SharedPtr<Interface>(engine->interface(), NullDeleter<Interface>)); + world->set_interface( + SPtr<Interface>(engine->interface(), NullDeleter<Interface>)); } } }; 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<Server::Driver>(driver)); + SPtr<Server::Driver>(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<const LV2Graph> > Graphs; + typedef std::vector< Ingen::SPtr<const LV2Graph> > Graphs; Graphs graphs; }; @@ -401,8 +401,8 @@ using namespace Ingen::Server; class MainThread : public Raul::Thread { public: - explicit MainThread(SharedPtr<Engine> engine, - LV2Driver* driver) + explicit MainThread(SPtr<Engine> engine, + LV2Driver* driver) : Raul::Thread() , _engine(engine) , _driver(driver) @@ -424,8 +424,8 @@ private: } } - SharedPtr<Engine> _engine; - LV2Driver* _driver; + SPtr<Engine> _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<const LV2Graph>( - new LV2Graph(graph_uri, (const char*)file_path))); + graphs.push_back( + SPtr<const LV2Graph>( + 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<Server::Engine> engine(new Server::Engine(plugin->world)); + SPtr<Server::Engine> engine(new Server::Engine(plugin->world)); plugin->world->set_engine(engine); - SharedPtr<EventWriter> interface = - SharedPtr<EventWriter>(engine->interface(), NullDeleter<EventWriter>); + SPtr<EventWriter> interface = SPtr<EventWriter>(engine->interface(), + NullDeleter<EventWriter>); 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<Ingen::Server::Driver>(driver)); + engine->set_driver(SPtr<Ingen::Server::Driver>(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<Interface> client(&driver->writer(), NullDeleter<Interface>); + SPtr<Interface> client(&driver->writer(), NullDeleter<Interface>); 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<Ingen::Server::Engine>()); - me->world->set_interface(SharedPtr<Ingen::Interface>()); + me->world->set_engine(SPtr<Ingen::Server::Engine>()); + me->world->set_interface(SPtr<Ingen::Interface>()); delete me->world; delete me; } |