LMMS
Loading...
Searching...
No Matches
carla-base.cpp
Go to the documentation of this file.
1/*
2 * Carla Native Plugins
3 * Copyright (C) 2013-2019 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 General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * For a full copy of the GNU General Public License see the doc/GPL.txt file.
16 */
17
18#include "CarlaEngine.hpp"
19#include "CarlaNativePlugin.h"
20#include "CarlaJuceUtils.hpp"
21#include "LinkedList.hpp"
22
23// -----------------------------------------------------------------------
24
25#ifdef CARLA_NATIVE_PLUGIN_LV2
26#include "lv2/lv2.h"
27
28// defined in CarlaPluginNative.cpp
31#endif
32
33// -----------------------------------------------------------------------
34// Plugin List
35
38 : descs()
40 , lv2Descs()
41#endif
42 {
43#ifdef CARLA_NATIVE_PLUGIN_LV2
44 for (std::size_t i=0, count = carla_getNativePluginCount(); i < count; ++i)
45 {
47 CARLA_SAFE_ASSERT_BREAK(desc != nullptr);
48
49 if (std::strcmp(desc->label, "audiofile" ) == 0 ||
50 std::strcmp(desc->label, "audiogain" ) == 0 ||
51 std::strcmp(desc->label, "audiogain_s" ) == 0 ||
52 std::strcmp(desc->label, "lfo" ) == 0 ||
53 std::strcmp(desc->label, "midichanab" ) == 0 ||
54 std::strcmp(desc->label, "midichanfilter" ) == 0 ||
55 std::strcmp(desc->label, "midichannelize" ) == 0 ||
56 std::strcmp(desc->label, "midifile" ) == 0 ||
57 std::strcmp(desc->label, "midigain" ) == 0 ||
58 std::strcmp(desc->label, "midijoin" ) == 0 ||
59 std::strcmp(desc->label, "midisplit" ) == 0 ||
60 std::strcmp(desc->label, "miditranspose" ) == 0 ||
61 std::strcmp(desc->label, "midipattern" ) == 0 ||
62 std::strcmp(desc->label, "carlarack" ) == 0 ||
63 std::strcmp(desc->label, "carlapatchbay" ) == 0 ||
64 std::strcmp(desc->label, "carlapatchbay3s" ) == 0 ||
65 std::strcmp(desc->label, "carlapatchbay16" ) == 0 ||
66 std::strcmp(desc->label, "carlapatchbay32" ) == 0 ||
67 std::strcmp(desc->label, "carlapatchbay64" ) == 0 ||
68 std::strcmp(desc->label, "carlapatchbaycv" ) == 0 ||
69 std::strcmp(desc->label, "bigmeter" ) == 0
70 /*std::strcmp(desc->label, "notes" ) == 0*/)
71 {
72 descs.append(desc);
73 }
74 }
75#else
81#endif
82 }
83
85 {
86#ifdef CARLA_NATIVE_PLUGIN_LV2
87 for (LinkedList<const LV2_Descriptor*>::Itenerator it = lv2Descs.begin2(); it.valid(); it.next())
88 {
89 const LV2_Descriptor* const lv2Desc(it.getValue(nullptr));
90 CARLA_SAFE_ASSERT_CONTINUE(lv2Desc != nullptr);
91
92 delete[] lv2Desc->URI;
93 delete lv2Desc;
94 }
95 lv2Descs.clear();
96#endif
97
98 descs.clear();
99 }
100
102 {
103 static PluginListManager plm;
104 return plm;
105 }
106
107 LinkedList<const NativePluginDescriptor*> descs;
108#ifdef CARLA_NATIVE_PLUGIN_LV2
109 LinkedList<const LV2_Descriptor*> lv2Descs;
110#endif
111};
112
113// -----------------------------------------------------------------------
CARLA_EXPORT const NativePluginDescriptor * carla_get_native_rack_plugin()
Definition CarlaEngineNative.cpp:3048
CARLA_EXPORT const NativePluginDescriptor * carla_get_native_patchbay_plugin()
Definition CarlaEngineNative.cpp:3054
#define CARLA_SAFE_ASSERT_CONTINUE(cond)
Definition CarlaDefines.h:189
#define CARLA_SAFE_ASSERT_BREAK(cond)
Definition CarlaDefines.h:188
const NativePluginDescriptor * carla_get_native_patchbay16_plugin()
Definition CarlaEngineNative.cpp:3060
const NativePluginDescriptor * carla_get_native_patchbay32_plugin()
Definition CarlaEngineNative.cpp:3066
const NativePluginDescriptor * carla_get_native_patchbay64_plugin()
Definition CarlaEngineNative.cpp:3072
std::size_t carla_getNativePluginCount() noexcept
Definition CarlaPluginNative.cpp:79
const NativePluginDescriptor * carla_getNativePluginDescriptor(const std::size_t index) noexcept
Definition CarlaPluginNative.cpp:85
#define noexcept
Definition DistrhoDefines.h:72
#define CARLA_NATIVE_PLUGIN_LV2
Definition carla-lv2-export.cpp:18
register unsigned i
Definition inflate.c:1575
struct _NativePluginDescriptor NativePluginDescriptor
Definition juce_Uuid.h:141
const char *const label
Definition CarlaNative.h:258
Definition lv2.h:180
const char * URI
Definition lv2.h:188
PluginListManager()
Definition carla-base.cpp:37
~PluginListManager()
Definition carla-base.cpp:84
static PluginListManager & getInstance()
Definition carla-base.cpp:101
LinkedList< const NativePluginDescriptor * > descs
Definition carla-base.cpp:107
_WDL_CSTRING_PREFIX void INT_PTR count
Definition wdlcstring.h:263
#define const
Definition zconf.h:137