void LadspaPlugin::init () { m_activated = false; m_uniqueId = QString("%1%2").arg(UriRoot, m_descriptor->UniqueID); m_handle = m_descriptor->instantiate(m_descriptor, m_sampleRate); Q_ASSERT(m_handle); qDebug() << "Initializing LadspaPlugin" << name() << "with ports:"; Port *port; int count = m_descriptor->PortCount; m_ports.resize( count ); for (int i = 0; i < count; ++i) { port = m_ports[i] = new LadspaPort( this, i ); qDebug() << i << port->name(); if (port->type() == AudioPort) { if (port->direction() == Input) { m_audioInPorts.insert(port); } else { // Ladspa specs says it must be either input or output Q_ASSERT(port->direction() == Output); m_audioOutPorts.insert(port); } } } qDebug() << "Instantiated LadspaPlugin:" << name(); }
void FxLine::collectPorts (Plugin *plugin, QList<Port*> *audioIn, QList<Port*> *audioOut) const { if (audioIn) { audioIn->empty(); } if (audioOut) { audioOut->empty(); } for (int i = 0; i < plugin->portCount(); i++) { Port *p = plugin->port(i); if (p->type() == AudioPort) { switch (p->direction()) { case Input: if (audioIn) { audioIn->append(p); } break; case Output: if (audioOut) { audioOut->append(p); } break; default: // Error. break; } } } }
const QSet<Node* const> Lv2Plugin::dependents () const { QSet<Node* const> n; int count = portCount(); for (int i=0; i<count; ++i) { Port* p = port(i); if (p->direction() == Output) { n += p; } } return n; }
const QSet<Node* const> Processor::dependencies () const { QSet<Node* const> n; int count = portCount(); for (int i=0; i<count; ++i) { Port* p = port(i); if (p->direction() == Input) { n += p; } } return n; }