Mercurial > hg > piper-cpp
comparison vamp-client/client.cpp @ 98:f55631599988
Plugin that creates its own server
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Thu, 13 Oct 2016 19:11:24 +0100 |
parents | 427c4c725085 |
children | 8c449824e08d |
comparison
equal
deleted
inserted
replaced
97:427c4c725085 | 98:f55631599988 |
---|---|
1 | 1 |
2 #include "ProcessQtTransport.h" | 2 #include "ProcessQtTransport.h" |
3 #include "CapnpRRClient.h" | 3 #include "CapnpRRClient.h" |
4 #include "AutoPlugin.h" | |
4 | 5 |
5 #include <stdexcept> | 6 #include <stdexcept> |
6 | 7 |
7 using std::cerr; | 8 using std::cerr; |
8 using std::endl; | 9 using std::endl; |
56 } | 57 } |
57 | 58 |
58 (void)plugin->getRemainingFeatures(); | 59 (void)plugin->getRemainingFeatures(); |
59 | 60 |
60 delete plugin; | 61 delete plugin; |
62 | |
63 // Let's try a crazy AutoPlugin | |
64 | |
65 piper_vamp::client::AutoPlugin ap("vamp-example-plugins:zerocrossing", 16, 0); | |
66 if (!ap.isOK()) { | |
67 cerr << "AutoPlugin creation failed" << endl; | |
68 } else { | |
69 if (!ap.initialise(1, 4, 4)) { | |
70 cerr << "initialisation failed" << endl; | |
71 } else { | |
72 std::vector<float> buf = { 1.0, -1.0, 1.0, -1.0 }; | |
73 float *bd = buf.data(); | |
74 Vamp::Plugin::FeatureSet features = ap.process | |
75 (&bd, Vamp::RealTime::zeroTime); | |
76 cerr << "results for output 0:" << endl; | |
77 auto fl(features[0]); | |
78 for (const auto &f: fl) { | |
79 cerr << f.values[0] << endl; | |
80 } | |
81 } | |
82 } | |
61 } | 83 } |
62 | 84 |