Example #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);

}
Example #2
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;
}