LMMS
Loading...
Searching...
No Matches
Lv2Features.h
Go to the documentation of this file.
1/*
2 * Lv2Features.h - Lv2Features class
3 *
4 * Copyright (c) 2020-2020 Johannes Lorenz <jlsf2013$users.sourceforge.net, $=@>
5 *
6 * This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 *
23 */
24
25#ifndef LMMS_LV2_FEATURES_H
26#define LMMS_LV2_FEATURES_H
27
28#include "lmmsconfig.h"
29
30#ifdef LMMS_HAVE_LV2
31
32#include <map>
33#include <string_view>
34#include <vector>
35
36#include <lv2/core/lv2.h>
37
38namespace lmms
39{
40
55{
56public:
58 static bool isFeatureSupported(const char *featName);
59
61
63 void initCommon();
65 void*& operator[](const char* featName);
69 const LV2_Feature* const* featurePointers() const
70 {
71 return m_featurePointers.data();
72 }
73
74 void clear();
75
76private:
78 std::vector<LV2_Feature> m_features;
80 std::vector<const LV2_Feature*> m_featurePointers;
82 std::map<std::string_view, void*> m_featureByUri;
83};
84
85
86} // namespace lmms
87
88#endif // LMMS_HAVE_LV2
89
90#endif // LMMS_LV2_FEATURES_H
void *& operator[](const char *featName)
Return reference to feature data with given URI featName.
Definition Lv2Features.cpp:100
Lv2Features()
Definition Lv2Features.cpp:47
static bool isFeatureSupported(const char *featName)
Return if a feature is supported by LMMS.
Definition Lv2Features.cpp:39
void createFeatureVectors()
Fill m_features and m_featurePointers with all features.
Definition Lv2Features.cpp:71
const LV2_Feature *const * featurePointers() const
Return LV2_Feature pointer vector, suited for lilv_plugin_instantiate.
Definition Lv2Features.h:69
void clear()
Clear everything.
Definition Lv2Features.cpp:110
std::vector< const LV2_Feature * > m_featurePointers
pointers to m_features, required for lilv_plugin_instantiate
Definition Lv2Features.h:80
void initCommon()
Register only plugin-common features.
Definition Lv2Features.cpp:60
std::vector< LV2_Feature > m_features
feature storage
Definition Lv2Features.h:78
std::map< std::string_view, void * > m_featureByUri
features + data, ordered by URI
Definition Lv2Features.h:82
Definition AudioAlsa.cpp:35
Definition lv2.h:157