view Source/GUI/ControlWindowMainComponent.h @ 20:dfff66c07936

Lots of minor changes to support building on Visual Studio. A few MSVC-specific #ifdefs to eliminate things Visual Studio doesn't like. This version now compiles on Windows (provided liblo, Juce and pthread are present) but the TouchKeys device support is not yet enabled. Also, the code now needs to be re-checked on Mac and Linux.
author Andrew McPherson <andrewm@eecs.qmul.ac.uk>
date Sun, 09 Feb 2014 18:40:51 +0000
parents 73d2ec21de9a
children 90069a503079
line wrap: on
line source
/*
  ==============================================================================

  This is an automatically generated GUI class created by the Introjucer!

  Be careful when adding custom code to these files, as only the code within
  the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
  and re-saved.

  Created with Introjucer version: 3.1.0

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

  The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
  Copyright 2004-13 by Raw Material Software Ltd.

  ==============================================================================
*/

#ifndef __JUCE_HEADER_FD693E32C8291DFA__
#define __JUCE_HEADER_FD693E32C8291DFA__

//[Headers]     -- You can add your own extra header files here --
#include "JuceHeader.h"
#include "../MainApplicationController.h"
//[/Headers]



//==============================================================================
/**
                                                                    //[Comments]
    An auto-generated component, created by the Introjucer.

    Describe your class and how it works here!
                                                                    //[/Comments]
*/
class ControlWindowMainComponent  : public Component,
                                    public TextEditor::Listener,
                                    public ComboBoxListener,
                                    public ButtonListener
{
public:
    //==============================================================================
    ControlWindowMainComponent ();
    ~ControlWindowMainComponent();

    //==============================================================================
    //[UserMethods]     -- You can add your own custom methods in this section.
    void setMainApplicationController(MainApplicationController *controller) {
        // Attach the user interface to the controller and vice-versa
        controller_ = controller;
        updateInputDeviceList();
    }

    // TextEditor listener methods
    void textEditorTextChanged(TextEditor &editor) {}
    void textEditorReturnKeyPressed(TextEditor &editor);
    void textEditorEscapeKeyPressed(TextEditor &editor);
    void textEditorFocusLost(TextEditor &editor);

    void synchronize();
    
    // Return the currently selected TouchKeys string
    String currentTouchkeysSelectedPath();
    //[/UserMethods]

    void paint (Graphics& g);
    void resized();
    void comboBoxChanged (ComboBox* comboBoxThatHasChanged);
    void buttonClicked (Button* buttonThatWasClicked);



private:
    //[UserVariables]   -- You can add your own custom variables in this section.
    enum {
        // Offsets between Juce UI IDs and positions in vector
        kMidiInputDeviceComboBoxOffset = 3,
        kTouchkeysComponentComboBoxOffset = 1,
        kTouchkeysMaxOctave = 6
    };

    void updateInputDeviceList();
    void updateOscHostPort();
    void updateKeyboardSegments();

    MainApplicationController *controller_; // Pointer to the main application controller
    std::vector<int> midiInputDeviceIDs_;
    int lastSelectedMidiInputID_;
    int lastSegmentUniqueIdentifier_;
    //[/UserVariables]

    //==============================================================================
    ScopedPointer<GroupComponent> dataLoggingGroupComponent;
    ScopedPointer<GroupComponent> midiInputGroupComponent;
    ScopedPointer<ComboBox> midiInputDeviceComboBox;
    ScopedPointer<Label> label;
    ScopedPointer<GroupComponent> groupComponent;
    ScopedPointer<Label> label2;
    ScopedPointer<ComboBox> touchkeyDeviceComboBox;
    ScopedPointer<Label> label3;
    ScopedPointer<TextButton> touchkeyStartButton;
    ScopedPointer<Label> touchkeyStatusLabel;
    ScopedPointer<GroupComponent> oscGroupComponent;
    ScopedPointer<Label> label7;
    ScopedPointer<TextEditor> oscHostTextEditor;
    ScopedPointer<Label> label8;
    ScopedPointer<TextEditor> oscPortTextEditor;
    ScopedPointer<ToggleButton> oscEnableButton;
    ScopedPointer<ToggleButton> oscEnableRawButton;
    ScopedPointer<Label> label4;
    ScopedPointer<ComboBox> touchkeyOctaveComboBox;
    ScopedPointer<TextButton> loggingButton;
    ScopedPointer<GroupComponent> oscInputGroupComponent;
    ScopedPointer<ToggleButton> oscInputEnableButton;
    ScopedPointer<Label> label6;
    ScopedPointer<TextEditor> oscInputPortTextEditor;
    ScopedPointer<TextButton> playLogButton;
    ScopedPointer<TabbedComponent> keyboardZoneTabbedComponent;
    ScopedPointer<TextButton> addZoneButton;
    ScopedPointer<TextButton> removeZoneButton;
    ScopedPointer<TextButton> touchkeyAutodetectButton;


    //==============================================================================
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ControlWindowMainComponent)
};

//[EndFile] You can add extra defines here...
//[/EndFile]

#endif   // __JUCE_HEADER_FD693E32C8291DFA__