changeset 89:03ed2e0a6c8f

More testing
author Chris Cannam <c.cannam@qmul.ac.uk>
date Wed, 12 Oct 2016 21:34:21 +0100
parents bf2e6f939f9f
children 6429a99abcad
files vamp-client/client.cpp vamp-server/server.cpp
diffstat 2 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/vamp-client/client.cpp	Wed Oct 12 19:02:31 2016 +0100
+++ b/vamp-client/client.cpp	Wed Oct 12 21:34:21 2016 +0100
@@ -51,8 +51,11 @@
     ~PiperClient() {
         if (m_process) {
             if (m_process->state() != QProcess::NotRunning) {
+		m_process->closeWriteChannel();
+                m_process->waitForFinished(200);
                 m_process->close();
                 m_process->waitForFinished();
+		cerr << "server exited" << endl;
             }
             delete m_process;
         }
@@ -338,6 +341,23 @@
     }
 
     (void)plugin->getRemainingFeatures();
+
+    cerr << "calling reset..." << endl;
+    plugin->reset();
+    cerr << "...round 2!" << endl;
+
+    std::vector<float> buf = { 1.0, -1.0, 1.0, -1.0 };
+    float *bd = buf.data();
+    Vamp::Plugin::FeatureSet features = plugin->process
+	(&bd, Vamp::RealTime::zeroTime);
+    cerr << "results for output 0:" << endl;
+    auto fl(features[0]);
+    for (const auto &f: fl) {
+	cerr << f.values[0] << endl;
+    }
+    
+    (void)plugin->getRemainingFeatures();
+
     delete plugin;
     //!!! -- and also implement reset(), which will need to reconstruct internally
 }
--- a/vamp-server/server.cpp	Wed Oct 12 19:02:31 2016 +0100
+++ b/vamp-server/server.cpp	Wed Oct 12 21:34:21 2016 +0100
@@ -276,7 +276,7 @@
 	    
 	    // NotValid without an exception indicates EOF:
 	    if (request.type == RRType::NotValid) {
-		cerr << "piper-vamp-server: eof reached" << endl;
+		cerr << "piper-vamp-server: eof reached, exiting" << endl;
 		break;
 	    }