Open Ephys GUI
 All Classes Functions Variables Pages
SignalGeneratorEditor.h
1 /*
2  ------------------------------------------------------------------
3 
4  This file is part of the Open Ephys GUI
5  Copyright (C) 2012 Open Ephys
6 
7  ------------------------------------------------------------------
8 
9  This program is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #ifndef __SIGNALGENERATOREDITOR_H_841A7078__
25 #define __SIGNALGENERATOREDITOR_H_841A7078__
26 
27 #include "../../../JuceLibraryCode/JuceHeader.h"
28 #include "GenericEditor.h"
29 
30 class FilterViewport;
31 class WaveformSelector;
32 
34  public Label::Listener
35 {
36 public:
38  virtual ~SignalGeneratorEditor();
39  void sliderEvent(Slider* slider);
40  void buttonEvent(Button* button);
41  void labelTextChanged(Label* label);
42 
43  void addParameterEditors() {}
44 
45 private:
46 
47  Label* numChannelsLabel;
48  TriangleButton* upButton;
49  TriangleButton* downButton;
50 
51  Slider* amplitudeSlider;
52  Slider* frequencySlider;
53  Slider* phaseSlider;
54 
55  Array<WaveformSelector*> waveformSelectors;
56 
57  enum wvfrm
58  {
59  SINE, SQUARE, SAW, TRIANGLE, NOISE
60  };
61 
62  JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SignalGeneratorEditor);
63 
64 };
65 
66 class WaveformSelector : public Button
67 {
68 public:
69  WaveformSelector(int type_);
70  ~WaveformSelector() {}
71 private:
72  void paintButton(Graphics& g, bool isMouseOver, bool isButtonDown);
73 
74  int type;
75 
76  Image neutral;
77  Image neutralOver;
78  Image selected;
79  Image selectedOver;
80 
81 };
82 
83 
84 #endif // __SIGNALGENERATOREDITOR_H_841A7078__