Mercurial > hg > sonic-annotator
changeset 324:ef03350baec7
Switch some more cerrs to SVCERRs
author | Chris Cannam |
---|---|
date | Fri, 18 May 2018 11:27:02 +0100 |
parents | 50461005ffcb |
children | d5caf5e91a86 0a56cf975768 |
files | runner/AudioDBFeatureWriter.cpp runner/JAMSFeatureWriter.cpp runner/LabFeatureWriter.cpp runner/MIDIFeatureWriter.cpp |
diffstat | 4 files changed, 23 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/runner/AudioDBFeatureWriter.cpp Fri May 18 10:05:03 2018 +0100 +++ b/runner/AudioDBFeatureWriter.cpp Fri May 18 11:27:02 2018 +0100 @@ -113,7 +113,7 @@ //!!! use summaryType if (summaryType != "") { //!!! IMPLEMENT - cerr << "ERROR: AudioDBFeatureWriter::write: Writing summaries is not yet implemented!" << endl; + SVCERR << "ERROR: AudioDBFeatureWriter::write: Writing summaries is not yet implemented!" << endl; exit(1); } @@ -151,7 +151,7 @@ // - it can be zero, i.e. if the output is really a set of labels + timestamps *dbfiles[output.identifier].ofs /*<< ios::binary*/ << output.binCount; - cerr << "writing bin count " << output.binCount << " for " << output.identifier << endl; + SVCERR << "writing bin count " << output.binCount << " for " << output.identifier << endl; } if (replaceDBFile(trackid, output.identifier + ".timestamp")) @@ -177,11 +177,11 @@ QString trackBase = QFileInfo(trackid).fileName(); string filepath = baseDir + "/" + catalogueId + "/" + trackBase.toStdString() + "." + identifier; - cerr << "AudioDBFeatureWriter::openDBFile: filepath is \"" << filepath << "\"" << endl; + SVCERR << "AudioDBFeatureWriter::openDBFile: filepath is \"" << filepath << "\"" << endl; ofstream* ofs = new ofstream(filepath.c_str()); if (!*ofs) { - cerr << "ERROR AudioDBFeatureWriter::openDBFile(): can't open file " << filepath << endl; + SVCERR << "ERROR AudioDBFeatureWriter::openDBFile(): can't open file " << filepath << endl; return false; } TrackStream ts;
--- a/runner/JAMSFeatureWriter.cpp Fri May 18 10:05:03 2018 +0100 +++ b/runner/JAMSFeatureWriter.cpp Fri May 18 11:27:02 2018 +0100 @@ -20,6 +20,7 @@ using Vamp::PluginBase; #include "base/Exceptions.h" +#include "base/Debug.h" #include "rdf/PluginRDFIndexer.h" #include <QFileInfo> @@ -82,8 +83,8 @@ } else if (i->first == "digits") { int digits = atoi(i->second.c_str()); if (digits <= 0 || digits > 100) { - cerr << "JAMSFeatureWriter: ERROR: Invalid or out-of-range value for number of significant digits: " << i->second << endl; - cerr << "JAMSFeatureWriter: NOTE: Continuing with default settings" << endl; + SVCERR << "JAMSFeatureWriter: ERROR: Invalid or out-of-range value for number of significant digits: " << i->second << endl; + SVCERR << "JAMSFeatureWriter: NOTE: Continuing with default settings" << endl; } else { m_digits = digits; } @@ -338,14 +339,14 @@ m_rdfDescriptions[pluginId] = PluginRDFDescription(pluginId); if (m_rdfDescriptions[pluginId].haveDescription()) { - cerr << "NOTE: Have RDF description for plugin ID \"" + SVCERR << "NOTE: Have RDF description for plugin ID \"" << pluginId << "\"" << endl; } else { - cerr << "NOTE: No RDF description for plugin ID \"" + SVCERR << "NOTE: No RDF description for plugin ID \"" << pluginId << "\"" << endl; if (!m_network) { - cerr << " Consider using the --jams-network option to retrieve plugin descriptions" << endl; - cerr << " from the network where possible." << endl; + SVCERR << " Consider using the --jams-network option to retrieve plugin descriptions" << endl; + SVCERR << " from the network where possible." << endl; } } } @@ -399,14 +400,14 @@ } else if (eventUri == af + "StructuralSegment") { task = SegmentTask; } else { - cerr << "WARNING: Unsupported event type URI <" + SVCERR << "WARNING: Unsupported event type URI <" << eventUri << ">, proceeding with UnknownTask type" << endl; } } else { - cerr << "WARNING: Cannot currently write dense or track-level outputs to JAMS format (only sparse ones). Will proceed using UnknownTask type, but this probably isn't going to work" << endl; + SVCERR << "WARNING: Cannot currently write dense or track-level outputs to JAMS format (only sparse ones). Will proceed using UnknownTask type, but this probably isn't going to work" << endl; } }
--- a/runner/LabFeatureWriter.cpp Fri May 18 10:05:03 2018 +0100 +++ b/runner/LabFeatureWriter.cpp Fri May 18 11:27:02 2018 +0100 @@ -79,8 +79,8 @@ } else if (i->first == "digits") { int digits = atoi(i->second.c_str()); if (digits <= 0 || digits > 100) { - cerr << "LabFeatureWriter: ERROR: Invalid or out-of-range value for number of significant digits: " << i->second << endl; - cerr << "LabFeatureWriter: NOTE: Continuing with default settings" << endl; + SVCERR << "LabFeatureWriter: ERROR: Invalid or out-of-range value for number of significant digits: " << i->second << endl; + SVCERR << "LabFeatureWriter: NOTE: Continuing with default settings" << endl; } else { m_digits = digits; }
--- a/runner/MIDIFeatureWriter.cpp Fri May 18 10:05:03 2018 +0100 +++ b/runner/MIDIFeatureWriter.cpp Fri May 18 11:27:02 2018 +0100 @@ -20,6 +20,7 @@ using Vamp::PluginBase; #include "base/Exceptions.h" +#include "base/Debug.h" #include "data/fileio/MIDIFileWriter.h" //#define DEBUG_MIDI_FEATURE_WRITER 1 @@ -58,7 +59,7 @@ void MIDIFeatureWriter::setTrackMetadata(QString, TrackMetadata) { - cerr << "MIDIFeatureWriter::setTrackMetadata: not supported (yet?)" << endl; + SVCERR << "MIDIFeatureWriter::setTrackMetadata: not supported (yet?)" << endl; } void @@ -112,8 +113,8 @@ } #ifdef DEBUG_MIDI_FEATURE_WRITER - cerr << "feature timestamp = " << feature.timestamp << ", sampleRate = " << sampleRate << ", frame = " << frame << endl; - cerr << "feature duration = " << feature.duration << ", sampleRate = " << sampleRate << ", duration = " << duration << endl; + SVCERR << "feature timestamp = " << feature.timestamp << ", sampleRate = " << sampleRate << ", frame = " << frame << endl; + SVCERR << "feature duration = " << feature.duration << ", sampleRate = " << sampleRate << ", duration = " << duration << endl; #endif int pitch = 60; @@ -158,16 +159,16 @@ { MIDIFileWriter writer(filename, &exportable, rate); if (!writer.isOK()) { - cerr << "ERROR: Failed to create MIDI writer: " - << writer.getError() << endl; + SVCERR << "ERROR: Failed to create MIDI writer: " + << writer.getError() << endl; throw FileOperationFailed(filename, "create MIDI writer"); } writer.write(); if (!writer.isOK()) { - cerr << "ERROR: Failed to write to MIDI file: " - << writer.getError() << endl; + SVCERR << "ERROR: Failed to write to MIDI file: " + << writer.getError() << endl; throw FileOperationFailed(filename, "MIDI write"); } }