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


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

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


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

示例1: remove

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

示例2: menuRequested


//.........这里部分代码省略.........
    if (pipe->empty(idx))
    {
        menu->removeAction(changeAction);
        menu->removeAction(saveAction);
        upAction->setEnabled(false);
        downAction->setEnabled(false);
        removeAction->setEnabled(false);
        bypassAction->setEnabled(false);
        showGuiAction->setEnabled(false);
        showNativeGuiAction->setEnabled(false);
    }
    else
    {
        menu->removeAction(newAction);
        if (idx == 0)
            upAction->setEnabled(true);
        if (idx == ((int)epipe->size() - 1))
            downAction->setEnabled(false);
    }

    QPoint pt = QCursor::pos();
    QAction* act = menu->exec(pt, 0);

    //delete menu;
    if (!act)
    {
        delete menu;
        return;
    }

    int sel = act->data().toInt();
    delete menu;

    int pdepth = epipe->size();
    switch (sel)
    {
    case NEW:
    {
        choosePlugin(it);
        break;
    }
    case CHANGE:
    {
        choosePlugin(it, true);
        break;
    }
    case REMOVE:
    {
        BasePlugin* oldPlugin = (*epipe)[idx];
        oldPlugin->setActive(false);
        oldPlugin->aboutToRemove();

        if(debugMsg)
            qCritical("Plugin to remove now and here");

        audio->msgAddPlugin(track, idx, 0);
        song->dirty = true;
        break;
    }
    case BYPASS:
    {
        bool flag = !pipe->isActive(idx);
        pipe->setActive(idx, flag);
        break;
    }
    case SHOW:
    {
        bool flag = !pipe->guiVisible(idx);
        pipe->showGui(idx, flag);
        break;
    }
    case SHOW_NATIVE:
    {
        printf("Show native GUI called\n");
        bool flag = !pipe->nativeGuiVisible(idx);
        pipe->showNativeGui(idx, flag);
        break;
    }
    case UP:
        if (idx > 0)
        {
            setCurrentItem(item(idx - 1));
            pipe->move(idx, true);
        }
        break;
    case DOWN:
        if (idx < pdepth)
        {
            setCurrentItem(item(idx + 1));
            pipe->move(idx, false);
        }
        break;
    case SAVE:
        savePreset(idx);
        break;
    }
    //Already done on songChanged
    //updateContents();
    song->update(SC_RACK);
}/*}}}*/
开发者ID:bartart3d,项目名称:oom,代码行数:101,代码来源:EffectRack.cpp


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