void GenericEditor::refreshColors() { //std::cout << getName() << " refreshing colors." << std::endl; enum { PROCESSOR_COLOR = 801, FILTER_COLOR = 802, SINK_COLOR = 803, SOURCE_COLOR = 804, UTILITY_COLOR = 805, }; if (getProcessor()->isSource()) backgroundColor = getProcessorList()->findColour(SOURCE_COLOR);// Colour(255, 0, 0);//Colour(int(0.9*255.0f),int(0.019*255.0f),int(0.16*255.0f)); else if (getProcessor()->isSink()) backgroundColor = getProcessorList()->findColour(SINK_COLOR);//Colour(255, 149, 0);//Colour(int(0.06*255.0f),int(0.46*255.0f),int(0.9*255.0f)); else if (getProcessor()->isSplitter() || getProcessor()->isMerger() || getProcessor()->isUtility()) backgroundColor = getProcessorList()->findColour(UTILITY_COLOR);//Colour(40, 40, 40);//Colour(int(0.7*255.0f),int(0.7*255.0f),int(0.7*255.0f)); else backgroundColor = getProcessorList()->findColour(FILTER_COLOR);//Colour(255, 89, 0);//Colour(int(1.0*255.0f),int(0.5*255.0f),int(0.0*255.0f)); repaint(); }
UIComponent::UIComponent(MainWindow* mainWindow_, ProcessorGraph* pgraph, AudioComponent* audio_) : mainWindow(mainWindow_), processorGraph(pgraph), audio(audio_) { processorGraph->createDefaultNodes(); messageCenterEditor = (MessageCenterEditor*) processorGraph->getMessageCenter()->createEditor(); addActionListener(messageCenterEditor); addAndMakeVisible(messageCenterEditor); std::cout << "Created message center." << std::endl; infoLabel = new InfoLabel(); std::cout << "Created info label." << std::endl; graphViewer = new GraphViewer(); std::cout << "Created graph viewer." << std::endl; dataViewport = new DataViewport(); addChildComponent(dataViewport); dataViewport->addTabToDataViewport("Info", infoLabel,0); dataViewport->addTabToDataViewport("Graph", graphViewer,0); std::cout << "Created data viewport." << std::endl; editorViewport = new EditorViewport(); addAndMakeVisible(editorViewport); std::cout << "Created filter viewport." << std::endl; editorViewportButton = new EditorViewportButton(this); addAndMakeVisible(editorViewportButton); controlPanel = new ControlPanel(processorGraph, audio); addAndMakeVisible(controlPanel); std::cout << "Created control panel." << std::endl; processorList = new ProcessorList(); processorListViewport.setViewedComponent(processorList,false); processorListViewport.setScrollBarsShown(true,false); addAndMakeVisible(&processorListViewport); processorList->setVisible(true); processorList->setBounds(0,0,195,processorList->getTotalHeight()); std::cout << "Created filter list." << std::endl; pluginManager = new PluginManager(); std::cout << "Created plugin manager" << std::endl; setBounds(0,0,500,400); AccessClass::setUIComponent(this); getPluginManager()->loadAllPlugins(); getProcessorList()->fillItemList(); controlPanel->updateChildComponents(); processorGraph->updatePointers(); // needs to happen after processorGraph gets the right pointers #if JUCE_MAC MenuBarModel::setMacMainMenu(this); mainWindow->setMenuBar(0); #else mainWindow->setMenuBar(this); #endif }