Beispiel #1
0
//==============================================================================
SidebarPanel::SidebarPanel(FilterGraph* graph) :
    filterGraph(graph),
    previousFilterNodeId(-99),
    thread ("file preview"),
    directoryList (nullptr, thread),
    fileTreeComp (*this, "Browser", directoryList),
    canResize(false),
    transportControls(*this, " "),
    midiBubble(250),
    midiLearn(false)
{
    setOpaque (true);
    addAndMakeVisible (concertinaPanel);

    midiBubble.setColour(BubbleComponent::backgroundColourId, Colours::white);
    midiBubble.setBounds(0, 0, 50, 20);
    addChildComponent(midiBubble);
    midiBubble.setAlwaysOnTop(true);

    directoryList.setDirectory (File::getSpecialLocation (File::userHomeDirectory), true, true);
    thread.startThread (3);

    fileTreeComp.setText(File::getSpecialLocation (File::userHomeDirectory).getFileNameWithoutExtension());

    fileTreeComp.fileComp.addListener (this);

    filterGraph->addActionListener(this);

    PropertyPanel* transportPanel = new PropertyPanel ("Transport Controls");
    Array <PropertyComponent*> transport;
    transport.add(&transportControls);
    transportPanel->addProperties(transport);
    concertinaPanel.addPanel(TRANSPORT_CONTROLS, transportPanel, false);
    concertinaPanel.setMaximumPanelSize(concertinaPanel.getPanel(TRANSPORT_CONTROLS), 70);

    PropertyPanel* panel = new PropertyPanel ("Plugins");

    Array <PropertyComponent*> params;

    addPluginPanel (panel);


    PropertyPanel* filePanel = new PropertyPanel ("File Browser");
    Array <PropertyComponent*> singleParams;
    singleParams.add(&fileTreeComp);
    filePanel->addProperties(singleParams);

    concertinaPanel.addPanel(FILE_BROWSER, filePanel, false);
    concertinaPanel.expandPanelFully(concertinaPanel.getPanel(TRANSPORT_CONTROLS), true);

}
void ComponentTypeHandler::addPropertiesToPropertyPanel (Component* comp, JucerDocument& document, PropertyPanel& panel)
{
    Array <PropertyComponent*> props;
    getEditableProperties (comp, document, props);

    panel.addSection (getClassName (comp), props);
}
void ButtonDocument::addExtraClassProperties (PropertyPanel& panel)
{
    Array <PropertyComponent*> props;

    for (int i = 1; i < 7; ++i)
        props.add (new ButtonStatePaintEnabledProperty (stateNames[i], *this, i));

    panel.addSection ("Button paint routines", props);
}
Beispiel #4
0
Component *Quadmesh::getController()
{
    Array<PropertyComponent*> props;
    if (vertexPositionsFunction) {
        /* don't expose resolution control if reading from a table */
        props.add(new SliderPropertyComponent(getTrait("resolution"), "resolution", 3, 512, 1));
    }

    props.add(new BooleanPropertyComponent(getTrait("renderAsWireframe"), "renderAsWireframe", ""));
    props.add(getColorChoicePropertyComponent(getTrait("solidColor"), "solidColor"));
    
    props.add(new BooleanPropertyComponent(getTrait("drawMesh"), "drawMesh", ""));
    props.add(new SliderPropertyComponent(getTrait("meshOutlinesWidth"), "meshOutlinesWidth", 0.01, 0.5, 0.01));
    props.add(new SliderPropertyComponent(getTrait("meshOutlinesSoftness"), "meshOutlinesSoftness", 0.01, 1.0, 0.01));

    PropertyPanel *propertyPanel = new PropertyPanel;
    propertyPanel->addProperties(props);
    propertyPanel->setBounds(0, 0, 256, propertyPanel->getTotalContentHeight());
    return propertyPanel;
}
Beispiel #5
0
//=================================================================
void SidebarPanel::refreshPluginParameters()
{
    PropertyPanel* panel = (PropertyPanel*)concertinaPanel.getPanel(PLUGIN_PARAMS);
    panel->clear();

    Array <PropertyComponent*> params;

    for(int index=0; index<filterGraph->getNumFilters(); index++)
    {
        int numParams = filterGraph->getNode(index)->getProcessor()->getNumParameters();
        const AudioProcessorGraph::Node::Ptr f = filterGraph->getNode(index);
        params.clear();

        for (int i = 0; i < numParams; ++i)
        {
            String name (filterGraph->getNode(index)->getProcessor()->getParameterName (i));
            if (name.trim().isEmpty())
                name = "Unnamed";

            ProcessorParameterPropertyComp* const pc = new ProcessorParameterPropertyComp(name,
                    *filterGraph->getNode(index)->getProcessor(),
                    i,
                    filterGraph->getNode(index)->nodeId);
            pc->addChangeListener(this);
            //pc->setLookAndFeel(&this->getLookAndFeel());
            //pc->lookAndFeelChanged();
            params.add (pc);
        }

        if(f->properties.getWithDefault("pluginType", "")!="Internal")
        {
            const String pluginName = filterGraph->getNode(index)->properties.getWithDefault("pluginName", "");
            panel->addSection(pluginName, params, false);
        }
    }


    concertinaPanel.expandPanelFully(concertinaPanel.getPanel(PLUGIN_PARAMS), true);
}
Beispiel #6
0
//=================================================================
void SidebarPanel::updatePluginParameters()
{
    PropertyPanel* panel = (PropertyPanel*)concertinaPanel.getPanel(PLUGIN_PARAMS);
    //panel->clear();

    Array <PropertyComponent*> params;

    int index = filterGraph->getNumFilters()-1;

    int numParams = filterGraph->getNode(index)->getProcessor()->getNumParameters();

    if(numParams==0)
        return;

    params.clear();
    for (int i = 0; i < numParams; ++i)
    {
        String name (filterGraph->getNode(index)->getProcessor()->getParameterName (i));
        if (name.trim().isEmpty())
            name = "Unnamed";

        ProcessorParameterPropertyComp* const pc = new ProcessorParameterPropertyComp(name,
                *filterGraph->getNode(index)->getProcessor(),
                i,
                filterGraph->getNode(index)->nodeId);
        pc->addChangeListener(this);
        params.add (pc);
    }

    const String pluginName = filterGraph->getNode(index)->properties.getWithDefault("pluginName", "");
    panel->addSection(pluginName, params, false);


    for(int y=0; y<panel->getSectionNames().size()-1; y++)
        panel->setSectionOpen(y, false, true);

    panel->setSectionOpen(panel->getSectionNames().size()-1, true, true);

    concertinaPanel.expandPanelFully(concertinaPanel.getPanel(PLUGIN_PARAMS), true);

}