-
Notifications
You must be signed in to change notification settings - Fork 0
/
missing.cc
66 lines (52 loc) · 1.94 KB
/
missing.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "SharedLibrary.h"
#include "Plugin.h"
#include <filesystem>
#include <vector>
#include <iostream>
#include "json.hpp"
#ifdef __linux__
#include <lilv/lilv.h>
#endif
void list_ladspa (std::string path) {
for (const auto & entry : std::filesystem::directory_iterator(path)) {
std::cout << entry.path() << std::endl;
SharedLibrary s = SharedLibrary ((char *)entry.path ().u8string ().c_str (), SharedLibrary::PluginType::LADSPA) ;
if (s.load () == NULL) {
for (int i = 0 ; i < s.descriptors.size () ; i ++) {
printf ("-----------------------------------\n");
printf ("[%s] %d: %s\n", entry.path().c_str (), i, s.descriptors.at (i)->Name);
printf ("-----------------------------------\n");
}
}
}
}
# ifdef __linux__
void list_lilv () {
{
LilvWorld* world = (LilvWorld* )lilv_world_new();
lilv_world_load_all(world);
LilvPlugins* plugins = (LilvPlugins* )lilv_world_get_all_plugins(world);
LILV_FOREACH (plugins, i, plugins) {
const LilvPlugin* p = (LilvPlugin* )lilv_plugins_get(plugins, i);
const char * name = lilv_node_as_string (lilv_plugin_get_name (p));
printf("[LV2] %s\n", name);
}
}
}
# endif
int main (int argc, char ** argv ) {
std::string path = "libs";
std::ifstream fJson(argv [1]);
std::stringstream buffer;
buffer << fJson.rdbuf();
auto json = nlohmann::json::parse(buffer.str());
std::cout << "\n\n-------| missing |----------" << "\n\n" ;
for (auto plugin : json) {
path = plugin ["library"].dump () ;
path = path.substr (1, path.size () - 2);
std::string fpath = std::string ("libs/win32/") + path ;
if (! std::filesystem::exists(fpath))
printf ("[missing] %s\n", fpath.c_str ());
}
list_ladspa ("libs/win32");
}