21#include <JuceHeader.h>
68 void paint(Graphics&)
override;
73 bool hitTest(
int x,
int y)
override;
75 void mouseDown(
const juce::MouseEvent& e)
override;
77 void mouseDrag(
const juce::MouseEvent& e)
override;
79 void mouseUp(
const juce::MouseEvent& e)
override;
83 void setSourcePositions(
const std::map<std::int16_t, std::array<std::float_t, 3>>& sourcePositions);
89 void setSourcePosition(std::int16_t sourceId,
const std::array<std::float_t, 3>& position);
111 void onZoomChanged()
override;
113 void PrerenderSourcesInBounds();
116 std::map<std::int16_t, std::array<std::float_t, 3>> m_sourcePositions;
117 std::map<std::int16_t, juce::Point<int>> m_sourceScreenPositions;
118 std::set<std::int16_t> m_sourceIdFilter;
120 std::int16_t m_draggedSourceId{ -1 };
Abstract base class for all three overlaid visualisation layers in UmsciControlComponent.
The middle layer of the UmsciControlComponent stack — paints a filled circle for each sound object an...
void setSourcePosition(std::int16_t sourceId, const std::array< std::float_t, 3 > &position)
Updates a single source position.
UmsciSoundobjectsPaintComponent()
void paint(Graphics &) override
void setSourcePositions(const std::map< std::int16_t, std::array< std::float_t, 3 > > &sourcePositions)
Replaces all source positions at once (e.g. on reconnect or initial query).
~UmsciSoundobjectsPaintComponent() override
void setSourceIdFilter(const std::set< std::int16_t > &allowedIds)
Restricts rendering and interaction to the given set of source IDs. An empty set means no sources are...
void mouseDrag(const juce::MouseEvent &e) override
Converts the drag position to world coordinates and fires onSourcePositionChanged.
std::function< void(std::int16_t, std::array< std::float_t, 3 >)> onSourcePositionChanged
Fired during a drag with the new world position. UmsciControlComponent receives this and calls Device...
void mouseDown(const juce::MouseEvent &e) override
Identifies which source is under the cursor and begins a drag.
void mouseUp(const juce::MouseEvent &e) override
Clears the active drag state.
bool hitTest(int x, int y) override
Returns true only when the point falls within a rendered source circle.