Mema
Memory Matrix — multi-channel audio matrix monitor and router
Loading...
Searching...
No Matches
SpectrumAudioComponent.h
Go to the documentation of this file.
1/* Copyright (c) 2025, Christian Ahrens
2 *
3 * This file is part of Mema <https://github.com/ChristianAhrens/Mema>
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
23#include "../MemaProcessorEditor/AbstractAudioVisualizer.h"
24
25namespace Mema
26{
27
28class CustomPaintingAudioVisualiserComponent;
29
32{
33public:
36 {
37 std::vector<float> peaks;
38 std::vector<float> holds;
39 float minFreq;
40 float maxFreq;
41 float freqRes;
42 };
43
44public:
45 //==============================================================================
48
49 //==============================================================================
50 void setNumVisibleChannels(int numChannels);
52
53 //==============================================================================
54 void paint (juce::Graphics&) override;
55 void resized() override;
56 void lookAndFeelChanged() override;
57
58 //==============================================================================
60
61private:
62 //==============================================================================
63 std::unique_ptr<juce::DrawableButton> m_chNumSelButton;
64 std::vector<PlotPoints> m_plotPoints;
65
66 //==============================================================================
67 int m_numAvailableChannels = 0;
68 int m_numVisibleChannels = 1;
69 int m_legendWidth = 20;
70
71 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SpectrumAudioComponent)
72};
73
74
75}
Base class for all audio-data visualisation components in the Mema processor editor.
Base class for all data objects exchanged between the audio processor and its analyzers/visualisers.
void setNumVisibleChannels(int numChannels)
void processingDataChanged(AbstractProcessorData *data) override
void paint(juce::Graphics &) override
Definition Mema.cpp:27
Cached per-channel FFT peak and hold data ready for painting.