diff options
author | David Robillard <d@drobilla.net> | 2017-02-12 15:04:20 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-02-12 15:31:47 +0100 |
commit | b1198f0842e6e4d6b1c01f07d91b42ef4a212788 (patch) | |
tree | 93fdf4da89a6f5f634707fb8c989e0d9ee1a3c65 /src/server/BlockImpl.hpp | |
parent | 81d45973412c675e3c0b4a10b64d811a219feeae (diff) | |
download | ingen-b1198f0842e6e4d6b1c01f07d91b42ef4a212788.tar.gz ingen-b1198f0842e6e4d6b1c01f07d91b42ef4a212788.tar.bz2 ingen-b1198f0842e6e4d6b1c01f07d91b42ef4a212788.zip |
Use smart pointers to handle real-time memory disposal
Diffstat (limited to 'src/server/BlockImpl.hpp')
-rw-r--r-- | src/server/BlockImpl.hpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/server/BlockImpl.hpp b/src/server/BlockImpl.hpp index 8f937dc5..2e3e5fcd 100644 --- a/src/server/BlockImpl.hpp +++ b/src/server/BlockImpl.hpp @@ -60,6 +60,8 @@ class BlockImpl : public NodeImpl , public boost::intrusive::slist_base_hook<> // In GraphImpl { public: + typedef Raul::Array<PortImpl*> Ports; + BlockImpl(PluginImpl* plugin, const Raul::Symbol& symbol, bool poly, @@ -152,8 +154,7 @@ public: virtual void set_polyphonic(bool p) { _polyphonic = p; } virtual bool prepare_poly(BufferFactory& bufs, uint32_t poly); - virtual bool apply_poly( - RunContext& context, Raul::Maid& maid, uint32_t poly); + virtual bool apply_poly(RunContext& context, uint32_t poly); /** Information about the Plugin this Block is an instance of. * Not the best name - not all blocks come from plugins (ie Graph) @@ -186,15 +187,15 @@ public: protected: PortImpl* nth_port_by_type(uint32_t n, bool input, PortType type); - PluginImpl* _plugin; - Raul::Array<PortImpl*>* _ports; ///< Access in audio thread only - uint32_t _polyphony; - std::set<BlockImpl*> _providers; ///< Blocks connected to this one's input ports - std::set<BlockImpl*> _dependants; ///< Blocks this one's output ports are connected to - Mark _mark; ///< Mark for graph compilation algorithm - bool _polyphonic; - bool _activated; - bool _enabled; + PluginImpl* _plugin; + MPtr<Ports> _ports; ///< Access in audio thread only + uint32_t _polyphony; + std::set<BlockImpl*> _providers; ///< Blocks connected to this one's input ports + std::set<BlockImpl*> _dependants; ///< Blocks this one's output ports are connected to + Mark _mark; ///< Mark for graph compilation algorithm + bool _polyphonic; + bool _activated; + bool _enabled; }; } // namespace Server |