SPAOP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SourceDisplay.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014 Martin Hansen
3  *
4  * This file is part of SPAOP (Spatial Audio Object Positioner).
5  *
6  * SPAOP is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * SPAOP is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with SPAOP. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef SOURCEDISPLAY_H_INCLUDED
21 #define SOURCEDISPLAY_H_INCLUDED
22 
23 #include <memory>
24 
25 #include "Room.h"
26 #include "SourceCollection.h"
28 #include "JuceHeader.h"
29 
30 namespace wonderjuce {
31 
41 {
42 public:
53  SourceDisplay(const String& componentName = String::empty,
54  int dotSize = 10, int roomLineThickness = 2,
55  const Colour roomColour = Colours::yellow,
56  const Colour bgColour = Colours::black);
57 
59  virtual ~SourceDisplay();
60 
69  void paint (Graphics& g);
70 
77  void setPositionDotSize(int diameter);
78 
85  int getPositionDotSize() const;
86 
93  bool setRoom(std::shared_ptr <const wonder::Room> room);
94 
100  void setShowNames(bool showNames);
101 
108  bool showsNames() const;
109 
110 protected:
111 
120  void paintSource(Graphics& g, const wonder::Source& source, uint8_t alpha = 0xFF);
121 
122 private:
123  std::shared_ptr <const wonder::Room> room_;
124  bool showNames_;
125  int dotSize_;
126  int roomLineThickness_;
127  Colour roomColour_;
128  Colour bgColour_;
129 
130  JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SourceDisplay)
131 };
132 
133 }
134 
135 #endif // SOURCEDISPLAY_H_INCLUDED
An abstract class extending juce::Component, adding methods to query a "focus point".
Definition: ComponentWithFocusPoint.h:32
SourceDisplay(const String &componentName=String::empty, int dotSize=10, int roomLineThickness=2, const Colour roomColour=Colours::yellow, const Colour bgColour=Colours::black)
Constructor.
Definition: SourceDisplay.cpp:25
virtual ~SourceDisplay()
Destructor.
Definition: SourceDisplay.cpp:39
void setShowNames(bool showNames)
Sets whether the names of the sources shall be shown next to them.
Definition: SourceDisplay.cpp:96
An abstract class for a GUI component that displays a two-dimensional view of WONDER sources and the ...
Definition: SourceDisplay.h:40
void paintSource(Graphics &g, const wonder::Source &source, uint8_t alpha=0xFF)
Paints a wonder::Source.
Definition: SourceDisplay.cpp:106
bool showsNames() const
Returns the current showNames setting.
Definition: SourceDisplay.cpp:101
int getPositionDotSize() const
Returns the size of the dot indicating the source's position (diameter in pixels).
Definition: SourceDisplay.cpp:80
void setPositionDotSize(int diameter)
Sets the size of the dot indicating the source's position.
Definition: SourceDisplay.cpp:72
bool setRoom(std::shared_ptr< const wonder::Room > room)
Sets the wonder::Room object that is used for painting the positions of the speaker arrays...
Definition: SourceDisplay.cpp:85
A class for objects representing a WONDER source with all its properties.
Definition: Source.h:60
void paint(Graphics &g)
Overriding juce::Component::paint, this will fill the display with its background colour and draw the...
Definition: SourceDisplay.cpp:43