comparison layer/TimeInstantLayer.cpp @ 552:2e8194a30f40 sv-v1.7.1

* Layer data editor window: fix sorting for columns in region model, add Find feature * RDF import: assign names to layers based on event types, if no suitable labels are found in the RDF * Add label to status bar showing the last text that was passed in current layer (so e.g. counting 1, 2, 3, 4 if that's what beats are labelled) * Better layout of text labels for region layers in segmentation mode when they are close together * Give text layer the same method for finding "nearest point" as region and note layers, should improve its editability
author Chris Cannam
date Thu, 22 Oct 2009 15:54:21 +0000
parents b3140e9e0665
children a4ba6c96b66d
comparison
equal deleted inserted replaced
551:c2ba2796cbee 552:2e8194a30f40
199 199
200 return usePoints; 200 return usePoints;
201 } 201 }
202 202
203 QString 203 QString
204 TimeInstantLayer::getLabelPreceding(size_t frame) const
205 {
206 if (!m_model) return "";
207 SparseOneDimensionalModel::PointList points = m_model->getPreviousPoints(frame);
208 for (SparseOneDimensionalModel::PointList::const_iterator i = points.begin();
209 i != points.end(); ++i) {
210 if (i->label != "") return i->label;
211 }
212 return "";
213 }
214
215 QString
204 TimeInstantLayer::getFeatureDescription(View *v, QPoint &pos) const 216 TimeInstantLayer::getFeatureDescription(View *v, QPoint &pos) const
205 { 217 {
206 int x = pos.x(); 218 int x = pos.x();
207 219
208 if (!m_model || !m_model->getSampleRate()) return ""; 220 if (!m_model || !m_model->getSampleRate()) return "";