Mercurial > hg > jvamp
comparison src/PluginLoader.cpp @ 45:5cb76aa45ee5
Add getPluginPath (it's useful for looking up other resources, e.g. cat/ttl files, besides plugins)
author | Chris Cannam |
---|---|
date | Mon, 25 Feb 2013 21:47:00 +0000 |
parents | c9515589be7d |
children | 91259f3449ae |
comparison
equal
deleted
inserted
replaced
44:1fa3d63bfeac | 45:5cb76aa45ee5 |
---|---|
33 */ | 33 */ |
34 | 34 |
35 #include "org_vamp_plugins_PluginLoader.h" | 35 #include "org_vamp_plugins_PluginLoader.h" |
36 | 36 |
37 #include <vamp-hostsdk/PluginLoader.h> | 37 #include <vamp-hostsdk/PluginLoader.h> |
38 #include <vamp-hostsdk/PluginHostAdapter.h> | |
38 | 39 |
39 #include "handle.h" | 40 #include "handle.h" |
40 | 41 |
41 using Vamp::Plugin; | 42 using Vamp::Plugin; |
42 using Vamp::HostExt::PluginLoader; | 43 using Vamp::HostExt::PluginLoader; |
88 env->NewStringUTF(cat[i].c_str())); | 89 env->NewStringUTF(cat[i].c_str())); |
89 } | 90 } |
90 return result; | 91 return result; |
91 } | 92 } |
92 | 93 |
94 JNIEXPORT jobjectArray JNICALL | |
95 Java_org_vamp_1plugins_PluginLoader_getPluginPath(JNIEnv *env, jobject obj) | |
96 { | |
97 std::vector<std::string> path = Vamp::PluginHostAdapter::getPluginPath(); | |
98 jobjectArray result = env->NewObjectArray | |
99 (path.size(), env->FindClass("java/lang/String"), 0); | |
100 for (int i = 0; i < path.size(); ++i) { | |
101 env->SetObjectArrayElement(result, i, | |
102 env->NewStringUTF(path[i].c_str())); | |
103 } | |
104 return result; | |
105 } | |
93 | 106 |