LMMS
Loading...
Searching...
No Matches
Lv2Basics.h
Go to the documentation of this file.
1/*
2 * Lv2Basics.h - basic Lv2 utils
3 *
4 * Copyright (c) 2018-2024 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_LV2BASICS_H
26#define LMMS_LV2BASICS_H
27
28#include "lmmsconfig.h"
29
30#ifdef LMMS_HAVE_LV2
31
32#include <lilv/lilv.h>
33#include <memory>
34#include <QString>
35#include <string>
36
37namespace lmms
38{
39
40template<class T>
42{
43 void operator()(T* n) { lilv_free(static_cast<void*>(n)); }
44};
45
50
55
60
61template<class T>
62using AutoLilvPtr = std::unique_ptr<T, LilvPtrDeleter<T>>;
63using AutoLilvNode = std::unique_ptr<LilvNode, LilvNodeDeleter>;
64using AutoLilvNodes = std::unique_ptr<LilvNodes, LilvNodesDeleter>;
65using AutoLilvScalePoints = std::unique_ptr<LilvScalePoints, LilvScalePointsDeleter>;
66
72QString qStringFromPluginNode(const LilvPlugin* plug,
73 LilvNode * (*getFunc)(const LilvPlugin*));
74
76QString qStringFromPortName(const LilvPlugin* plug, const LilvPort* port);
77
79std::string stdStringFromPortName(const LilvPlugin* plug, const LilvPort* port);
80
81} // namespace lmms
82
83#endif // LMMS_HAVE_LV2
84
85#endif // LMMS_LV2BASICS_H
unsigned s
Definition inflate.c:1555
LILV_API void lilv_nodes_free(LilvNodes *collection)
Definition collections.c:230
LILV_API void lilv_scale_points_free(LilvScalePoints *collection)
Definition collections.c:218
LILV_API void lilv_node_free(LilvNode *val)
Definition node.c:229
void LilvScalePoints
Definition lilv.h:95
void LilvNodes
Definition lilv.h:97
LILV_API void lilv_free(void *ptr)
Definition util.c:37
struct LilvPortImpl LilvPort
Definition lilv.h:84
struct LilvPluginImpl LilvPlugin
Definition lilv.h:82
struct LilvNodeImpl LilvNode
Definition lilv.h:87
Definition AudioAlsa.cpp:35
std::string stdStringFromPortName(const LilvPlugin *plug, const LilvPort *port)
Return port name as std::string, everything will be freed automatically.
Definition Lv2Basics.cpp:45
std::unique_ptr< LilvNodes, LilvNodesDeleter > AutoLilvNodes
Definition Lv2Basics.h:64
std::unique_ptr< LilvNode, LilvNodeDeleter > AutoLilvNode
Definition Lv2Basics.h:63
std::unique_ptr< LilvScalePoints, LilvScalePointsDeleter > AutoLilvScalePoints
Definition Lv2Basics.h:65
QString qStringFromPortName(const LilvPlugin *plug, const LilvPort *port)
Return port name as QString, everything will be freed automatically.
Definition Lv2Basics.cpp:39
QString qStringFromPluginNode(const LilvPlugin *plug, LilvNode *(*getFunc)(const LilvPlugin *))
Definition Lv2Basics.cpp:32
std::unique_ptr< T, LilvPtrDeleter< T > > AutoLilvPtr
Definition Lv2Basics.h:62
Definition Lv2Basics.h:47
void operator()(LilvNode *n)
Definition Lv2Basics.h:48
Definition Lv2Basics.h:52
void operator()(LilvNodes *n)
Definition Lv2Basics.h:53
Definition Lv2Basics.h:42
void operator()(T *n)
Definition Lv2Basics.h:43
Definition Lv2Basics.h:57
void operator()(LilvScalePoints *s)
Definition Lv2Basics.h:58
int n
Definition crypt.c:458