view Source/GUI/GraphicsDisplayWindow.h @ 31:88287c1c2c92

Added an auxiliary MIDI input control, and moved the logging out of the window into the menu to make space in the GUI. Also updated the main window to be rescalable vertically for showing more mappings.
author Andrew McPherson <andrewm@eecs.qmul.ac.uk>
date Thu, 20 Mar 2014 00:14:00 +0000
parents 73d2ec21de9a
children 85577160a0d4
line wrap: on
line source
/*
  TouchKeys: multi-touch musical keyboard control software
  Copyright (c) 2013 Andrew McPherson

  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/>.
 
  =====================================================================

  GraphicsDisplayWindow.h: window containing an OpenGL graphics display,
  for example the KeyboardDisplay visualization.
*/

#ifndef __GRAPHICSDISPLAYWINDOW_H_AD5467BB__
#define __GRAPHICSDISPLAYWINDOW_H_AD5467BB__

#ifndef TOUCHKEYS_NO_GUI

#include "../JuceLibraryCode/JuceHeader.h"
#include "../Display/KeyboardDisplay.h"
#include "../Display/OpenGLJuceCanvas.h"

//==============================================================================
/*
*/
class GraphicsDisplayWindow    : public DocumentWindow
{
public:
    GraphicsDisplayWindow(String name, KeyboardDisplay& display)
    : DocumentWindow(name, Colours::lightgrey, DocumentWindow::allButtons),
      display_(display)
    {
        // Initialize an OpenGL graphics object as the content with a default size
        OpenGLJuceCanvas *canvas = new OpenGLJuceCanvas(display_);
        canvas->setSize(300,200);
        
        // Set properties
        setContentOwned(canvas, true);
        setUsingNativeTitleBar(true);
        setResizable(true, true);
        getConstrainer()->setFixedAspectRatio(display_.keyboardAspectRatio());
        setBoundsConstrained(getBounds());
        
        // Show window
        setVisible(true);
    }

    ~GraphicsDisplayWindow()
    {
    }
    
    void closeButtonPressed()
    {
        setVisible(false);
    }


private:
    KeyboardDisplay& display_;
    
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GraphicsDisplayWindow)
};

#endif  // TOUCHKEYS_NO_GUI

#endif  // __GRAPHICSDISPLAYWINDOW_H_AD5467BB__