コード例 #1
0
ファイル: plugin.cpp プロジェクト: 87maxi/oom
void Pipeline::remove(int index)
{
	int s = size();
	if(index >= s)
		return;
	if(debugMsg)
		qDebug(" Pipeline::remove(%d)", index);
    BasePlugin* plugin = (*this)[index];

    if (plugin && !(plugin->hints() & PLUGIN_IS_SYNTH))
    {//Synth type plugins are deleted elsewhere in SynthPluginDevice::close(), DO NOT delete here
        plugin->aboutToRemove();

        // Delete the appropriate class
        switch(plugin->type())
        {
        case PLUGIN_LADSPA:
            delete (LadspaPlugin*)plugin;
            break;
        case PLUGIN_LV2:
            delete (Lv2Plugin*)plugin;
            break;
        case PLUGIN_VST:
            delete (VstPlugin*)plugin;
            break;
        default:
            break;
        }
    }

	erase(begin()+index);
    //(*this)[index] = 0;
}
コード例 #2
0
ファイル: plugin.cpp プロジェクト: 87maxi/oom
void Pipeline::apply(int ports, uint32_t nframes, float** buffer1)
{
    //fprintf(stderr, "Pipeline::apply data: nframes:%ld %e %e %e %e\n", nframes, buffer1[0][0], buffer1[0][1], buffer1[0][2], buffer1[0][3]);

    bool swap = false;

    for (iPluginI ip = begin(); ip != end(); ++ip)
    {
        BasePlugin* p = *ip;
        if (p && p->enabled())
        {
            p->setChannels(ports);

            if (p->hints() & PLUGIN_HAS_IN_PLACE_BROKEN)
            {
                if (swap)
                    p->process(nframes, buffer, buffer1, 0);
                else
                    p->process(nframes, buffer1, buffer, 0);
                swap = !swap;
            }
            else
            {
                if (swap)
                    p->process(nframes, buffer, buffer, 0);
                else
                    p->process(nframes, buffer1, buffer1, 0);
            }
        }
    }

    if (swap)
    {
        for (int i = 0; i < ports; ++i)
            AL::dsp->cpy(buffer1[i], buffer[i], nframes);
    }

    // p3.3.41
    //fprintf(stderr, "Pipeline::apply after data: nframes:%ld %e %e %e %e\n", nframes, buffer1[0][0], buffer1[0][1], buffer1[0][2], buffer1[0][3]);
}