20 #ifndef SOURCEPANEL_H_INCLUDED
21 #define SOURCEPANEL_H_INCLUDED
23 #define OTHER_SOURCES_ALPHA 80
31 #include "JuceHeader.h"
33 namespace wonderjuce {
40 class SourcePanel :
public SourceDisplay
43 SourcePanel(
const String& componentName = String::empty);
49 void paint (Graphics& g);
52 void mouseDown(
const MouseEvent &event)
override;
55 void mouseDrag(
const MouseEvent &event)
override;
58 void mouseUp(
const MouseEvent &event)
override;
129 bool setSources(std::shared_ptr<const wonder::SourceCollection> sources);
164 std::shared_ptr<const wonder::SourceCollection> sources_;
168 ListenerList <Listener> listeners;
170 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (
SourcePanel)
177 #endif // SOURCEPANEL_H_INCLUDED
float getYPos()
Returns the y coordinate of the source controlled by this SourcePanel, normalized within [0...
Definition: SourcePanel.cpp:134
virtual ~SourcePanel()
Destructor.
Definition: SourcePanel.cpp:37
Point< float > getFocusPoint()
Returns the "focus point", the point where this component shall be auto-centered (for example...
Definition: SourcePanel.cpp:191
void mouseDrag(const MouseEvent &event) override
Definition: SourcePanel.cpp:93
float getFocusPointX()
Returns the x-coordinate of the "focus point".
Definition: SourcePanel.cpp:181
virtual ~Listener()
Destructor.
Definition: SourcePanel.h:88
void mouseDown(const MouseEvent &event) override
Definition: SourcePanel.cpp:73
void paint(Graphics &g)
Definition: SourcePanel.cpp:41
void mouseUp(const MouseEvent &event) override
Definition: SourcePanel.cpp:118
virtual void sourcePanelValuesChanged(SourcePanel *panel)=0
Called when the SourcePanel's value is changed.
SourcePanel(const String &componentName=String::empty)
Definition: SourcePanel.cpp:26
A GUI component that displays a two-dimensional view of a source's position and allows the re-positio...
Definition: SourcePanel.h:41
void removeListener(Listener *listener)
Removes a previously-registered listener.
Definition: SourcePanel.cpp:144
void addListener(Listener *listener)
Adds a listener to be called when this panel's values change.
Definition: SourcePanel.cpp:139
virtual void sourcePanelDragStarted(SourcePanel *panel)
Called when the position-dot is about to be dragged.
Definition: SourcePanel.h:98
A class for receiving callbacks from a SourcePanel.
Definition: SourcePanel.h:84
virtual void sourcePanelDragEnded(SourcePanel *panel)
Called after a drag operation has finished.
Definition: SourcePanel.h:114
float getFocusPointY()
Returns the y-coordinate of the "focus point".
Definition: SourcePanel.cpp:186
bool setSources(std::shared_ptr< const wonder::SourceCollection > sources)
Sets the SourceCollection object that holds the information about the sources to be displayed...
Definition: SourcePanel.cpp:149
bool setSource(int sourceID)
Sets the ID of the source to be shown as the main source that can be controlled using this SourcePane...
Definition: SourcePanel.cpp:160
void setShowOtherSources(bool showOthers)
Sets whether the other sources (not controlled by this panel) shall be shown.
Definition: SourcePanel.cpp:171
float getXPos()
Returns the x coordinate of the source controlled by this SourcePanel, normalized within [0...
Definition: SourcePanel.cpp:129
bool showsOtherSources() const
Returns the current showOtherSources setting.
Definition: SourcePanel.cpp:176