Mema
Memory Matrix — multi-channel audio matrix monitor and router
Loading...
Searching...
No Matches
ProcessorSpectrumData.cpp
Go to the documentation of this file.
1/* Copyright (c) 2024-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
20
21namespace Mema
22{
23
28
33
35{
36 m_spectrumsMap[channel] = spectrum;
37}
38
40{
41 if(m_spectrumsMap.count(channel) == 0)
42 m_spectrumsMap.insert(std::pair<unsigned long, SpectrumBands>(channel, ProcessorSpectrumData::SpectrumBands{}));
43
44 return m_spectrumsMap.at(channel);
45}
46
48{
49 if(GetChannelCount()==count)
50 return;
51
52 for(unsigned long i=1; i<=count; i++)
53 {
54 if(!m_spectrumsMap.count(i))
55 m_spectrumsMap[i] = SpectrumBands();
56 }
57}
58
60{
61 return static_cast<unsigned long>(m_spectrumsMap.size());
62}
63
64}
@ Spectrum
FFT frequency-spectrum data.
void SetChannelCount(unsigned long count) override
Sets the number of audio channels this data object covers.
unsigned long GetChannelCount() override
Returns the number of audio channels this data object covers.
const SpectrumBands & GetSpectrum(unsigned long channel)
void SetSpectrum(unsigned long channel, SpectrumBands spectrum)
Definition Mema.cpp:27
FFT output for a single channel — 512 frequency bins with peak and hold values.