From d700e9d8b26198d62807104d1517791dd992d149 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 20 May 2011 03:51:50 +0000 Subject: Correctly set initial value of control ports at creation time. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3297 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/PatchImpl.cpp | 6 +++++- src/server/PortImpl.cpp | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/PatchImpl.cpp b/src/server/PatchImpl.cpp index 72545b1b..52060ab1 100644 --- a/src/server/PatchImpl.cpp +++ b/src/server/PatchImpl.cpp @@ -343,8 +343,12 @@ PatchImpl::create_port(BufferFactory& bufs, const string& name, PortType type, s assert( !(type == PortType::UNKNOWN) ); + Raul::Atom value; + if (type == PortType::CONTROL) + value = 0.0f; + return new DuplexPort(bufs, this, name, num_ports(), polyphonic, _polyphony, - type, Raul::Atom(), buffer_size, is_output); + type, value, buffer_size, is_output); } /** Remove port from ports list used in pre-processing thread. diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp index 6ccc4547..a448916e 100644 --- a/src/server/PortImpl.cpp +++ b/src/server/PortImpl.cpp @@ -74,8 +74,6 @@ PortImpl::PortImpl(BufferFactory& bufs, if (type == PortType::EVENTS) _broadcast = true; // send activity blips - else if (type == PortType::CONTROL) - _value = Raul::Atom(0.0f); } PortImpl::~PortImpl() -- cgit v1.2.1