comparison runner/AudioDBFeatureWriter.cpp @ 324:ef03350baec7

Switch some more cerrs to SVCERRs
author Chris Cannam
date Fri, 18 May 2018 11:27:02 +0100
parents b3d73c08b6ce
children 0e866ef12d87
comparison
equal deleted inserted replaced
323:50461005ffcb 324:ef03350baec7
111 std::string summaryType) 111 std::string summaryType)
112 { 112 {
113 //!!! use summaryType 113 //!!! use summaryType
114 if (summaryType != "") { 114 if (summaryType != "") {
115 //!!! IMPLEMENT 115 //!!! IMPLEMENT
116 cerr << "ERROR: AudioDBFeatureWriter::write: Writing summaries is not yet implemented!" << endl; 116 SVCERR << "ERROR: AudioDBFeatureWriter::write: Writing summaries is not yet implemented!" << endl;
117 exit(1); 117 exit(1);
118 } 118 }
119 119
120 120
121 // binary output for FeatureSet 121 // binary output for FeatureSet
149 // write the feature length for the next track feature record 149 // write the feature length for the next track feature record
150 // binCount has to be set 150 // binCount has to be set
151 // - it can be zero, i.e. if the output is really a set of labels + timestamps 151 // - it can be zero, i.e. if the output is really a set of labels + timestamps
152 *dbfiles[output.identifier].ofs /*<< ios::binary*/ << output.binCount; 152 *dbfiles[output.identifier].ofs /*<< ios::binary*/ << output.binCount;
153 153
154 cerr << "writing bin count " << output.binCount << " for " << output.identifier << endl; 154 SVCERR << "writing bin count " << output.binCount << " for " << output.identifier << endl;
155 } 155 }
156 156
157 if (replaceDBFile(trackid, output.identifier + ".timestamp")) 157 if (replaceDBFile(trackid, output.identifier + ".timestamp"))
158 { 158 {
159 // write the start time to the timestamp file 159 // write the start time to the timestamp file
175 bool AudioDBFeatureWriter::openDBFile(QString trackid, const string& identifier) 175 bool AudioDBFeatureWriter::openDBFile(QString trackid, const string& identifier)
176 { 176 {
177 QString trackBase = QFileInfo(trackid).fileName(); 177 QString trackBase = QFileInfo(trackid).fileName();
178 string filepath = baseDir + "/" + catalogueId + "/" 178 string filepath = baseDir + "/" + catalogueId + "/"
179 + trackBase.toStdString() + "." + identifier; 179 + trackBase.toStdString() + "." + identifier;
180 cerr << "AudioDBFeatureWriter::openDBFile: filepath is \"" << filepath << "\"" << endl; 180 SVCERR << "AudioDBFeatureWriter::openDBFile: filepath is \"" << filepath << "\"" << endl;
181 ofstream* ofs = new ofstream(filepath.c_str()); 181 ofstream* ofs = new ofstream(filepath.c_str());
182 if (!*ofs) 182 if (!*ofs)
183 { 183 {
184 cerr << "ERROR AudioDBFeatureWriter::openDBFile(): can't open file " << filepath << endl; 184 SVCERR << "ERROR AudioDBFeatureWriter::openDBFile(): can't open file " << filepath << endl;
185 return false; 185 return false;
186 } 186 }
187 TrackStream ts; 187 TrackStream ts;
188 ts.trackid = trackid; 188 ts.trackid = trackid;
189 ts.ofs = ofs; 189 ts.ofs = ofs;