SPAOP
|
A GUI component that displays a two-dimensional view of a source's position and allows the re-positioning by mouse actions. More...
#include <SourcePanel.h>
Classes | |
class | Listener |
A class for receiving callbacks from a SourcePanel. More... | |
Public Member Functions | |
SourcePanel (const String &componentName=String::empty) | |
virtual | ~SourcePanel () |
Destructor. More... | |
void | paint (Graphics &g) |
void | mouseDown (const MouseEvent &event) override |
void | mouseDrag (const MouseEvent &event) override |
void | mouseUp (const MouseEvent &event) override |
float | getXPos () |
Returns the x coordinate of the source controlled by this SourcePanel, normalized within [0.0 ; 1.0]. More... | |
float | getYPos () |
Returns the y coordinate of the source controlled by this SourcePanel, normalized within [0.0 ; 1.0]. More... | |
void | addListener (Listener *listener) |
Adds a listener to be called when this panel's values change. More... | |
void | removeListener (Listener *listener) |
Removes a previously-registered listener. More... | |
bool | setSources (std::shared_ptr< const wonder::SourceCollection > sources) |
Sets the SourceCollection object that holds the information about the sources to be displayed. More... | |
bool | setSource (int sourceID) |
Sets the ID of the source to be shown as the main source that can be controlled using this SourcePanel. More... | |
void | setShowOtherSources (bool showOthers) |
Sets whether the other sources (not controlled by this panel) shall be shown. More... | |
bool | showsOtherSources () const |
Returns the current showOtherSources setting. More... | |
float | getFocusPointX () |
Returns the x-coordinate of the "focus point". More... | |
float | getFocusPointY () |
Returns the y-coordinate of the "focus point". More... | |
Point< float > | getFocusPoint () |
Returns the "focus point", the point where this component shall be auto-centered (for example, when it is zoomed into). More... | |
Public Member Functions inherited from wonderjuce::SourceDisplay | |
SourceDisplay (const String &componentName=String::empty, int dotSize=10, int roomLineThickness=2, const Colour roomColour=Colours::yellow, const Colour bgColour=Colours::black) | |
Constructor. More... | |
virtual | ~SourceDisplay () |
Destructor. More... | |
void | paint (Graphics &g) |
Overriding juce::Component::paint, this will fill the display with its background colour and draw the speaker arrays. More... | |
void | setPositionDotSize (int diameter) |
Sets the size of the dot indicating the source's position. More... | |
int | getPositionDotSize () const |
Returns the size of the dot indicating the source's position (diameter in pixels). More... | |
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. More... | |
void | setShowNames (bool showNames) |
Sets whether the names of the sources shall be shown next to them. More... | |
bool | showsNames () const |
Returns the current showNames setting. More... | |
Public Member Functions inherited from wonderjuce::ComponentWithFocusPoint | |
ComponentWithFocusPoint (const String &componentName=String::empty) | |
Constructor. More... | |
virtual | ~ComponentWithFocusPoint () |
Destructor. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from wonderjuce::SourceDisplay | |
void | paintSource (Graphics &g, const wonder::Source &source, uint8_t alpha=0xFF) |
Paints a wonder::Source. More... | |
A GUI component that displays a two-dimensional view of a source's position and allows the re-positioning by mouse actions.
wonderjuce::SourcePanel::SourcePanel | ( | const String & | componentName = String::empty | ) |
|
virtual |
Destructor.
void wonderjuce::SourcePanel::addListener | ( | SourcePanel::Listener * | listener | ) |
Adds a listener to be called when this panel's values change.
|
virtual |
Returns the "focus point", the point where this component shall be auto-centered (for example, when it is zoomed into).
Implements wonderjuce::ComponentWithFocusPoint.
|
virtual |
Returns the x-coordinate of the "focus point".
Implements wonderjuce::ComponentWithFocusPoint.
|
virtual |
Returns the y-coordinate of the "focus point".
Implements wonderjuce::ComponentWithFocusPoint.
float wonderjuce::SourcePanel::getXPos | ( | ) |
Returns the x coordinate of the source controlled by this SourcePanel, normalized within [0.0 ; 1.0].
float wonderjuce::SourcePanel::getYPos | ( | ) |
Returns the y coordinate of the source controlled by this SourcePanel, normalized within [0.0 ; 1.0].
|
override |
|
override |
|
override |
void wonderjuce::SourcePanel::paint | ( | Graphics & | g | ) |
void wonderjuce::SourcePanel::removeListener | ( | SourcePanel::Listener * | listener | ) |
Removes a previously-registered listener.
void wonderjuce::SourcePanel::setShowOtherSources | ( | bool | showOthers | ) |
Sets whether the other sources (not controlled by this panel) shall be shown.
showOthers | true if the other sources (not controlled by this panel) shall be shown. |
bool wonderjuce::SourcePanel::setSource | ( | int | sourceID | ) |
Sets the ID of the source to be shown as the main source that can be controlled using this SourcePanel.
sourceID | The ID of the source to be shown as the main source. |
bool wonderjuce::SourcePanel::setSources | ( | std::shared_ptr< const wonder::SourceCollection > | sources | ) |
Sets the SourceCollection object that holds the information about the sources to be displayed.
This may only be set once.
sources | A (reference-counted) std::shared_ptr pointing to the SourceCollection object. |
bool wonderjuce::SourcePanel::showsOtherSources | ( | ) | const |
Returns the current showOtherSources setting.
If this is true, the other sources (not controlled by this panel) are shown.