diff options
author | David Robillard <d@drobilla.net> | 2012-03-12 06:59:48 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-03-12 06:59:48 +0000 |
commit | 81e9fb3245bd461ebfee4cfa16d1792e48533f9e (patch) | |
tree | eb1b30d79cba70dda9d832100dd7c14b08085b03 /src/server/PortImpl.cpp | |
parent | e9d9569271ee962c09ab66c6babed1ca5655a6c6 (diff) | |
download | ingen-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/server/PortImpl.cpp')
-rw-r--r-- | src/server/PortImpl.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp index ac4eb21f..c52199ae 100644 --- a/src/server/PortImpl.cpp +++ b/src/server/PortImpl.cpp @@ -55,8 +55,8 @@ PortImpl::PortImpl(BufferFactory& bufs, , _buffer_size(buffer_size) , _type(type) , _value(value) - , _min(0.0f) - , _max(1.0f) + , _min(bufs.forge().make(0.0f)) + , _max(bufs.forge().make(1.0f)) , _last_broadcasted_value(value) , _context(Context::AUDIO) , _buffers(new Array<BufferFactory::Ref>(static_cast<size_t>(poly))) @@ -72,7 +72,7 @@ PortImpl::PortImpl(BufferFactory& bufs, const Ingen::Shared::URIs& uris = bufs.uris(); add_property(uris.rdf_type, type.uri()); - set_property(uris.lv2_index, Atom((int32_t)index)); + set_property(uris.lv2_index, bufs.forge().make((int32_t)index)); set_context(_context); } @@ -206,12 +206,13 @@ PortImpl::clear_buffers() void PortImpl::broadcast_value(Context& context, bool force) { - Raul::Atom val; + Raul::Forge& forge = context.engine().world()->forge(); + Raul::Atom val; switch (_type.symbol()) { case PortType::UNKNOWN: break; case PortType::AUDIO: - val = ((AudioBuffer*)buffer(0).get())->peak(context); + val = forge.make(((AudioBuffer*)buffer(0).get())->peak(context)); { const Notification note = Notification::make( Notification::PORT_ACTIVITY, context.start(), this, val); @@ -220,12 +221,12 @@ PortImpl::broadcast_value(Context& context, bool force) return; case PortType::CONTROL: case PortType::CV: - val = ((AudioBuffer*)buffer(0).get())->value_at(0); + val = forge.make(((AudioBuffer*)buffer(0).get())->value_at(0)); break; case PortType::EVENTS: if (((EventBuffer*)buffer(0).get())->event_count() > 0) { const Notification note = Notification::make( - Notification::PORT_ACTIVITY, context.start(), this, Atom(true)); + Notification::PORT_ACTIVITY, context.start(), this, forge.make(true)); context.event_sink().write(sizeof(note), ¬e); } break; |