Mercurial > hg > jvamp
view org/vamp_plugins/PluginLoader.java @ 22:6385a6caaa7c
Move test program to own directory, add process using subset of array, add hgignore
author | Chris Cannam |
---|---|
date | Wed, 14 Nov 2012 17:35:46 +0000 |
parents | f718b0961713 |
children | cc9c503535d1 |
line wrap: on
line source
package org.vamp_plugins; public class PluginLoader { public class LoadFailedException extends Exception { }; public static synchronized PluginLoader getInstance() { if (inst == null) { inst = new PluginLoader(); inst.initialise(); } return inst; } public Plugin loadPlugin(String key, float inputSampleRate) throws LoadFailedException { long handle = loadPluginNative(key, inputSampleRate); if (handle != 0) return new Plugin(handle); else throw new LoadFailedException(); } private PluginLoader() { initialise(); } private native long loadPluginNative(String key, float inputSampleRate); private native void initialise(); private static PluginLoader inst; private long nativeHandle; static { System.loadLibrary("vamp-jni"); } }