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


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

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


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

示例1: fillPluginComboBox

//==============================================================================
void SurfaceComponent::fillPluginComboBox (ComboBox* combo)
{
    combo->clear ();

    for (int i = 0; i < host->getPluginsCount (); i++)
    {
        BasePlugin* plugin = host->getPluginByIndex (i);
        combo->addItem (plugin->getName (), plugin->getUniqueHash ());
    }
}
开发者ID:alessandropetrolati,项目名称:juced,代码行数:11,代码来源:SurfaceComponent.cpp

示例2: graphChanged

void GraphComponent::graphChanged ()
{
    DBG ("GraphComponent::graphChanged");

    jassert (host != 0); // just to be sure !

    // AUDIO -
    ProcessingGraph* audioGraph = new ProcessingGraph ();

    // starting from inputs
    recalculateConnectionsRecursive (inputs,
                                     audioGraph,
                                     0,
                                     true);

    // then adding outputs if not already
    recalculateConnectionsRecursive (outputs,
                                     audioGraph,
                                     audioGraph->getNodeCount (),
                                     true);

    // all the others that are not connected (add them after input)
    for (int i = 0; i < nodes.size (); i++)
    {
        recalculateConnectionsRecursive (nodes.getUnchecked (i),
                                         audioGraph,
                                         1,
                                         true);
    }

    host->changePluginAudioGraph (audioGraph);

#if JUCE_DEBUG

    printf ("MIDI > \n");
    for (int i = 0; i < audioGraph->getNodeCount (); i++)
    {
        BasePlugin* plugin = (BasePlugin*) audioGraph->getData (i);
        printf ("%s > ", (const char*) plugin->getName());
    }
    printf ("\n");

    printf ("MIDI CONNECTIONS > \n");
    for (int i = 0; i < audioGraph->getNodeCount (); i++)
    {
        ProcessingNode* node = audioGraph->getNode (i);
        if (node)
        {
            for (int j = 0; j < node->getLinksCount (JOST_LINKTYPE_MIDI); j++)
            {
                ProcessingLink* conn = node->getLink (JOST_LINKTYPE_MIDI, j);
                printf ("%s,%d > %s,%d \n",
                        (const char*) ((BasePlugin*)node->getData())->getName(),
                        conn->sourcePort,
                        (const char*) ((BasePlugin*)conn->destination->getData())->getName(),
                        conn->destinationPort);
            }
        }
    }
    printf ("\n");

    printf ("AUDIO > \n");
    for (int i = 0; i < audioGraph->getNodeCount (); i++)
    {
        BasePlugin* plugin = (BasePlugin*) audioGraph->getData (i);
        printf ("%s > ", (const char*) plugin->getName());
    }
    printf ("\n");

    printf ("AUDIO CONNECTIONS > \n");
    for (int i = 0; i < audioGraph->getNodeCount (); i++)
    {
        ProcessingNode* node = audioGraph->getNode (i);
        if (node)
        {
            for (int j = 0; j < node->getLinksCount (JOST_LINKTYPE_AUDIO); j++)
            {
                ProcessingLink* conn = node->getLink (JOST_LINKTYPE_AUDIO, j);
                printf ("%s,%d > %s,%d \n",
                        (const char*) ((BasePlugin*)node->getData())->getName(),
                        conn->sourcePort,
                        (const char*) ((BasePlugin*)conn->destination->getData())->getName(),
                        conn->destinationPort);
            }
        }
    }
    printf ("\n");

#endif

    Viewport* parent = findParentComponentOfClass ((Viewport*) 0);
    if (parent)
    {
        parent->notifyComponentChanged ();
    }
}
开发者ID:alessandropetrolati,项目名称:juced,代码行数:96,代码来源:GraphComponent.cpp

示例3: connectorPopupMenuSelected

