Mema
Memory Matrix — multi-channel audio matrix monitor and router
Loading...
Searching...
No Matches
ProcessorLevelData.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
19#include "ProcessorLevelData.h"
20
21namespace Mema
22{
23
28
33
35{
36 m_levelMap[channel] = level;
37}
38
40{
41 if(m_levelMap.count(channel))
42 return m_levelMap.at(channel);
43 else
44 return ProcessorLevelData::LevelVal(0, 0, 0);
45}
46
47void ProcessorLevelData::SetChannelCount(unsigned long count)
48{
49 if(GetChannelCount()==count)
50 return;
51
52 for(unsigned long i=1; i<=count; i++)
53 {
54 if (!m_levelMap.count(i))
55 m_levelMap[i] = LevelVal(0, 0, 0);
56 }
57}
58
60{
61 return static_cast<unsigned long>(m_levelMap.size());
62}
63
64}
@ Level
Peak/RMS/hold level metering data.
void SetLevel(unsigned long channel, LevelVal level)
void SetChannelCount(unsigned long count) override
Sets the number of audio channels this data object covers.
LevelVal GetLevel(unsigned long channel)
unsigned long GetChannelCount() override
Returns the number of audio channels this data object covers.
Definition Mema.cpp:27
Per-channel level values in both linear and dB domains.