123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #include "tests.h"
- waf_test_use("plugin_base")
- #include "core/PluginIndex.h"
- #include "core/PluginManager.h"
- #include "io/FileSoundInput.h"
- struct TestPlugin {
- TestPlugin() {
- }
- PluginIndex host;
- PluginManager manager;
- };
- #define SAMPLE_WINDOW 4096
- int main(int argc, char** argv){
- try {
- TestPlugin plugins;
- plugins.host.add_path("/home/fanch/Programmation/audio_renderer/debug/src/plugins/");
- //plugins.host.add_path("/usr/lib/ladspa");
- plugins.host.update();
- PluginEntry& plugin = plugins.host.load_from_path("/home/fanch/Programmation/audio_renderer/debug/src/plugins/libaudio_to_midi.so");
- //printf("Add plugin\n");
- FileSoundInput fsi("/home/fanch/Programmation/LADSPA/audio_to_midi/snd/yafs1.wav", SAMPLE_WINDOW);
- plugins.manager.set_rate(44100, SAMPLE_WINDOW);
- plugins.manager.add_plugin(plugin);
- LADSPA_Data* buffer = plugins.manager.get_input();
- int count = 0;
- while ((buffer = fsi.next(buffer))){
- plugins.manager.run(buffer);
- count ++;
- if(count>1000){
- break;
- }
- }
- printf("fin\n");
- delete[] buffer;
- } catch (const char* x) {
- printf("Erreur: %s\n", x);
- }
- }
|