void GraphComponent::connectorPopupMenuSelected (GraphConnectorComponent* connector)
{
    DBG ("GraphComponent::connectorPopupMenuSelected");

    jassert (connector != 0);

    PopupMenu menu;

    Array<GraphConnectorComponent*> links;
    connector->getLinkedConnectors (links);

    int startCount = 0;
    
    if (links.size () > 0)
    {
        menu.addItem (1, "Break all wires");
        menu.addSeparator ();
        
        GraphConnectorComponent* conn;
        BasePlugin* linkedPlugin;
        
        for (int i = 0; i < links.size (); i++)
        {
            conn = links.getUnchecked (i);
            linkedPlugin = (BasePlugin*) conn->getParentGraphComponent ()->getUserData ();
            
            String itemString;
            itemString << "Unwire " 
                       << linkedPlugin->getName () 
                       << " (";

            switch (conn->getType ()) {
                case JOST_LINKTYPE_AUDIO: // audio
                    itemString << "audio port ";
                    break;
                case JOST_LINKTYPE_MIDI:
                    itemString << "midi port ";
                    break;
            }

            itemString << (conn->getConnectorID () + 1)
                       << ")";
            
            menu.addItem (10 + startCount, itemString);
            
            ++startCount;
        }
    }
    
    if (menu.getNumItems () > 0)
    {
        const int result = menu.show();
        switch (result)
        {
        case 1:
            connector->destroyAllLinks();
            connector->notifyGraphChanged ();
            break;
        default:
            if (result >= 10 && result < 10 + startCount)
            {
                connector->removeLinkWith (links.getUnchecked (result - 10));
                connector->notifyGraphChanged ();
            }
            break;
        }
    }
}
开发者ID:alessandropetrolati,项目名称:juced,代码行数:68,代码来源:GraphComponent.cpp

示例4: nodePopupMenuSelected

