/* This file is part of Ingen. * Copyright (C) 2007-2009 Dave Robillard * * Ingen is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "interface/Patch.hpp" #include "Buffer.hpp" #include "NodeImpl.hpp" #include "OutputPort.hpp" #include "ProcessContext.hpp" using namespace std; namespace Ingen { namespace Shared { class Patch; } using namespace Shared; OutputPort::OutputPort(BufferFactory& bufs, NodeImpl* parent, const string& name, uint32_t index, uint32_t poly, PortType type, const Raul::Atom& value, size_t buffer_size) : PortImpl(bufs, parent, name, index, poly, type, value, buffer_size) { if (!dynamic_cast(parent)) add_property("rdf:type", Raul::Atom(Raul::Atom::URI, "lv2:OutputPort")); if (type == PortType::CONTROL) _broadcast = true; } void OutputPort::pre_process(Context& context) { connect_buffers(); for (uint32_t v = 0; v < _poly; ++v) buffer(v)->prepare_write(context); } void OutputPort::post_process(Context& context) { for (uint32_t v = 0; v < _poly; ++v) buffer(v)->prepare_read(context); //cerr << path() << " output post: buffer: " << buffer(0) << endl; if (_broadcast) broadcast_value(context, false); } } // namespace Ingen