summaryrefslogtreecommitdiffstats
path: root/src/shared/LV2Atom.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-12 06:59:48 +0000
committerDavid Robillard <d@drobilla.net>2012-03-12 06:59:48 +0000
commit81e9fb3245bd461ebfee4cfa16d1792e48533f9e (patch)
treeeb1b30d79cba70dda9d832100dd7c14b08085b03 /src/shared/LV2Atom.cpp
parente9d9569271ee962c09ab66c6babed1ca5655a6c6 (diff)
downloadingen-81e9fb3245bd461ebfee4cfa16d1792e48533f9e.tar.gz
ingen-81e9fb3245bd461ebfee4cfa16d1792e48533f9e.tar.bz2
ingen-81e9fb3245bd461ebfee4cfa16d1792e48533f9e.zip
Centralise atom creation in forge object.
Aside from being more greppable and making realtime violations more obvious, this is a step towards using LV2 atoms internally (which needs a factory since the type numbers are dynamic). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4054 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/shared/LV2Atom.cpp')
-rw-r--r--src/shared/LV2Atom.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/shared/LV2Atom.cpp b/src/shared/LV2Atom.cpp
index 931ed9ab..991c4f7c 100644
--- a/src/shared/LV2Atom.cpp
+++ b/src/shared/LV2Atom.cpp
@@ -31,19 +31,22 @@ namespace Shared {
namespace LV2Atom {
bool
-to_atom(const Shared::URIs& uris, const LV2_Atom* object, Raul::Atom& atom)
+to_atom(Raul::Forge* forge,
+ const Shared::URIs& uris,
+ const LV2_Atom* object,
+ Raul::Atom& atom)
{
if (object->type == uris.atom_String.id) {
- atom = Raul::Atom((char*)(object + 1));
+ atom = forge->make((char*)(object + 1));
return true;
} else if (object->type == uris.atom_Bool.id) {
- atom = Raul::Atom((bool)(int32_t*)(object + 1));
+ atom = forge->make((bool)(int32_t*)(object + 1));
return true;
} else if (object->type == uris.atom_Int32.id) {
- atom = Raul::Atom((int32_t*)(object + 1));
+ atom = forge->make((int32_t*)(object + 1));
return true;
} else if (object->type == uris.atom_Float.id) {
- atom = Raul::Atom((float*)(object + 1));
+ atom = forge->make((float*)(object + 1));
return true;
}
return false;