LMMS
Loading...
Searching...
No Matches
DistrhoPluginProM.cpp
Go to the documentation of this file.
1/*
2 * DISTRHO ProM Plugin
3 * Copyright (C) 2015 Filipe Coelho <falktx@falktx.com>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * For a full copy of the license see the LICENSE file.
15 */
16
17#include "DistrhoPluginProM.hpp"
18
19#include "libprojectM/projectM.hpp"
20
22
23// -----------------------------------------------------------------------
24
25DistrhoPluginProM::DistrhoPluginProM()
26 : Plugin(0, 0, 0),
27 fPM(nullptr)
28{
29}
30
31DistrhoPluginProM::~DistrhoPluginProM()
32{
33 DISTRHO_SAFE_ASSERT(fPM == nullptr);
34}
35
36// -----------------------------------------------------------------------
37// Init
38
39void DistrhoPluginProM::initParameter(uint32_t, Parameter&)
40{
41}
42
43// -----------------------------------------------------------------------
44// Internal data
45
46float DistrhoPluginProM::getParameterValue(uint32_t) const
47{
48 return 0.0f;
49}
50
51void DistrhoPluginProM::setParameterValue(uint32_t, float)
52{
53}
54
55// -----------------------------------------------------------------------
56// Process
57
58void DistrhoPluginProM::run(const float* const* inputs, float** outputs, uint32_t frames)
59{
60 const float* in = inputs[0];
61 float* out = outputs[0];
62
63 if (out != in)
64 std::memcpy(out, in, sizeof(float)*frames);
65
66 const MutexLocker csm(fMutex);
67
68 if (fPM == nullptr)
69 return;
70
71 if (PCM* const pcm = const_cast<PCM*>(fPM->pcm()))
72 pcm->addPCMfloat(in, frames);
73}
74
75// -----------------------------------------------------------------------
76
78{
79 return new DistrhoPluginProM();
80}
81
82// -----------------------------------------------------------------------
83
#define END_NAMESPACE_DISTRHO
Definition DistrhoDefines.h:191
#define DISTRHO_SAFE_ASSERT(cond)
Definition DistrhoDefines.h:104
#define nullptr
Definition DistrhoDefines.h:75
#define START_NAMESPACE_DISTRHO
Definition DistrhoDefines.h:190
Plugin * createPlugin()
Definition DistrhoPluginProM.cpp:77
Definition basics.h:174
float in
Definition lilv_test.c:1460
float out
Definition lilv_test.c:1461
unsigned int uint32_t
Definition mid.cpp:100