Mercurial > hg > jvamp
comparison org/vamp_plugins/test.java @ 7:93dfb83c6f82
Complete implementation of getOutputDescriptors
author | Chris Cannam |
---|---|
date | Thu, 26 Jan 2012 14:46:45 +0000 |
parents | 3dd55efc53ca |
children | aa9860e1af8a |
comparison
equal
deleted
inserted
replaced
6:3dd55efc53ca | 7:93dfb83c6f82 |
---|---|
5 { | 5 { |
6 public static void main(String[] args) { | 6 public static void main(String[] args) { |
7 | 7 |
8 // This is a plugin we know we have installed | 8 // This is a plugin we know we have installed |
9 // String key = "vamp-example-plugins:percussiononsets"; | 9 // String key = "vamp-example-plugins:percussiononsets"; |
10 String key = "qm-vamp-plugins:qm-onsets"; | 10 String key = "qm-vamp-plugins:qm-onsetdetector"; |
11 | 11 |
12 PluginLoader loader = PluginLoader.getInstance(); | 12 PluginLoader loader = PluginLoader.getInstance(); |
13 | 13 |
14 try { | 14 try { |
15 Plugin p = loader.loadPlugin(key, 44100); | 15 Plugin p = loader.loadPlugin(key, 44100); |
26 String[] progs = p.getPrograms(); | 26 String[] progs = p.getPrograms(); |
27 System.out.println("Plugin has " + progs.length + " program(s)"); | 27 System.out.println("Plugin has " + progs.length + " program(s)"); |
28 for (int i = 0; i < progs.length; ++i) { | 28 for (int i = 0; i < progs.length; ++i) { |
29 System.out.println(i + ": " + progs[i]); | 29 System.out.println(i + ": " + progs[i]); |
30 } | 30 } |
31 OutputDescriptor[] outputs = p.getOutputDescriptors(); | |
32 System.out.println("Plugin has " + outputs.length + " output(s)"); | |
33 for (int i = 0; i < outputs.length; ++i) { | |
34 System.out.println(i + ": " + outputs[i].identifier + " (sample type: " + outputs[i].sampleType + ")"); | |
35 } | |
31 } catch (PluginLoader.LoadFailedException e) { | 36 } catch (PluginLoader.LoadFailedException e) { |
32 System.out.println("Plugin load failed"); | 37 System.out.println("Plugin load failed"); |
33 } | 38 } |
34 } | 39 } |
35 } | 40 } |