diff options
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/Buffer.hpp | 3 | ||||
-rw-r--r-- | src/server/BufferFactory.hpp | 2 | ||||
-rw-r--r-- | src/server/BufferRef.hpp | 2 | ||||
-rw-r--r-- | src/server/EdgeImpl.cpp | 15 | ||||
-rw-r--r-- | src/server/EdgeImpl.hpp | 11 | ||||
-rw-r--r-- | src/server/InputPort.cpp | 13 | ||||
-rw-r--r-- | src/server/LV2Node.cpp | 6 | ||||
-rw-r--r-- | src/server/LV2Node.hpp | 9 | ||||
-rw-r--r-- | src/server/NodeImpl.hpp | 11 | ||||
-rw-r--r-- | src/server/mix.hpp | 20 |
10 files changed, 43 insertions, 49 deletions
diff --git a/src/server/Buffer.hpp b/src/server/Buffer.hpp index fcd6fe65..f0a84910 100644 --- a/src/server/Buffer.hpp +++ b/src/server/Buffer.hpp @@ -20,7 +20,6 @@ #include <cassert> #include <cstddef> -#include <boost/intrusive_ptr.hpp> #include <boost/utility.hpp> #include "lv2/lv2plug.in/ns/ext/atom/atom.h" @@ -86,7 +85,7 @@ private: void recycle(); Buffer* _next; ///< Intrusive linked list for BufferFactory - Raul::AtomicInt _refs; ///< Intrusive reference count for intrusive_ptr + Raul::AtomicInt _refs; ///< Intrusive reference count }; } // namespace Server diff --git a/src/server/BufferFactory.hpp b/src/server/BufferFactory.hpp index 84fb813d..75cb0b63 100644 --- a/src/server/BufferFactory.hpp +++ b/src/server/BufferFactory.hpp @@ -19,8 +19,6 @@ #include <map> -#include <boost/intrusive_ptr.hpp> - #undef nil #include <glibmm/thread.h> diff --git a/src/server/BufferRef.hpp b/src/server/BufferRef.hpp index 669af033..ac5d79ad 100644 --- a/src/server/BufferRef.hpp +++ b/src/server/BufferRef.hpp @@ -19,6 +19,8 @@ #include <boost/intrusive_ptr.hpp> +#include "Buffer.hpp" + namespace Ingen { namespace Server { diff --git a/src/server/EdgeImpl.cpp b/src/server/EdgeImpl.cpp index a5c63d4a..b783587d 100644 --- a/src/server/EdgeImpl.cpp +++ b/src/server/EdgeImpl.cpp @@ -15,7 +15,6 @@ */ #include <algorithm> -#include <boost/intrusive_ptr.hpp> #include "ingen/shared/URIs.hpp" #include "lv2/lv2plug.in/ns/ext/atom/util.h" @@ -80,11 +79,11 @@ EdgeImpl::head_path() const } void -EdgeImpl::get_sources(Context& context, - uint32_t voice, - boost::intrusive_ptr<Buffer>* srcs, - uint32_t max_num_srcs, - uint32_t& num_srcs) +EdgeImpl::get_sources(Context& context, + uint32_t voice, + Buffer** srcs, + uint32_t max_num_srcs, + uint32_t& num_srcs) { if (must_queue() && _queue->read_space() > 0) { LV2_Atom obj; @@ -93,7 +92,7 @@ EdgeImpl::get_sources(Context& context, head()->buffer_type(), sizeof(LV2_Atom) + obj.size); void* data = buf->port_data(PortType::ATOM, context.offset()); _queue->read(sizeof(LV2_Atom) + obj.size, (LV2_Atom*)data); - srcs[num_srcs++] = buf; + srcs[num_srcs++] = buf.get(); } else if (must_mix()) { // Mixing down voices: every src voice mixed into every dst voice for (uint32_t v = 0; v < _tail->poly(); ++v) { @@ -116,7 +115,7 @@ EdgeImpl::queue(Context& context) const Ingen::Shared::URIs& uris = _tail->bufs().uris(); - boost::intrusive_ptr<Buffer> src_buf = _tail->buffer(0); + BufferRef src_buf = _tail->buffer(0); if (src_buf->atom()->type != uris.atom_Sequence) { Raul::error << "Queued edge source is not a Sequence" << std::endl; return; diff --git a/src/server/EdgeImpl.hpp b/src/server/EdgeImpl.hpp index 3d39e492..b93d65f6 100644 --- a/src/server/EdgeImpl.hpp +++ b/src/server/EdgeImpl.hpp @@ -20,7 +20,6 @@ #include <cstdlib> #include <boost/intrusive/slist.hpp> -#include <boost/intrusive_ptr.hpp> #include <boost/utility.hpp> #include "ingen/Edge.hpp" @@ -70,11 +69,11 @@ public: void queue(Context& context); - void get_sources(Context& context, - uint32_t voice, - boost::intrusive_ptr<Buffer>* srcs, - uint32_t max_num_srcs, - uint32_t& num_srcs); + void get_sources(Context& context, + uint32_t voice, + Buffer** srcs, + uint32_t max_num_srcs, + uint32_t& num_srcs); /** Get the buffer for a particular voice. * An Edge is smart - it knows the destination port requesting the diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp index 33e8e913..515b6ca0 100644 --- a/src/server/InputPort.cpp +++ b/src/server/InputPort.cpp @@ -190,18 +190,15 @@ InputPort::pre_process(Context& context) } } else { uint32_t max_num_srcs = 0; - for (Edges::const_iterator c = _edges.begin(); - c != _edges.end(); ++c) { - max_num_srcs += c->tail()->poly(); + for (Edges::const_iterator e = _edges.begin(); e != _edges.end(); ++e) { + max_num_srcs += e->tail()->poly(); } - boost::intrusive_ptr<Buffer> srcs[max_num_srcs]; - + Buffer* srcs[max_num_srcs]; for (uint32_t v = 0; v < _poly; ++v) { uint32_t num_srcs = 0; - for (Edges::iterator c = _edges.begin(); - c != _edges.end(); ++c) { - c->get_sources(context, v, srcs, max_num_srcs, num_srcs); + for (Edges::iterator e = _edges.begin(); e != _edges.end(); ++e) { + e->get_sources(context, v, srcs, max_num_srcs, num_srcs); } mix(context, bufs().uris(), buffer(v).get(), srcs, num_srcs); diff --git a/src/server/LV2Node.cpp b/src/server/LV2Node.cpp index de714aa7..40e13520 100644 --- a/src/server/LV2Node.cpp +++ b/src/server/LV2Node.cpp @@ -391,8 +391,10 @@ LV2Node::process(ProcessContext& context) } void -LV2Node::set_port_buffer(uint32_t voice, uint32_t port_num, - boost::intrusive_ptr<Buffer> buf, SampleCount offset) +LV2Node::set_port_buffer(uint32_t voice, + uint32_t port_num, + BufferRef buf, + SampleCount offset) { NodeImpl::set_port_buffer(voice, port_num, buf, offset); lilv_instance_connect_port(instance(voice), port_num, diff --git a/src/server/LV2Node.hpp b/src/server/LV2Node.hpp index 5ba2afaf..6309acf2 100644 --- a/src/server/LV2Node.hpp +++ b/src/server/LV2Node.hpp @@ -19,11 +19,10 @@ #include <string> -#include <boost/intrusive_ptr.hpp> - #include "lilv/lilv.h" #include "lv2/lv2plug.in/ns/ext/worker/worker.h" +#include "BufferRef.hpp" #include "NodeImpl.hpp" #include "ingen/shared/LV2Features.hpp" #include "types.hpp" @@ -60,8 +59,10 @@ public: void process(ProcessContext& context); - void set_port_buffer(uint32_t voice, uint32_t port_num, - boost::intrusive_ptr<Buffer> buf, SampleCount offset); + void set_port_buffer(uint32_t voice, + uint32_t port_num, + BufferRef buf, + SampleCount offset); protected: inline LilvInstance* instance(uint32_t voice) { diff --git a/src/server/NodeImpl.hpp b/src/server/NodeImpl.hpp index 10ed41eb..03b0fcbe 100644 --- a/src/server/NodeImpl.hpp +++ b/src/server/NodeImpl.hpp @@ -20,13 +20,12 @@ #include <list> #include <string> -#include <boost/intrusive_ptr.hpp> - #include "ingen/Node.hpp" #include "raul/Array.hpp" #include "raul/AtomicInt.hpp" #include "raul/Semaphore.hpp" +#include "BufferRef.hpp" #include "Context.hpp" #include "GraphObjectImpl.hpp" #include "PortType.hpp" @@ -140,10 +139,10 @@ public: virtual void post_process(Context& context); /** Set the buffer of a port to a given buffer (e.g. connect plugin to buffer) */ - virtual void set_port_buffer(uint32_t voice, - uint32_t port_num, - boost::intrusive_ptr<Buffer> buf, - SampleCount offset); + virtual void set_port_buffer(uint32_t voice, + uint32_t port_num, + BufferRef buf, + SampleCount offset); virtual Port* port(uint32_t index) const; virtual PortImpl* port_impl(uint32_t index) const { return (*_ports)[index]; } diff --git a/src/server/mix.hpp b/src/server/mix.hpp index 75214093..c68b0710 100644 --- a/src/server/mix.hpp +++ b/src/server/mix.hpp @@ -17,8 +17,6 @@ #ifndef INGEN_ENGINE_MIX_HPP #define INGEN_ENGINE_MIX_HPP -#include <boost/intrusive_ptr.hpp> - #include "ingen/shared/URIs.hpp" #include "raul/log.hpp" @@ -35,22 +33,22 @@ is_audio(Shared::URIs& uris, LV2_URID type) } inline void -mix(Context& context, - Shared::URIs& uris, - Buffer* dst, - const boost::intrusive_ptr<Buffer>* srcs, - uint32_t num_srcs) +mix(Context& context, + Shared::URIs& uris, + Buffer* dst, + Buffer** srcs, + uint32_t num_srcs) { if (num_srcs == 1) { - dst->copy(context, srcs[0].get()); + dst->copy(context, srcs[0]); } else if (is_audio(uris, dst->type())) { // Copy the first source - dst->copy(context, srcs[0].get()); + dst->copy(context, srcs[0]); // Mix in the rest for (uint32_t i = 1; i < num_srcs; ++i) { assert(is_audio(uris, srcs[i]->type())); - ((AudioBuffer*)dst)->accumulate(context, (AudioBuffer*)srcs[i].get()); + ((AudioBuffer*)dst)->accumulate(context, (AudioBuffer*)srcs[i]); } } else { std::cerr << "FIXME: event mix" << std::endl; @@ -66,7 +64,7 @@ mix(Context& context, while (true) { const EventBuffer* first = NULL; for (uint32_t i = 0; i < num_srcs; ++i) { - const EventBuffer* const src = (const EventBuffer*)srcs[i].get(); + const EventBuffer* const src = (const EventBuffer*)srcs[i]; if (src->is_valid()) { if (!first || src->get_event()->frames < first->get_event()->frames) first = src; |