Mercurial > hg > sonic-annotator
comparison runner/AudioDBFeatureWriter.cpp @ 138:ee56e3e9eeb5
Add -Werror in debug mode, and fix errors resulting from it
author | Chris Cannam |
---|---|
date | Mon, 13 Oct 2014 11:42:54 +0100 |
parents | 92911f967a16 |
children | b3d73c08b6ce |
comparison
equal
deleted
inserted
replaced
135:caf05503bf42 | 138:ee56e3e9eeb5 |
---|---|
97 { | 97 { |
98 baseDir = base; | 98 baseDir = base; |
99 } | 99 } |
100 | 100 |
101 void AudioDBFeatureWriter::write(QString trackid, | 101 void AudioDBFeatureWriter::write(QString trackid, |
102 const Transform &transform, | 102 const Transform &, |
103 const Vamp::Plugin::OutputDescriptor& output, | 103 const Vamp::Plugin::OutputDescriptor& output, |
104 const Vamp::Plugin::FeatureList& featureList, | 104 const Vamp::Plugin::FeatureList& featureList, |
105 std::string summaryType) | 105 std::string summaryType) |
106 { | 106 { |
107 //!!! use summaryType | 107 //!!! use summaryType |
133 // - write a power file, probably by wrapping plugin in a PluginPowerAdapter :) | 133 // - write a power file, probably by wrapping plugin in a PluginPowerAdapter :) |
134 | 134 |
135 if (output.binCount == 0) // this kind of feature just outputs timestamps and labels, assume of no interest to audioDB | 135 if (output.binCount == 0) // this kind of feature just outputs timestamps and labels, assume of no interest to audioDB |
136 return; | 136 return; |
137 | 137 |
138 for (int i = 0; i < featureList.size(); ++i) | 138 for (int i = 0; i < (int)featureList.size(); ++i) { |
139 { | 139 |
140 // replace output files if necessary | 140 // replace output files if necessary |
141 if (replaceDBFile(trackid, output.identifier)) | 141 if (replaceDBFile(trackid, output.identifier)) |
142 { | 142 { |
143 // write the feature length for the next track feature record | 143 // write the feature length for the next track feature record |
144 // binCount has to be set | 144 // binCount has to be set |
154 // as we want it for the first feature in the file | 154 // as we want it for the first feature in the file |
155 *dbfiles[output.identifier + ".timestamp"].ofs << featureList[i].timestamp.toString() << endl; | 155 *dbfiles[output.identifier + ".timestamp"].ofs << featureList[i].timestamp.toString() << endl; |
156 } | 156 } |
157 | 157 |
158 if (dbfiles[output.identifier].ofs) { | 158 if (dbfiles[output.identifier].ofs) { |
159 for (int j = 0; j < featureList[i].values.size(); ++j) | 159 for (int j = 0; j < (int) featureList[i].values.size(); ++j) |
160 *dbfiles[output.identifier].ofs /*<< ios::binary*/ << featureList[i].values[j]; | 160 *dbfiles[output.identifier].ofs /*<< ios::binary*/ << featureList[i].values[j]; |
161 | 161 |
162 // write the *end* time of each feature to the timestamp file | 162 // write the *end* time of each feature to the timestamp file |
163 // NOT IMPLEMENTED YET | 163 // NOT IMPLEMENTED YET |
164 // *dbfiles[output.identifier + ".timestamp"].ofs << featureList[i].timestamp.toString() << endl; | 164 // *dbfiles[output.identifier + ".timestamp"].ofs << featureList[i].timestamp.toString() << endl; |