Mercurial > hg > sonic-annotator
comparison runner/LabFeatureWriter.cpp @ 176:59abb58b1855
TransformId is not sufficient -- it could be ambiguous (same transform id, different parameters etc). Use the whole transform
author | Chris Cannam |
---|---|
date | Wed, 15 Oct 2014 17:02:48 +0100 |
parents | 237ccacbb85e |
children | 089f1a13963d |
comparison
equal
deleted
inserted
replaced
175:977b7007071f | 176:59abb58b1855 |
---|---|
94 | 94 |
95 int n = features.size(); | 95 int n = features.size(); |
96 | 96 |
97 if (n == 0) return; | 97 if (n == 0) return; |
98 | 98 |
99 TrackTransformPair tt(trackId, transformId); | 99 DataId tt(trackId, transform); |
100 | 100 |
101 if (m_pending.find(tt) != m_pending.end()) { | 101 if (m_pending.find(tt) != m_pending.end()) { |
102 writeFeature(stream, m_pending[tt], &features[0]); | 102 writeFeature(stream, m_pending[tt], &features[0]); |
103 m_pending.erase(tt); | 103 m_pending.erase(tt); |
104 } | 104 } |
117 void | 117 void |
118 LabFeatureWriter::finish() | 118 LabFeatureWriter::finish() |
119 { | 119 { |
120 for (PendingFeatures::const_iterator i = m_pending.begin(); | 120 for (PendingFeatures::const_iterator i = m_pending.begin(); |
121 i != m_pending.end(); ++i) { | 121 i != m_pending.end(); ++i) { |
122 TrackTransformPair tt = i->first; | 122 DataId tt = i->first; |
123 Plugin::Feature f = i->second; | 123 Plugin::Feature f = i->second; |
124 QTextStream *sptr = getOutputStream(tt.first, tt.second); | 124 QTextStream *sptr = getOutputStream(tt.first, tt.second.getIdentifier()); |
125 if (!sptr) { | 125 if (!sptr) { |
126 throw FailedToOpenOutputStream(tt.first, tt.second); | 126 throw FailedToOpenOutputStream(tt.first, tt.second.getIdentifier()); |
127 } | 127 } |
128 QTextStream &stream = *sptr; | 128 QTextStream &stream = *sptr; |
129 // final feature has its own time as end time (we can't | 129 // final feature has its own time as end time (we can't |
130 // reliably determine the end of audio file, and because of | 130 // reliably determine the end of audio file, and because of |
131 // the nature of block processing, the feature could even | 131 // the nature of block processing, the feature could even |