Umsci
Upmix Spatial Control Interface — OCA/OCP.1 spatial audio utility
Loading...
Searching...
No Matches
UmsciLoudspeakersPaintComponent.h
Go to the documentation of this file.
1/* Copyright (c) 2026, Christian Ahrens
2 *
3 * This file is part of Umsci <https://github.com/ChristianAhrens/Umsci>
4 *
5 * This tool is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License version 3.0 as published
7 * by the Free Software Foundation.
8 *
9 * This tool is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 * details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this tool; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#pragma once
20
21#include <JuceHeader.h>
22
24
25
50{
51public:
54
55 //==============================================================================
56 void paint(Graphics&) override;
57 void resized() override;
59 void lookAndFeelChanged() override;
61 void setControlsSize(ControlsSize size) override;
62
63 //==============================================================================
65 void setSpeakerPositions(const std::map<std::int16_t, std::array<std::float_t, 6>>& speakerPositions);
71 void setSpeakerPosition(std::int16_t speakerId, const std::array<std::float_t, 6>& position);
72
73private:
74 //==============================================================================
76 void onZoomChanged() override;
82 void PrerenderSpeakerDrawable(std::int16_t speakerId, const std::array<std::float_t, 6>& rotNPos);
84 void PrerenderSpeakersInBounds();
85
86 //==============================================================================
87 juce::Colour m_speakerDrawablesCurrentColour;
88 std::map<std::int16_t, std::array<std::float_t, 6>> m_speakerPositions;
89 std::map<std::int16_t, std::unique_ptr<juce::Drawable>> m_speakerDrawables;
90 std::map<std::int16_t, juce::Rectangle<float>> m_speakerDrawableAreas;
91
92 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (UmsciLoudspeakersPaintComponent)
93};
94
The bottom layer of the UmsciControlComponent stack — paints a speaker SVG icon at each loudspeaker's...
void setControlsSize(ControlsSize size) override
Re-prerender all speaker drawables at the new icon size.
void lookAndFeelChanged() override
Re-prerender all speaker drawables in the new look-and-feel colour.
void setSpeakerPosition(std::int16_t speakerId, const std::array< std::float_t, 6 > &position)
Updates a single speaker position and re-prerenders its drawable.
void setSpeakerPositions(const std::map< std::int16_t, std::array< std::float_t, 6 > > &speakerPositions)
Replaces all speaker positions at once (e.g. on reconnect).
Abstract base class for all three overlaid visualisation layers in UmsciControlComponent.
ControlsSize
Visual size of source/speaker icons. Multiplier accessible via getControlsSizeMultiplier().