void GraphComponent::nodePopupMenuSelected (GraphNodeComponent* node)
{
    DBG ("GraphComponent::nodePopupMenuSelected");

    jassert (node != 0);

    currentClickedNode = node;

    bool addFirstSeparator = false;
    PopupMenu menu, subMenu;

    BasePlugin* plugin = (BasePlugin*) node->getUserData ();

    if (plugin->hasEditor ()
        || plugin->wantsEditor ()
        || plugin->isEditorInternal ())
    {
        menu.addItem (1, "Open editor");
        addFirstSeparator = true;
    }

    if (node != inputs && node != outputs)
    {
        menu.addItem (2, "Remove " + plugin->getName());
        addFirstSeparator = true;
    }

    if (addFirstSeparator)
        menu.addSeparator ();

    menu.addItem (3, "Lock", true, node->isLocked ());

    // node colour..
    ColourSelector colourSelector;
    colourSelector.setName (T("background"));
    colourSelector.setCurrentColour (node->getNodeColour ());
    colourSelector.addChangeListener (this);

    subMenu.addCustomItem (1234, &colourSelector, 300, 300, false);
    menu.addSubMenu (T("Colour"), subMenu);
    menu.addSeparator ();

    menu.addItem (4, "Mute", true, plugin->isMuted ());
    menu.addItem (5, "Bypass", true, plugin->isBypass ());
    menu.addItem (6, "Solo", false, false);
    menu.addSeparator ();

    int inputLinks = node->getInputLinksCount ();
    int outputLinks = node->getOutputLinksCount ();

    if (inputLinks > 0 && outputLinks > 0)
        menu.addItem (7, "Disconnect all");
    if (inputLinks > 0)
        menu.addItem (8, "Disconnect inputs");
    if (outputLinks > 0)
        menu.addItem (9, "Disconnect outputs");

    const int result = menu.show();
    switch (result)
    {
    case 1: // Open editor
        {
            owner->openPluginEditorWindow (plugin);
            break;
        }

    case 2: // Close
        {
            if (owner->isPluginEditorWindowOpen (plugin))
                owner->closePluginEditorWindow (plugin);

            if (plugin)
            {
                host->closePlugin (plugin);

                selectedNodes.deselect (node);
                deletePluginNode (node);

                graphChanged ();
            }

            break;
        }
    case 3: // Lock / unlock
        {
            bool lockedState = ! node->isLocked ();

            if (plugin)
                plugin->setValue (PROP_GRAPHLOCKED, lockedState);

            node->setLocked (lockedState);
            node->repaint ();
        }
        break;
    case 4: // Mute
        {
            if (plugin)
                plugin->setMuted (! plugin->isMuted());
        }
        break;
//.........这里部分代码省略.........
开发者ID:alessandropetrolati,项目名称:juced,代码行数:101,代码来源:GraphComponent.cpp

示例5: nodePopupMenuSelected

void GraphComponent::nodePopupMenuSelected (GraphNodeComponent* node)
{
    DBG ("GraphComponent::nodePopupMenuSelected");

    jassert (node != 0);

    currentClickedNode = node;

    bool addFirstSeparator = false;
    PopupMenu menu, subMenu, synthMidiChanMenu, midiChanMenu;

    BasePlugin* plugin = (BasePlugin*) node->getUserData ();

    if (plugin->hasEditor ()
        || plugin->wantsEditor ()
        || plugin->isEditorInternal ())
    {
        menu.addItem (1, "Open editor");
        menu.addItem (2, "Prefer MIDI binding editor", true, plugin->getBoolValue(PROP_WINDOWPREFERGENERIC, false));
        addFirstSeparator = true;
    }

    if (node != inputs && node != outputs)
    {
        menu.addItem (3, "Remove " + plugin->getName() + String(" \"") + plugin->getInstanceName() + String("\""));
        addFirstSeparator = true;
    }

    if (addFirstSeparator)
        menu.addSeparator ();

    menu.addItem (4, "Lock", true, node->isLocked ());

    // node colour..
    ColourSelector colourSelector;
    colourSelector.setName (T("background"));
    colourSelector.setCurrentColour (node->getNodeColour ());
    colourSelector.addChangeListener (this);

    subMenu.addCustomItem (1234, &colourSelector, 300, 300, false);
    menu.addSubMenu (T("Colour"), subMenu);
    menu.addSeparator ();

    menu.addItem (5, "Mute", true, plugin->isMuted ());
    menu.addItem (6, "Bypass", true, plugin->isBypass ());
    menu.addItem (7, "Solo", false, false);
    menu.addSeparator ();

   synthMidiChanMenu.addItem(2020, "Omni", true, !plugin->getSynthInputChannelFilter() || plugin->getSynthInputChannel() == -1);
   midiChanMenu.addItem(1020, "Omni", true, !plugin->getMidiOutputChannelFilter() || plugin->getMidiOutputChannel() == -1);
   for (int i=1; i<17; i++)
   {
      synthMidiChanMenu.addItem(2000+i, String("Ch ") + String(i), true, plugin->getSynthInputChannelFilter() && plugin->getSynthInputChannel() == i);
      midiChanMenu.addItem(1000+i, String("Ch ") + String(i), true, plugin->getMidiOutputChannelFilter() && plugin->getMidiOutputChannel() == i);
   }
   menu.addSubMenu (T("Filter synth input MIDI channel"), synthMidiChanMenu);
   menu.addSubMenu (T("Filter output MIDI channel"), midiChanMenu);
   menu.addSeparator ();

    int inputLinks = node->getInputLinksCount ();
    int outputLinks = node->getOutputLinksCount ();

    if (inputLinks > 0 && outputLinks > 0)
        menu.addItem (8, "Disconnect all");
    if (inputLinks > 0)
        menu.addItem (9, "Disconnect inputs");
    if (outputLinks > 0)
        menu.addItem (10, "Disconnect outputs");

   menu.addItem (11, String("Rename \"") + plugin->getInstanceName() + String("\""));
   menu.addItem (12, "Render stem", true, plugin->getBoolValue(PROP_RENDERSTEM, false)); // only allow changing this if stems aren't rendering right now (i.e. files aren't opened)
   
    const int result = menu.show();
    switch (result)
    {
    case 1: // Open editor
        {
            owner->openPluginEditorWindow (plugin);
            break;
        }
    case 2: // set preferred editor
      plugin->setValue(PROP_WINDOWPREFERGENERIC, !plugin->getBoolValue(PROP_WINDOWPREFERGENERIC, false));
      break;
    case 12: // set stem render option
      plugin->setValue(PROP_RENDERSTEM, !plugin->getBoolValue(PROP_RENDERSTEM, false));
      break;
    case 3: // Close
        {
            if (owner->isPluginEditorWindowOpen (plugin))
                owner->closePluginEditorWindow (plugin);

            if (plugin)
            {
                host->closePlugin (plugin);

                selectedNodes.deselect (node);
                deletePluginNode (node);

                graphChanged ();
            }
//.........这里部分代码省略.........
开发者ID:christianscheuer,项目名称:jivemodular,代码行数:101,代码来源:GraphComponent.cpp


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