PortImpl::PortImpl(BufferFactory& bufs, NodeImpl* const node, const Raul::Symbol& name, uint32_t index, uint32_t poly, PortType type, const Atom& value, size_t buffer_size) : GraphObjectImpl(bufs.uris(), node, name) , _bufs(bufs) , _index(index) , _poly(poly) , _buffer_size(buffer_size) , _buffer_type(type) , _value(value) , _broadcast(false) , _set_by_user(false) , _last_broadcasted_value(value) , _context(Context::AUDIO) , _buffers(new Array<BufferFactory::Ref>(static_cast<size_t>(poly))) , _prepared_buffers(NULL) { _types.insert(type); assert(node != NULL); assert(_poly > 0); if (_buffer_size == 0) _buffer_size = bufs.default_buffer_size(type); const Ingen::Shared::LV2URIMap& uris = bufs.uris(); add_property(uris.rdf_type, type.uri()); set_property(uris.lv2_index, Atom((int32_t)index)); set_context(_context); if (type == PortType::EVENTS) _broadcast = true; // send activity blips }
TimeNode::TimeNode(InternalPlugin* plugin, BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, GraphImpl* parent, SampleRate srate) : InternalBlock(plugin, symbol, false, parent, srate) { const Ingen::URIs& uris = bufs.uris(); _ports = new Raul::Array<PortImpl*>(1); _notify_port = new OutputPort( bufs, this, Raul::Symbol("notify"), 0, 1, PortType::ATOM, uris.atom_Sequence, Atom(), 1024); _notify_port->set_property(uris.lv2_name, bufs.forge().alloc("Notify")); _notify_port->set_property(uris.atom_supports, bufs.forge().make_urid(uris.time_Position)); _ports->at(0) = _notify_port; }
DelayNode::DelayNode(InternalPlugin* plugin, BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, GraphImpl* parent, SampleRate srate) : InternalBlock(plugin, symbol, polyphonic, parent, srate) , _buffer(0) , _buffer_length(0) , _buffer_mask(0) , _write_phase(0) { const Ingen::URIs& uris = bufs.uris(); _ports = new Raul::Array<PortImpl*>(3); const float default_delay = 1.0f; _last_delay_time = default_delay; _delay_samples = default_delay; _delay_port = new InputPort(bufs, this, Raul::Symbol("delay"), 1, _polyphony, PortType::CONTROL, 0, bufs.forge().make(default_delay)); _delay_port->set_property(uris.lv2_name, bufs.forge().alloc("Delay")); _delay_port->set_property(uris.lv2_default, bufs.forge().make(default_delay)); _delay_port->set_property(uris.lv2_minimum, bufs.forge().make((float)(1.0/(double)srate))); _delay_port->set_property(uris.lv2_maximum, bufs.forge().make(MAX_DELAY_SECONDS)); _ports->at(0) = _delay_port; _in_port = new InputPort(bufs, this, Raul::Symbol("in"), 0, 1, PortType::AUDIO, 0, bufs.forge().make(0.0f)); _in_port->set_property(uris.lv2_name, bufs.forge().alloc("Input")); _ports->at(1) = _in_port; _out_port = new OutputPort(bufs, this, Raul::Symbol("out"), 0, 1, PortType::AUDIO, 0, bufs.forge().make(0.0f)); _out_port->set_property(uris.lv2_name, bufs.forge().alloc("Output")); _ports->at(2) = _out_port; //_buffer = bufs.get(PortType::AUDIO, bufs.audio_buffer_size(buffer_length_frames), true); }
DelayNode::DelayNode( InternalPlugin* plugin, BufferFactory& bufs, const std::string& path, bool polyphonic, PatchImpl* parent, SampleRate srate) : NodeImpl(plugin, path, polyphonic, parent, srate) , _buffer(0) , _buffer_length(0) , _buffer_mask(0) , _write_phase(0) { const Ingen::Shared::LV2URIMap& uris = bufs.uris(); _ports = new Raul::Array<PortImpl*>(3); const float default_delay = 1.0f; _last_delay_time = default_delay; _delay_samples = default_delay; _delay_port = new InputPort(bufs, this, "delay", 1, _polyphony, PortType::CONTROL, default_delay); _delay_port->set_property(uris.lv2_name, "Delay"); _delay_port->set_property(uris.lv2_default, default_delay); _delay_port->set_property(uris.lv2_minimum, (float)(1.0/(double)srate)); _delay_port->set_property(uris.lv2_maximum, MAX_DELAY_SECONDS); _ports->at(0) = _delay_port; _in_port = new InputPort(bufs, this, "in", 0, 1, PortType::AUDIO, 0.0f); _in_port->set_property(uris.lv2_name, "Input"); _ports->at(1) = _in_port; _out_port = new OutputPort(bufs, this, "out", 0, 1, PortType::AUDIO, 0.0f); _out_port->set_property(uris.lv2_name, "Output"); _ports->at(2) = _out_port; //_buffer = bufs.get(PortType::AUDIO, bufs.audio_buffer_size(buffer_length_frames), true); }