summaryrefslogtreecommitdiffstats
path: root/src/server/PortImpl.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-31 02:09:54 +0000
committerDavid Robillard <d@drobilla.net>2012-05-31 02:09:54 +0000
commita62965fa2e16f283680de5580e5bb6307fdf2a01 (patch)
tree4b5a0ee96e98bcd3abc849db166485d5a54714de /src/server/PortImpl.cpp
parent227df4d7e475de8ca69c498984ae12e61c3324ec (diff)
downloadingen-a62965fa2e16f283680de5580e5bb6307fdf2a01.tar.gz
ingen-a62965fa2e16f283680de5580e5bb6307fdf2a01.tar.bz2
ingen-a62965fa2e16f283680de5580e5bb6307fdf2a01.zip
Implement Control/CV morph ports.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4475 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/PortImpl.cpp')
-rw-r--r--src/server/PortImpl.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp
index ce4a0b5a..2fdca1ed 100644
--- a/src/server/PortImpl.cpp
+++ b/src/server/PortImpl.cpp
@@ -56,32 +56,40 @@ PortImpl::PortImpl(BufferFactory& bufs,
, _prepared_buffers(NULL)
, _broadcast(false)
, _set_by_user(false)
+ , _is_morph(false)
+ , _is_auto_morph(false)
{
assert(node != NULL);
assert(_poly > 0);
const Ingen::Shared::URIs& uris = bufs.uris();
- if (_buffer_size == 0) {
- _buffer_size = bufs.default_size(buffer_type);
- }
+ set_type(type, buffer_type);
+
+ add_property(uris.atom_bufferType, bufs.forge().make_urid(buffer_type));
+ add_property(uris.rdf_type, bufs.forge().alloc_uri(type.uri().str()));
+ set_property(uris.lv2_index, bufs.forge().make((int32_t)index));
+}
- if (_buffer_type == 0) {
+void
+PortImpl::set_type(PortType port_type, LV2_URID buffer_type)
+{
+ _type = port_type;
+ _buffer_type = buffer_type;
+ if (!_buffer_type) {
switch (_type.symbol()) {
case PortType::CONTROL:
- _buffer_type = uris.atom_Float;
+ _buffer_type = _bufs.uris().atom_Float;
break;
case PortType::AUDIO:
case PortType::CV:
- _buffer_type = uris.atom_Sound;
+ _buffer_type = _bufs.uris().atom_Sound;
break;
default:
break;
}
}
-
- add_property(uris.rdf_type, bufs.forge().alloc_uri(type.uri().str()));
- set_property(uris.lv2_index, bufs.forge().make((int32_t)index));
+ _buffer_size = _bufs.default_size(_buffer_type);
}
PortImpl::~PortImpl()