# HG changeset patch # User Chris Cannam # Date 1228926271 0 # Node ID 1aefb666ecfc3b20ea6f1098f53a80ee09e7ed35 # Parent 6acdddf6f99e7ea1bce08ba5c451ac6f61202fb4 * writer flush diff -r 6acdddf6f99e -r 1aefb666ecfc base/ProgressPrinter.cpp --- a/base/ProgressPrinter.cpp Wed Dec 10 13:21:10 2008 +0000 +++ b/base/ProgressPrinter.cpp Wed Dec 10 16:24:31 2008 +0000 @@ -52,6 +52,12 @@ } void +ProgressPrinter::done() +{ + setProgress(100); +} + +void ProgressPrinter::setProgress(int progress) { if (progress == m_lastProgress) return; diff -r 6acdddf6f99e -r 1aefb666ecfc base/ProgressPrinter.h --- a/base/ProgressPrinter.h Wed Dec 10 13:21:10 2008 +0000 +++ b/base/ProgressPrinter.h Wed Dec 10 16:24:31 2008 +0000 @@ -34,6 +34,7 @@ public slots: virtual void setMessage(QString); virtual void setProgress(int); + virtual void done(); protected: QString m_prefix; diff -r 6acdddf6f99e -r 1aefb666ecfc transform/FeatureWriter.h --- a/transform/FeatureWriter.h Wed Dec 10 13:21:10 2008 +0000 +++ b/transform/FeatureWriter.h Wed Dec 10 16:24:31 2008 +0000 @@ -67,6 +67,8 @@ const Vamp::Plugin::FeatureList &features, std::string summaryType = "") = 0; + virtual void flush() { } // whatever the last stream was + virtual void finish() = 0; }; diff -r 6acdddf6f99e -r 1aefb666ecfc transform/FileFeatureWriter.cpp --- a/transform/FileFeatureWriter.cpp Wed Dec 10 13:21:10 2008 +0000 +++ b/transform/FileFeatureWriter.cpp Wed Dec 10 16:24:31 2008 +0000 @@ -271,3 +271,12 @@ return stream; } + +void +FileFeatureWriter::flush() +{ + if (m_prevstream) { + m_prevstream->flush(); + } +} + diff -r 6acdddf6f99e -r 1aefb666ecfc transform/FileFeatureWriter.h --- a/transform/FileFeatureWriter.h Wed Dec 10 13:21:10 2008 +0000 +++ b/transform/FileFeatureWriter.h Wed Dec 10 16:24:31 2008 +0000 @@ -42,6 +42,8 @@ virtual ParameterList getSupportedParameters() const; virtual void setParameters(map ¶ms); + virtual void flush(); + protected: enum FileWriteSupport { SupportOneFilePerTrackTransform = 1,