lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
plugins
SpectrumAnalyzer
Analyzer.h
Go to the documentation of this file.
1
/* Analyzer.h - declaration of Analyzer class.
2
*
3
* Copyright (c) 2019 Martin Pavelek <he29/dot/HS/at/gmail/dot/com>
4
*
5
* Based partially on Eq plugin code,
6
* Copyright (c) 2014-2017, David French <dave/dot/french3/at/googlemail/dot/com>
7
*
8
* This file is part of LMMS - https://lmms.io
9
*
10
* This program is free software; you can redistribute it and/or
11
* modify it under the terms of the GNU General Public
12
* License as published by the Free Software Foundation; either
13
* version 2 of the License, or (at your option) any later version.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
* General Public License for more details.
19
*
20
* You should have received a copy of the GNU General Public
21
* License along with this program (see COPYING); if not, write to the
22
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23
* Boston, MA 02110-1301 USA.
24
*
25
*/
26
27
#ifndef ANALYZER_H
28
#define ANALYZER_H
29
30
31
#include "
DataprocLauncher.h
"
32
#include "
Effect.h
"
33
#include "
LocklessRingBuffer.h
"
34
#include "
SaControls.h
"
35
#include "
SaProcessor.h
"
36
37
namespace
lmms
38
{
39
40
42
class
Analyzer
:
public
Effect
43
{
44
public
:
45
Analyzer
(
Model
*parent,
const
Descriptor::SubPluginFeatures::Key *
key
);
46
~Analyzer
()
override
;
47
48
ProcessStatus
processImpl
(
SampleFrame
* buf,
const
f_cnt_t
frames)
override
;
49
50
EffectControls
*
controls
()
override
{
return
&
m_controls
;}
51
52
SaProcessor
*
getProcessor
() {
return
&
m_processor
;}
53
54
private
:
55
SaProcessor
m_processor
;
56
SaControls
m_controls
;
57
58
// Maximum LMMS buffer size (hard coded, the actual constant is hard to get)
59
const
unsigned
int
m_maxBufferSize
= 4096;
60
61
// QThread::create() workaround
62
// Replace DataprocLauncher by QThread and replace initializer in constructor
63
// with the following commented line when LMMS CI starts using Qt > 5.9
64
//m_processorThread = QThread::create([=]{m_processor.analyze(m_inputBuffer);});
65
DataprocLauncher
m_processorThread
;
66
67
LocklessRingBuffer<SampleFrame>
m_inputBuffer
;
68
69
#ifdef SA_DEBUG
70
int
m_last_dump_time;
71
int
m_dump_count;
72
float
m_sum_execution;
73
float
m_max_execution;
74
#endif
75
};
76
77
78
}
// namespace lmms
79
80
#endif
// ANALYZER_H
81
DataprocLauncher.h
Effect.h
LocklessRingBuffer.h
SaControls.h
SaProcessor.h
lmms::Analyzer::m_processor
SaProcessor m_processor
Definition
Analyzer.h:55
lmms::Analyzer::controls
EffectControls * controls() override
Definition
Analyzer.h:50
lmms::Analyzer::m_maxBufferSize
const unsigned int m_maxBufferSize
Definition
Analyzer.h:59
lmms::Analyzer::Analyzer
Analyzer(Model *parent, const Descriptor::SubPluginFeatures::Key *key)
Definition
Analyzer.cpp:59
lmms::Analyzer::m_processorThread
DataprocLauncher m_processorThread
Definition
Analyzer.h:65
lmms::Analyzer::getProcessor
SaProcessor * getProcessor()
Definition
Analyzer.h:52
lmms::Analyzer::m_inputBuffer
LocklessRingBuffer< SampleFrame > m_inputBuffer
Definition
Analyzer.h:67
lmms::Analyzer::m_controls
SaControls m_controls
Definition
Analyzer.h:56
lmms::Analyzer::processImpl
ProcessStatus processImpl(SampleFrame *buf, const f_cnt_t frames) override
Definition
Analyzer.cpp:80
lmms::DataprocLauncher
Definition
DataprocLauncher.h:38
lmms::EffectControls
Definition
EffectControls.h:44
lmms::Effect::Effect
Effect(const Plugin::Descriptor *_desc, Model *_parent, const Descriptor::SubPluginFeatures::Key *_key)
Definition
Effect.cpp:41
lmms::Effect::ProcessStatus
ProcessStatus
Definition
Effect.h:150
lmms::LocklessRingBuffer
A convenience layer for a realtime-safe and thread-safe multi-reader ringbuffer.
Definition
LocklessRingBuffer.h:41
lmms::Model
Definition
Model.h:37
lmms::Plugin::key
const Descriptor::SubPluginFeatures::Key & key() const
Definition
Plugin.h:272
lmms::SaControls
Definition
SaControls.h:48
lmms::SaProcessor
Receives audio data, runs FFT analysis and stores the result.
Definition
SaProcessor.h:50
lmms::SampleFrame
Definition
SampleFrame.h:41
lmms
Definition
RemotePluginBase.cpp:34
lmms::f_cnt_t
std::uint64_t f_cnt_t
Definition
LmmsTypes.h:43
Generated on
for lmms by
1.18.0