summaryrefslogtreecommitdiffstats
path: root/src/libs/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/engine')
-rw-r--r--src/libs/engine/Buffer.cpp (renamed from src/libs/engine/BufferFactory.cpp)5
-rw-r--r--src/libs/engine/Buffer.hpp4
-rw-r--r--src/libs/engine/BufferFactory.hpp35
-rw-r--r--src/libs/engine/ConnectionImpl.cpp7
-rw-r--r--src/libs/engine/Makefile.am3
-rw-r--r--src/libs/engine/PortImpl.cpp5
6 files changed, 10 insertions, 49 deletions
diff --git a/src/libs/engine/BufferFactory.cpp b/src/libs/engine/Buffer.cpp
index 0358f9eb..d019146c 100644
--- a/src/libs/engine/BufferFactory.cpp
+++ b/src/libs/engine/Buffer.cpp
@@ -15,16 +15,14 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "BufferFactory.hpp"
#include "AudioBuffer.hpp"
#include "EventBuffer.hpp"
namespace Ingen {
-namespace BufferFactory {
Buffer*
-create(DataType type, size_t size)
+Buffer::create(DataType type, size_t size)
{
if (type.is_control())
return new AudioBuffer(1);
@@ -37,5 +35,4 @@ create(DataType type, size_t size)
}
-} // namespace BufferFactory
} // namespace Ingen
diff --git a/src/libs/engine/Buffer.hpp b/src/libs/engine/Buffer.hpp
index 3e3f7563..e388e2e8 100644
--- a/src/libs/engine/Buffer.hpp
+++ b/src/libs/engine/Buffer.hpp
@@ -36,6 +36,8 @@ public:
, _size(size)
, _joined_buf(NULL)
{}
+
+ static Buffer* create(Shared::DataType type, size_t size);
/** Clear contents and reset state */
virtual void clear() = 0;
@@ -43,7 +45,7 @@ public:
virtual void* raw_data() = 0;
virtual const void* raw_data() const = 0;
- /** Rewing (ie reset read pointer), but leave contents unchanged */
+ /** Rewind (ie reset read pointer), but leave contents unchanged */
virtual void rewind() const = 0;
virtual void prepare_read(FrameTime start, SampleCount nframes) = 0;
diff --git a/src/libs/engine/BufferFactory.hpp b/src/libs/engine/BufferFactory.hpp
deleted file mode 100644
index bac49c46..00000000
--- a/src/libs/engine/BufferFactory.hpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This file is part of Ingen.
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *
- * Ingen is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef BUFFERFACTORY_H
-#define BUFFERFACTORY_H
-
-#include "Buffer.hpp"
-
-namespace Ingen {
-
-
-namespace BufferFactory {
-
- Buffer* create(DataType type, size_t size);
-
-}
-
-
-} // namespace Ingen
-
-#endif // BUFFERFACTORY_H
diff --git a/src/libs/engine/ConnectionImpl.cpp b/src/libs/engine/ConnectionImpl.cpp
index 07884336..998b7eb3 100644
--- a/src/libs/engine/ConnectionImpl.cpp
+++ b/src/libs/engine/ConnectionImpl.cpp
@@ -21,7 +21,6 @@
#include "ConnectionImpl.hpp"
#include "NodeImpl.hpp"
#include "PortImpl.hpp"
-#include "BufferFactory.hpp"
#include "AudioBuffer.hpp"
#include "ProcessContext.hpp"
@@ -60,7 +59,7 @@ ConnectionImpl::ConnectionImpl(PortImpl* src_port, PortImpl* dst_port)
_must_mix = false; // FIXME: kludge
if (_must_mix)
- _local_buffer = BufferFactory::create(dst_port->type(), dst_port->buffer(0)->size());
+ _local_buffer = Buffer::create(dst_port->type(), dst_port->buffer(0)->size());
/* FIXME: 1->1 connections with a destination with fixed buffers copies unecessarily */
//cerr << src_port->path() << " -> " << dst_port->path() << " must mix: " << _must_mix << endl;
@@ -80,7 +79,7 @@ ConnectionImpl::set_buffer_size(size_t size)
assert(_local_buffer);
delete _local_buffer;
- _local_buffer = BufferFactory::create(_dst_port->type(), _dst_port->buffer(0)->size());
+ _local_buffer = Buffer::create(_dst_port->type(), _dst_port->buffer(0)->size());
}
_buffer_size = size;
@@ -101,7 +100,7 @@ ConnectionImpl::prepare_poly(uint32_t poly)
<< "\t\tmust mix: " << _must_mix << " at poly " << poly << endl;*/
if (_must_mix && ! _local_buffer)
- _local_buffer = BufferFactory::create(_dst_port->type(), _dst_port->buffer(0)->size());
+ _local_buffer = Buffer::create(_dst_port->type(), _dst_port->buffer(0)->size());
}
diff --git a/src/libs/engine/Makefile.am b/src/libs/engine/Makefile.am
index f04d3f3d..b0035ba6 100644
--- a/src/libs/engine/Makefile.am
+++ b/src/libs/engine/Makefile.am
@@ -34,9 +34,8 @@ libingen_engine_la_SOURCES = \
AudioBuffer.cpp \
AudioBuffer.hpp \
AudioDriver.hpp \
+ Buffer.cpp \
Buffer.hpp \
- BufferFactory.cpp \
- BufferFactory.hpp \
ClientBroadcaster.cpp \
ClientBroadcaster.hpp \
CompiledPatch.hpp \
diff --git a/src/libs/engine/PortImpl.cpp b/src/libs/engine/PortImpl.cpp
index 46a32b78..9061ffc5 100644
--- a/src/libs/engine/PortImpl.cpp
+++ b/src/libs/engine/PortImpl.cpp
@@ -23,7 +23,6 @@
#include "interface/DataType.hpp"
#include "AudioBuffer.hpp"
#include "EventBuffer.hpp"
-#include "BufferFactory.hpp"
#include "ProcessContext.hpp"
#include "SendPortActivityEvent.hpp"
@@ -96,7 +95,7 @@ PortImpl::prepare_poly(uint32_t poly)
if (poly > _poly) {
_prepared_buffers = new Raul::Array<Buffer*>(poly, *_buffers);
for (uint32_t i = _poly; i < _prepared_buffers->size(); ++i)
- _prepared_buffers->at(i) = BufferFactory::create(_type, _buffer_size);
+ _prepared_buffers->at(i) = Buffer::create(_type, _buffer_size);
}
return true;
@@ -131,7 +130,7 @@ PortImpl::allocate_buffers()
_buffers->alloc(_poly);
for (uint32_t i=0; i < _poly; ++i)
- _buffers->at(i) = BufferFactory::create(_type, _buffer_size);
+ _buffers->at(i) = Buffer::create(_type, _buffer_size);
}