Skip to content
Snippets Groups Projects
UIComponent.cpp 20.03 KiB
/*
    ------------------------------------------------------------------

    This file is part of the Open Ephys GUI
    Copyright (C) 2013 Open Ephys

    ------------------------------------------------------------------

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/

#include "UIComponent.h"
#include <stdio.h>

UIComponent::UIComponent(MainWindow* mainWindow_, ProcessorGraph* pgraph, AudioComponent* audio_)
    : mainWindow(mainWindow_), processorGraph(pgraph), audio(audio_)

{

    processorGraph->setUIComponent(this);

    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;

    messageCenter = new MessageCenter();
    addActionListener(messageCenter);