changeset 799:c808c57e5560 qt5 sonic-annotator-1.0

Merge from the default branch
author Chris Cannam
date Wed, 08 May 2013 09:37:21 +0100
parents c1fcfdf43a01 (current diff) fea591a66e5d (diff)
children 9207c142b461 a2eb9de7302e
files configure configure.ac
diffstat 2 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/data/model/SparseModel.h	Wed May 08 09:33:32 2013 +0100
+++ b/data/model/SparseModel.h	Wed May 08 09:37:21 2013 +0100
@@ -436,11 +436,15 @@
         PointListConstIterator i = i0;
 
         for (i = i0; i != i1; ++i) {
+//            std::cerr << "i->frame is " << i->frame << ", wanting " << frame << std::endl;
+
             if (i->frame < (int)frame) { continue; }
             if (indexAtFrame > 0) { --indexAtFrame; continue; }
             return i;
         }
 
+//        std::cerr << "returning i with i->frame = " << i->frame << std::endl;
+
         if (indexAtFrame > 0) {
             std::cerr << "WARNING: SparseModel::getPointListIteratorForRow: No iterator available for row " << row << " (frame = " << frame << ", index at frame = " << initialIndexAtFrame << ", leftover index " << indexAtFrame << ")" << std::endl;
         }
@@ -598,6 +602,7 @@
     QMutexLocker locker(&m_mutex);
 
     if (m_resolution == 0) {
+//        std::cerr << "getPointIterators: resolution == 0, returning end()" << std::endl;
         startItr = m_points.end();
         endItr = m_points.end();
         return;
@@ -609,7 +614,7 @@
     PointType startPoint(start), endPoint(end);
     
 //    std::cerr << "getPointIterators: start frame " << start << ", end frame " << end << ", m_resolution " << m_resolution << std::endl;
-    
+
     startItr = m_points.lower_bound(startPoint);
       endItr = m_points.upper_bound(endPoint);
 }
--- a/transform/FeatureExtractionModelTransformer.cpp	Wed May 08 09:33:32 2013 +0100
+++ b/transform/FeatureExtractionModelTransformer.cpp	Wed May 08 09:37:21 2013 +0100
@@ -202,6 +202,14 @@
     size_t modelRate = input->getSampleRate();
     size_t modelResolution = 1;
 
+    if (m_descriptor->sampleType != 
+        Vamp::Plugin::OutputDescriptor::OneSamplePerStep) {
+        if (m_descriptor->sampleRate > input->getSampleRate()) {
+            std::cerr << "WARNING: plugin reports output sample rate as "
+                      << m_descriptor->sampleRate << " (can't display features with finer resolution than the input rate of " << input->getSampleRate() << ")" << std::endl;
+        }
+    }
+
     switch (m_descriptor->sampleType) {
 
     case Vamp::Plugin::OutputDescriptor::VariableSampleRate:
@@ -674,8 +682,7 @@
         frame = lrintf((m_fixedRateFeatureNo / m_descriptor->sampleRate)
                        * inputRate);
 
-        std::cerr << "Feature hasTimestamp = " << feature.hasTimestamp << ", timestamp = " << feature.timestamp << ", frame works out to " << frame << std::endl;
-
+//        std::cerr << "Feature hasTimestamp = " << feature.hasTimestamp << ", timestamp = " << feature.timestamp << ", frame works out to " << frame << std::endl;
     }
 	
     // Rather than repeat the complicated tests from the constructor
@@ -707,8 +714,6 @@
                 label = QString("[%1] %2").arg(i+1).arg(label);
             }
 
-            std::cerr << "Adding point at " << frame << " with value " << value << " and label " << label << std::endl;
-
             model->addPoint(SparseTimeValueModel::Point(frame, value, label));
         }