当前位置: 首页>>代码示例>>C++>>正文


C++ BasePlugin::setChannels方法代码示例

本文整理汇总了C++中BasePlugin::setChannels方法的典型用法代码示例。如果您正苦于以下问题:C++ BasePlugin::setChannels方法的具体用法?C++ BasePlugin::setChannels怎么用?C++ BasePlugin::setChannels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BasePlugin的用法示例。


在下文中一共展示了BasePlugin::setChannels方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: choosePlugin

void EffectRack::choosePlugin(QListWidgetItem* it, bool replace)/*{{{*/
{
    PluginI* plugi = PluginDialog::getPlugin(track->type(), this);
    if (plugi)
    {
        BasePlugin* nplug = 0;

        if (plugi->type() == PLUGIN_LADSPA)
            nplug = new LadspaPlugin();
        else if (plugi->type() == PLUGIN_LV2)
            nplug = new Lv2Plugin();
        else if (plugi->type() == PLUGIN_VST)
            nplug = new VstPlugin();

        if (nplug)
        {
            if (nplug->init(plugi->filename(), plugi->label()))
            {
                // just in case is needed later
                //if (!audioDevice || audioDevice->deviceType() != AudioDevice::JACK_AUDIO)
                //    nplug->aboutToRemove();

                int idx = row(it);
                if (replace)
                {
                    audio->msgAddPlugin(track, idx, 0);
                    //Do this part from the GUI context so user interfaces can be properly deleted
                    // track->efxPipe()->insert(0, idx); was set on lv2 only
                }
                audio->msgAddPlugin(track, idx, nplug);
                nplug->setChannels(track->channels());
                nplug->setActive(true);
                song->dirty = true;
            }
            else
            {
                QMessageBox::warning(this, tr("Failed to load plugin"), tr("Plugin '%1'' failed to initialize properly, error was:\n%2").arg(plugi->name()).arg(get_last_error()));
                nplug->deleteMe();
                return;
            }
        }

        updateContents();
    }
}/*}}}*/
开发者ID:bartart3d,项目名称:oom,代码行数:45,代码来源:EffectRack.cpp

示例2: apply

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]);
}
开发者ID:87maxi,项目名称:oom,代码行数:40,代码来源:plugin.cpp


注:本文中的BasePlugin::setChannels方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。