Audacity 3.2.0
Typedefs | Functions | Variables
LV2Symbols Namespace Reference

Typedefs

using LilvWorldPtr = Lilv_ptr< LilvWorld, lilv_world_free >
 
using URIDMap = std::vector< MallocString<> >
 

Functions

URIDLIST bool InitializeGWorld ()
 Call before any use of the constants defined in this file. More...
 
void FinalizeGWorld ()
 Call at end of session. More...
 
LV2_URID Lookup_URI (URIDMap &map, const char *uri, bool add)
 

Variables

static LilvWorldPtr uWorld
 
LilvWorld * gWorld = nullptr
 
URIDMap gURIDMap
 Declare the global map of positive integers to URIs. More...
 

Typedef Documentation

◆ LilvWorldPtr

using LV2Symbols::LilvWorldPtr = typedef Lilv_ptr<LilvWorld, lilv_world_free>

Definition at line 29 of file LV2Symbols.cpp.

◆ URIDMap

using LV2Symbols::URIDMap = typedef std::vector<MallocString<> >

Definition at line 142 of file LV2Symbols.h.

Function Documentation

◆ FinalizeGWorld()

LV2_API void LV2Symbols::FinalizeGWorld ( )

Call at end of session.

Definition at line 71 of file LV2Symbols.cpp.

72{
73 gWorld = nullptr;
74}
LilvWorld * gWorld
Definition: LV2Symbols.cpp:31

References gWorld.

Referenced by LV2EffectsModule::Terminate().

Here is the caller graph for this function:

◆ InitializeGWorld()

URIDLIST LV2_API bool LV2Symbols::InitializeGWorld ( )

Call before any use of the constants defined in this file.

Definition at line 48 of file LV2Symbols.cpp.

49{
50 // Try to initialise Lilv, or return.
51 uWorld.reset(lilv_world_new());
52 if (!uWorld)
53 return false;
54 gWorld = uWorld.get();
55
56 // Create LilvNodes for each of the URIs we need
57 #undef NODE
58 #define NODE(n, u) \
59 unode_##n.reset(lilv_new_uri(gWorld, u)); \
60 node_##n = unode_##n.get();
62
63 // Generate URIDs
64 #undef URID
65 #define URID(n, u) urid_##n = Lookup_URI(gURIDMap, u);
67
68 return true;
69}
#define NODELIST
Definition: LV2Symbols.h:48
#define URIDLIST
Definition: LV2Symbols.h:92
static LilvWorldPtr uWorld
Definition: LV2Symbols.cpp:30

References gWorld, NODELIST, URIDLIST, and uWorld.

Referenced by LV2EffectsModule::Initialize().

Here is the caller graph for this function:

◆ Lookup_URI()

LV2_API LV2_URID LV2Symbols::Lookup_URI ( URIDMap map,
const char *  uri,
bool  add = true 
)

Do reverse lookup in a map of URIs to positive integers, returning 0 if not found and !add

Definition at line 76 of file LV2Symbols.cpp.

77{
78 size_t ndx = map.size();
79 for (size_t i = 0; i < ndx; ++i)
80 if (strcmp(map[i].get(), uri) == 0)
81 return i + 1;
82 if (add) {
83 // Almost all compilers have strdup(),
84 // but VC++ and MinGW call it _strdup().
85 map.push_back(MallocString<>(wxCRT_StrdupA(uri)));
86 return ndx + 1;
87 }
88 return 0;
89}
std::unique_ptr< Character[], freer > MallocString
Definition: MemoryX.h:148
void add(const T *src1, const T *src2, T *dst, int32_t n)
Definition: VectorOps.h:46

References staffpad::vo::add().

Referenced by LV2FeaturesList::URID_Map().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ gURIDMap

LV2_API URIDMap LV2Symbols::gURIDMap

Declare the global map of positive integers to URIs.

Definition at line 34 of file LV2Symbols.cpp.

Referenced by LV2FeaturesList::URID_Map(), and LV2FeaturesList::URID_Unmap().

◆ gWorld

LV2_API LilvWorld * LV2Symbols::gWorld = nullptr

◆ uWorld

LilvWorldPtr LV2Symbols::uWorld
static

Definition at line 30 of file LV2Symbols.cpp.

Referenced by InitializeGWorld().