Mercurial > hg > piper-cpp
comparison vamp-client/qt/test.cpp @ 214:0906984b9496
Merge pull request #5 from piper-audio/dev/rename-pluginstub
Dev/rename pluginstub
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Thu, 09 Feb 2017 14:41:29 +0000 |
parents | c67a0a945b6b |
children | 60ff32818c30 |
comparison
equal
deleted
inserted
replaced
211:8183c3be5592 | 214:0906984b9496 |
---|---|
33 authorization. | 33 authorization. |
34 */ | 34 */ |
35 | 35 |
36 #include "ProcessQtTransport.h" | 36 #include "ProcessQtTransport.h" |
37 #include "CapnpRRClient.h" | 37 #include "CapnpRRClient.h" |
38 #include "AutoPlugin.h" | 38 #include "PiperAutoPlugin.h" |
39 | 39 |
40 #include <stdexcept> | 40 #include <stdexcept> |
41 | 41 |
42 using std::cerr; | 42 using std::cerr; |
43 using std::endl; | 43 using std::endl; |
58 return 1; | 58 return 1; |
59 } | 59 } |
60 | 60 |
61 piper_vamp::client::CapnpRRClient client(&transport, nullptr); | 61 piper_vamp::client::CapnpRRClient client(&transport, nullptr); |
62 | 62 |
63 piper_vamp::ListResponse lr = client.listPluginData({}); | 63 piper_vamp::ListResponse lr = client.list({}); |
64 cerr << "Plugins available:" << endl; | 64 cerr << "Plugins available:" << endl; |
65 int i = 1; | 65 int i = 1; |
66 for (const auto &p: lr.available) { | 66 for (const auto &p: lr.available) { |
67 cerr << i++ << ". [" << p.pluginKey << "] " << p.basic.name << endl; | 67 cerr << i++ << ". [" << p.pluginKey << "] " << p.basic.name << endl; |
68 } | 68 } |
69 | 69 |
70 piper_vamp::LoadRequest req; | 70 piper_vamp::LoadRequest req; |
71 req.pluginKey = "vamp-example-plugins:zerocrossing"; | 71 req.pluginKey = "vamp-example-plugins:zerocrossing"; |
72 req.inputSampleRate = 16; | 72 req.inputSampleRate = 16; |
73 piper_vamp::LoadResponse resp = client.loadPlugin(req); | 73 piper_vamp::LoadResponse resp = client.load(req); |
74 Vamp::Plugin *plugin = resp.plugin; | 74 Vamp::Plugin *plugin = resp.plugin; |
75 | 75 |
76 if (!plugin->initialise(1, 4, 4)) { | 76 if (!plugin->initialise(1, 4, 4)) { |
77 cerr << "initialisation failed" << endl; | 77 cerr << "initialisation failed" << endl; |
78 } else { | 78 } else { |
105 | 105 |
106 (void)plugin->getRemainingFeatures(); | 106 (void)plugin->getRemainingFeatures(); |
107 | 107 |
108 delete plugin; | 108 delete plugin; |
109 | 109 |
110 // Let's try a crazy AutoPlugin | 110 // Let's try a crazy PiperAutoPlugin |
111 | 111 |
112 piper_vamp::client::AutoPlugin ap | 112 piper_vamp::client::PiperAutoPlugin ap |
113 (argv[1], "vamp-example-plugins:zerocrossing", 16, 0, nullptr); | 113 (argv[1], "vamp-example-plugins:zerocrossing", 16, 0, nullptr); |
114 | 114 |
115 if (!ap.isOK()) { | 115 if (!ap.isOK()) { |
116 cerr << "AutoPlugin creation failed" << endl; | 116 cerr << "PiperAutoPlugin creation failed" << endl; |
117 } else { | 117 } else { |
118 if (!ap.initialise(1, 4, 4)) { | 118 if (!ap.initialise(1, 4, 4)) { |
119 cerr << "initialisation failed" << endl; | 119 cerr << "initialisation failed" << endl; |
120 } else { | 120 } else { |
121 vector<float> buf = { 1.0, -1.0, 1.0, -1.0 }; | 121 vector<float> buf = { 1.0, -1.0, 1.0, -1.0 }; |