changeset 997:2104ea2204d2

Separate out stdout ability (not all writers that support one-file will necessarily want to support it, e.g. for binary formats)
author Chris Cannam
date Mon, 13 Oct 2014 10:56:16 +0100
parents 0d3d1ec7dfde
children e25dc8d57565
files rdf/RDFFeatureWriter.cpp transform/CSVFeatureWriter.cpp transform/FileFeatureWriter.cpp transform/FileFeatureWriter.h
diffstat 4 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/rdf/RDFFeatureWriter.cpp	Mon Oct 13 10:55:43 2014 +0100
+++ b/rdf/RDFFeatureWriter.cpp	Mon Oct 13 10:56:16 2014 +0100
@@ -15,9 +15,6 @@
 
 #include <fstream>
 
-#include "vamp-hostsdk/PluginHostAdapter.h"
-#include "vamp-hostsdk/PluginLoader.h"
-
 #include "base/Exceptions.h"
 
 #include "RDFFeatureWriter.h"
@@ -36,7 +33,8 @@
 RDFFeatureWriter::RDFFeatureWriter() :
     FileFeatureWriter(SupportOneFilePerTrackTransform |
                       SupportOneFilePerTrack |
-                      SupportOneFileTotal,
+                      SupportOneFileTotal |
+                      SupportStdOut,
                       "n3"),
     m_plain(false),
     m_network(false),
--- a/transform/CSVFeatureWriter.cpp	Mon Oct 13 10:55:43 2014 +0100
+++ b/transform/CSVFeatureWriter.cpp	Mon Oct 13 10:56:16 2014 +0100
@@ -29,7 +29,8 @@
 
 CSVFeatureWriter::CSVFeatureWriter() :
     FileFeatureWriter(SupportOneFilePerTrackTransform |
-                      SupportOneFileTotal,
+                      SupportOneFileTotal |
+                      SupportStdOut,
                       "csv"),
     m_separator(","),
     m_sampleTiming(false)
--- a/transform/FileFeatureWriter.cpp	Mon Oct 13 10:55:43 2014 +0100
+++ b/transform/FileFeatureWriter.cpp	Mon Oct 13 10:56:16 2014 +0100
@@ -98,6 +98,8 @@
             p.hasArg = true;
             pl.push_back(p);
         }
+    }
+    if (m_support & SupportStdOut) {
         p.name = "stdout";
         p.description = "Write all transform results directly to standard output.";
         p.hasArg = false;
@@ -149,7 +151,7 @@
                 }
             }
         } else if (i->first == "stdout") {
-            if (m_support & SupportOneFileTotal) {
+            if (m_support & SupportStdOut) {
                 if (m_singleFileName != "") {
                     SVDEBUG << "FileFeatureWriter::setParameters: WARNING: Both stdout and one-file provided, ignoring stdout" << endl;
                 } else {
--- a/transform/FileFeatureWriter.h	Mon Oct 13 10:55:43 2014 +0100
+++ b/transform/FileFeatureWriter.h	Mon Oct 13 10:56:16 2014 +0100
@@ -50,7 +50,8 @@
     enum FileWriteSupport {
         SupportOneFilePerTrackTransform = 1,
         SupportOneFilePerTrack = 2,
-        SupportOneFileTotal = 4
+        SupportOneFileTotal = 4,
+        SupportStdOut = 8
     };
 
     FileFeatureWriter(int support, QString extension);