diff options
author | David Robillard <d@drobilla.net> | 2009-05-27 17:42:51 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-05-27 17:42:51 +0000 |
commit | c11ecf0fd10641218326ae384e80413ba3cdf46c (patch) | |
tree | 52ea61f88167a2e7eacc8fa5ff0ee39ee25b2e7e /src/engine/PortImpl.cpp | |
parent | 8feac4ed0e764c677d4d208377e956c6db94d2dd (diff) | |
download | ingen-c11ecf0fd10641218326ae384e80413ba3cdf46c.tar.gz ingen-c11ecf0fd10641218326ae384e80413ba3cdf46c.tar.bz2 ingen-c11ecf0fd10641218326ae384e80413ba3cdf46c.zip |
Remove 'new_patch', 'new_node', and 'new_port' from interface in favour of generic 'put'.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2011 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/PortImpl.cpp')
-rw-r--r-- | src/engine/PortImpl.cpp | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/src/engine/PortImpl.cpp b/src/engine/PortImpl.cpp index 15a44355..c81e797a 100644 --- a/src/engine/PortImpl.cpp +++ b/src/engine/PortImpl.cpp @@ -28,19 +28,20 @@ #include "events/SendPortActivityEvent.hpp" using namespace std; +using namespace Raul; namespace Ingen { using namespace Shared; -PortImpl::PortImpl(NodeImpl* const node, - const string& name, - uint32_t index, - uint32_t poly, - DataType type, - const Raul::Atom& value, - size_t buffer_size) +PortImpl::PortImpl(NodeImpl* const node, + const string& name, + uint32_t index, + uint32_t poly, + DataType type, + const Atom& value, + size_t buffer_size) : GraphObjectImpl(node, name, (type == DataType::AUDIO || type == DataType::CONTROL)) , _index(index) , _poly(poly) @@ -50,9 +51,9 @@ PortImpl::PortImpl(NodeImpl* const node, , _fixed_buffers(false) , _broadcast(false) , _set_by_user(false) - , _last_broadcasted_value(_value.type() == Raul::Atom::FLOAT ? _value.get_float() : 0.0f) // default? + , _last_broadcasted_value(_value.type() == Atom::FLOAT ? _value.get_float() : 0.0f) // default? , _context(Context::AUDIO) - , _buffers(new Raul::Array<Buffer*>(poly)) + , _buffers(new Array<Buffer*>(poly)) , _prepared_buffers(NULL) { assert(node != NULL); @@ -65,8 +66,16 @@ PortImpl::PortImpl(NodeImpl* const node, else _polyphonic = true; - if (type == DataType::EVENT) + if (type == DataType::AUDIO) + add_property("rdf:type", Atom(Atom::URI, "lv2:AudioPort")); + + if (type == DataType::CONTROL) + add_property("rdf:type", Atom(Atom::URI, "lv2:ControlPort")); + + if (type == DataType::EVENT) { + add_property("rdf:type", Atom(Atom::URI, "lv2ev:EventPort")); _broadcast = true; // send activity blips + } assert(_buffers->size() > 0); } @@ -83,7 +92,7 @@ PortImpl::~PortImpl() bool -PortImpl::set_polyphonic(Raul::Maid& maid, bool p) +PortImpl::set_polyphonic(Maid& maid, bool p) { if (_type == DataType::CONTROL || _type == DataType::AUDIO) return GraphObjectImpl::set_polyphonic(maid, p); @@ -100,7 +109,7 @@ PortImpl::prepare_poly(uint32_t poly) /* FIXME: poly never goes down, harsh on memory.. */ if (poly > _poly) { - _prepared_buffers = new Raul::Array<Buffer*>(poly, *_buffers); + _prepared_buffers = new Array<Buffer*>(poly, *_buffers); for (uint32_t i = _poly; i < _prepared_buffers->size(); ++i) _prepared_buffers->at(i) = Buffer::create(_type, _buffer_size); } @@ -110,7 +119,7 @@ PortImpl::prepare_poly(uint32_t poly) bool -PortImpl::apply_poly(Raul::Maid& maid, uint32_t poly) +PortImpl::apply_poly(Maid& maid, uint32_t poly) { if (!_polyphonic || !_parent->polyphonic()) return true; |