lv2_ttl_generation.hpp 1.94 KB
Newer Older
Benjamin Heisch's avatar
Benjamin Heisch committed
1
2
3
#ifndef LV2_TTL_GENERATION_H
#define LV2_TTL_GENERATION_H
#include <interfaces/IPlugin.hpp>
4
#include <string>
Benjamin Heisch's avatar
Benjamin Heisch committed
5
#include <vector>
6

Benjamin Heisch's avatar
Benjamin Heisch committed
7
8
/**
 * @brief Type, which means that it can be casted to IPlugin*.
9
 */
Benjamin Heisch's avatar
Benjamin Heisch committed
10
typedef void* CIPluginPtr;
11
12
13
14
15
16
struct TTLPluginInfo
{
  std::string ttlFileName = ""; // relative filepath(relative in the Bundle) of
                                // ttl file with name and extension.
  std::string binFileName = ""; // relative filepath(relative in the Bundle) of
                                // binary file with name and extension.
17
  APAL::IPlugin* plugPtr = nullptr; // Pointer to IPlugin
Benjamin Heisch's avatar
Benjamin Heisch committed
18
19
};

20
#ifndef _MSC_VER
21
22
extern "C"
{
23
#endif
24
25
26
27
28
29
  /**
   * @brief Function to get ttl file content from an Plugin.
   * @param pluginPtr pointer to an IPlugin class. IPlugin is not c compatible,
   * so it must be casted to void*
   * @param ttlContent String return value.
   */
30
  std::string getTTLFromPlugin(APAL::IPlugin* pluginPtr);
Benjamin Heisch's avatar
Benjamin Heisch committed
31

32
33
34
35
36
37
38
  /**
   * @brief Function to get an manifest file from multiple Plugininfos.
   * @param pluginInfos array of pluginInfos, to write in the manifest file.
   * @param numPluginInfos Size of the pluginInfos-Array
   * @param ttlFile Stringoutput. This string can be written to a manifest file.
   */
  std::string getManifestFromMultpleInfos(std::vector<TTLPluginInfo> plugInfos);
Benjamin Heisch's avatar
Benjamin Heisch committed
39

40
41
42
43
44
45
46
47
48
49
50
  /**
   * @brief Writes all plugininfos in the given Array (plugInfos). The Array
   * must have the Size, to match a number of Items, which \see
   * getSizeOfPluginInfos() returns. The returned struct owns not the PluginPtr
   * but the strings. The CStrings must be freed bevore relasing the objects.
   * @param plugInfos Array of Plugininfos with the size of \see
   * getSizeOfPluginInfos()
   * @param binaryPath binary Path reltive in the bundle Folder. This is used to
   * get the reference to the needed binary.
   */
  std::vector<TTLPluginInfo> getPluginInfos(const std::string& binaryPath);
Benjamin Heisch's avatar
Benjamin Heisch committed
51

52
53
54
#ifndef _MSC_VER
}
#endif
Benjamin Heisch's avatar
Benjamin Heisch committed
55
56

#endif //! LV2_TTL_GENERATION_H