コード例 #1
0
void PMixInterpolationSpaceLayout::mouseDoubleClick (const MouseEvent& e)
{
  if(graphEditor.getLassoSelection().getNumSelected() == 1)
  {
    NodeComponent* selectedItem = dynamic_cast<NodeComponent*>(graphEditor.getLassoSelection().getSelectedItem(0));
    
    if (selectedItem)
    {
      AudioProcessor* proc = audioEngine.getDoc().getNodeForId(selectedItem->nodeID)->getProcessor();
      
      bool hasParams = (proc->getNumParameters() > 0);

      if (hasParams)
      {
        if (!InternalPluginFormat::isInternalFormat(proc->getName()))
        {
          double x = (double) e.getMouseDownX()/getWidth();
          double y = (double) e.getMouseDownY()/getHeight();
          
          audioEngine.getDoc().addPreset(selectedItem->nodeID, x, y);
        }
      }
    }
  }
}
コード例 #2
0
FilterIOConfigurationWindow::FilterIOConfigurationWindow (AudioProcessor& p)
   : AudioProcessorEditor (&p),
     title ("title", p.getName())
{
    setOpaque (true);

    title.setFont (title.getFont().withStyle (Font::bold));
    addAndMakeVisible (title);

    {
        ScopedLock renderLock (p.getCallbackLock());
        p.suspendProcessing (true);
        p.releaseResources();
    }

    if (p.getBusCount (true)  > 0 || p.canAddBus (true))
    {
        inConfig.reset (new InputOutputConfig (*this, true));
        addAndMakeVisible (inConfig.get());
    }

    if (p.getBusCount (false) > 0 || p.canAddBus (false))
    {
        outConfig.reset (new InputOutputConfig (*this, false));
        addAndMakeVisible (outConfig.get());
    }

    currentLayout = p.getBusesLayout();
    setSize (400, (inConfig != nullptr && outConfig != nullptr ? 160 : 0) + 200);
}
コード例 #3
0
void PMixInterpolationSpaceLayout::mouseDown (const MouseEvent& e)
{
  selectedItems.deselectAll();
  
  if (e.mods.isPopupMenu())
  {
    if(graphEditor.getLassoSelection().getNumSelected() == 1)
    {
      NodeComponent* selectedItem = dynamic_cast<NodeComponent*>(graphEditor.getLassoSelection().getSelectedItem(0));
      
      if (selectedItem)
      {
        AudioProcessor* proc = audioEngine.getDoc().getNodeForId(selectedItem->nodeID)->getProcessor();
        
        PopupMenu m;
        
        bool hasParams = (proc->getNumParameters() > 0);

        m.addItem (1, TRANS("Add preset for node"), hasParams);
        
        const int r = m.show();
        
        if (r == 1)
        {
          if (!InternalPluginFormat::isInternalFormat(proc->getName()))
          {
            double x = (double) e.getMouseDownX()/getWidth();
            double y = (double) e.getMouseDownY()/getHeight();

            audioEngine.getDoc().addPreset(selectedItem->nodeID, x, y);
          }
        }
      }
    }
  }
  else
  {
    addChildComponent (lassoComp);
    lassoComp.beginLasso (e, this);
  }
}