21#include <JuceHeader.h>
25#include <TwoDFieldBase.h>
112 if (
name ==
"Rectangle")
114 else if (
name ==
"Circle")
129 void mouseDown(
const juce::MouseEvent&)
override;
130 void mouseDrag(
const juce::MouseEvent&)
override;
131 void mouseUp(
const juce::MouseEvent&)
override;
233 void onZoomChanged()
override;
243 struct RenderedChannelPosition
245 std::int16_t sourceId = 0;
246 juce::Point<float> screenPos;
247 std::array<float, 3> realPos = { 0.0f, 0.0f, 0.0f };
257 void PrerenderUpmixIndicatorInBounds();
259 void updateFlashState();
261 juce::Rectangle<int> getRefitButtonBounds()
const;
264 int m_sourceStartId = 1;
267 std::array<float, 6> m_speakersRealBoundingCube;
268 std::map<std::int16_t, std::array<std::float_t, 3>> m_sourcePositions;
270 float m_boundingFitFactor = 0.15f;
273 juce::Path m_upmixIndicator;
274 juce::Path m_upmixHeightIndicator;
275 juce::Path m_centerHandlePath;
276 juce::Path m_stretchHandlePath;
278 float m_upmixRot = 0.0f;
279 float m_upmixTrans = 1.0f;
280 float m_upmixHeightTrans = 0.6f;
282 juce::Point<float> m_upmixCenter;
283 float m_subCircleRadius = 15.0f;
284 std::vector<RenderedChannelPosition> m_renderedFloorPositions;
285 std::vector<RenderedChannelPosition> m_renderedHeightPositions;
287 float m_upmixAngleStretch = 1.0f;
288 float m_naturalFloorMaxAngleDeg = 110.0f;
289 juce::Point<float> m_stretchHandlePos;
290 juce::Point<float> m_stretchHandleTangent;
292 float m_upmixOffsetX = 0.0f;
293 float m_upmixOffsetY = 0.0f;
294 float m_baseRadius = 100.0f;
297 bool m_draggingHeightRing =
false;
298 bool m_draggingStretchHandle =
false;
299 bool m_draggingCenterHandle =
false;
300 float m_dragStartAngle = 0.0f;
301 float m_dragStartDist = 0.0f;
302 float m_dragStartRot = 0.0f;
303 float m_dragStartTrans = 0.0f;
304 float m_dragStartHeightTrans = 0.6f;
305 float m_dragStartStretch = 1.0f;
306 float m_dragStartOffsetX = 0.0f;
307 float m_dragStartOffsetY = 0.0f;
308 juce::Point<float> m_dragStartMousePos;
310 bool m_flashState =
false;
311 bool m_liveMode =
false;
316 int m_inhibitFlashCount = 0;
Abstract base class for all three overlaid visualisation layers in UmsciControlComponent.
ControlsSize
Visual size of source/speaker icons. Multiplier accessible via getControlsSizeMultiplier().
The top layer of the UmsciControlComponent stack — renders an interactive upmix speaker ring and lets...
void mouseDrag(const juce::MouseEvent &) override
IndicatorShape
The geometric shape used to draw the upmix speaker ring.
IndicatorShape getShape() const
void notifyTransformChanged()
Fires live-mode position callbacks and onTransformChanged after a programmatic transform change (e....
bool hitTest(int x, int y) override
void mouseDoubleClick(const juce::MouseEvent &) override
void setUpmixTransform(float rot, float trans, float heightTrans, float angleStretch=1.0f)
Applies all four transform parameters and triggers a prerender + repaint.
UmsciUpmixIndicatorPaintNControlComponent()
void triggerFlashCheck()
Checks whether the ideal ring positions diverge from the stored DS100 positions and starts the flash ...
std::function< void()> onTransformChanged
Fired whenever any transform parameter changes via an interactive drag, so UmsciControlComponent can ...
float getUpmixAngleStretch() const
Front/rear angular compression factor.
~UmsciUpmixIndicatorPaintNControlComponent() override
float getUpmixRot() const
Ring rotation (normalised 0–1 = 0–360°).
void setLiveMode(bool liveMode)
When true, actual DS100 positions for the upmix channels are overlaid on the ideal indicator ring so ...
int getSourceStartId() const
void timerCallback() override
float getUpmixOffsetY() const
void paint(Graphics &) override
void mouseUp(const juce::MouseEvent &) override
void setSourcePosition(std::int16_t sourceId, const std::array< std::float_t, 3 > &position)
Updates a single source position (called on each OCP.1 notification).
void setControlsSize(ControlsSize size) override
Updates the icon size; derived classes may override to re-prerender.
void setSpeakersRealBoundingCube(const std::array< float, 6 > &speakersRealBoundingCube)
Provides the axis-aligned bounding cube of all loudspeaker positions.
void mouseDown(const juce::MouseEvent &) override
float getUpmixHeightTrans() const
Height ring radius as a fraction of floor radius.
bool setChannelConfiguration(const juce::AudioChannelSet &channelLayout) override
void setSourcePositions(const std::map< std::int16_t, std::array< std::float_t, 3 > > &sourcePositions)
Provides live DS100 source positions for all upmix channels. Only rendered when m_liveMode is true.
static IndicatorShape getShapeForName(const juce::String &name)
void setSourceStartId(int startId)
Sets the first DS100 input channel (1-based) assigned to the upmix renderer.
void setUpmixOffset(float x, float y)
Sets the ring centre offset in units of base radius.
static juce::String getShapeName(IndicatorShape shape)
float getUpmixTrans() const
Radial scale factor.
float getUpmixOffsetX() const
void setShape(IndicatorShape shape)
Sets the indicator ring geometry (circle or rectangle).
std::function< void(std::int16_t, std::array< std::float_t, 3 >)> onSourcePositionChanged
Fired when the user drags a source circle in live mode (pass-through from this component,...