void StandaloneFilterWindow::loadFile(String filename)
{
    File file(filename);
    pluginHolder->stopPlaying();
    pluginHolder->reloadAudioDeviceState();
    deleteEditorComp();
    pluginHolder->deletePlugin();

    if(file.existsAsFile())
    {
        //cUtils::showMessage(file.loadFileAsString());
        float originalPluginWidth=100;
        float originalPluginHeight=100;
        StringArray csdArray;
        csdArray.addLines(file.loadFileAsString());
        for(int i=0; i<csdArray.size(); i++)
        {
            if(csdArray[i].contains("form "))
            {
                CabbageGUIType cAttr(csdArray[i], -99);
                originalPluginWidth = cAttr.getNumProp(CabbageIDs::width);
                originalPluginHeight = cAttr.getNumProp(CabbageIDs::height);
                this->getProperties().set("colour", cAttr.getStringProp(CabbageIDs::colour));
                this->lookAndFeelChanged();
            }
        }

        Point<float> scale;

        if(originalPluginWidth>=originalPluginHeight)
        {
            scale = Point<float>(desktopRect.getWidth()/originalPluginWidth,
                                 (desktopRect.getHeight()/originalPluginHeight)*.95);
        }
        else
        {
            scale = Point<float>(desktopRect.getHeight()/originalPluginHeight,
                                 (desktopRect.getHeight()/originalPluginHeight)*.95);
        }

        pluginHolder->createPlugin(file.getFullPathName(), scale);
        AudioProcessorEditor* ed = createEditorComp();
        setContentOwned(ed, true);
        //createEditorComp();

        ed->setSize(desktopRect.getWidth(), desktopRect.getHeight());
        //this->resized();

        setName(pluginHolder->processor->getName());
        pluginHolder->startPlaying();

    }

}
Example #2
0
void SidebarPanel::actionListenerCallback (const String &message)
{
    if(concertinaPanel.getPanel(WIDGET_PROPS))
    {
        ((CabbagePropertiesPanel*)concertinaPanel.getPanel(WIDGET_PROPS))->removeAllChangeListeners();
        concertinaPanel.removePanel(concertinaPanel.getPanel(WIDGET_PROPS));
    }

    CabbageGUIClass cAttr(message, -1);
    CabbagePropertiesPanel* panel = new CabbagePropertiesPanel("Widget Properties");
    panel->updateProperties(cAttr);
    panel->addChangeListener(filterGraph);

    concertinaPanel.addPanel(WIDGET_PROPS, panel, true);
    concertinaPanel.expandPanelFully(concertinaPanel.getPanel(WIDGET_PROPS), true);
}
Node PaintBrush::imageNode(int dimX, int dimY, bool transform)
{
    Node result("extension");
    Attribute cAttr("class", "eurecom.usergraph.UserGraph");
    result.addAttribute(cAttr);
    Logger::entry("info") << "dimX = " << dimX;
    Logger::entry("info") << "dimY = " << dimY;
    if (!actions_.empty())
    {
        if (transform)
            result.addChildren(vertexNodes(transformVertices(dimX, dimY)));
        else
            result.addChildren(vertexNodes(vertexList_));
        result.addChildren(edgeNodes());
    }
    return result;
}