summaryrefslogtreecommitdiffstats
path: root/src/server/BufferFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/BufferFactory.cpp')
-rw-r--r--src/server/BufferFactory.cpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/server/BufferFactory.cpp b/src/server/BufferFactory.cpp
index 59da152f..720a4639 100644
--- a/src/server/BufferFactory.cpp
+++ b/src/server/BufferFactory.cpp
@@ -17,7 +17,6 @@
#include "ingen/URIs.hpp"
#include "raul/log.hpp"
-#include "AudioBuffer.hpp"
#include "BufferFactory.hpp"
#include "Driver.hpp"
#include "Engine.hpp"
@@ -126,26 +125,16 @@ BufferFactory::silent_buffer()
BufferRef
BufferFactory::create(LV2_URID type, uint32_t capacity)
{
- Buffer* buffer = NULL;
-
if (capacity == 0) {
capacity = default_size(type);
}
- if (type == _uris.atom_Float) {
- assert(capacity >= sizeof(LV2_Atom_Float));
- buffer = new AudioBuffer(*this, type, capacity);
- } else if (type == _uris.atom_Sound) {
- assert(capacity >= default_size(_uris.atom_Sound));
- buffer = new AudioBuffer(*this, type, capacity);
- } else {
- buffer = new Buffer(*this, type, capacity);
- }
-
- buffer->atom()->type = type;
+ assert(type != _uris.atom_Float ||
+ capacity >= sizeof(LV2_Atom_Float));
+ assert(type != _uris.atom_Sound ||
+ capacity >= default_size(_uris.atom_Sound));
- assert(buffer);
- return BufferRef(buffer);
+ return BufferRef(new Buffer(*this, type, capacity));
}
void