changeset 1510:5f1b2a117a4f import-audio-data

Debug etc
author Chris Cannam
date Wed, 05 Sep 2018 11:56:45 +0100
parents 3299b42d8bdd
children 12b7a9613eb5
files data/fileio/CSVFormat.cpp data/fileio/CSVFormat.h
diffstat 2 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data/fileio/CSVFormat.cpp	Wed Sep 05 11:56:39 2018 +0100
+++ b/data/fileio/CSVFormat.cpp	Wed Sep 05 11:56:45 2018 +0100
@@ -91,6 +91,8 @@
     for (int i = 0; i < int(sizeof(candidates)/sizeof(candidates[0])); ++i) {
         if (StringBits::split(line, candidates[i], m_allowQuoting).size() >= 2) {
             m_separator = candidates[i];
+            SVDEBUG << "Estimated column separator: '" << m_separator
+                    << "'" << endl;
             return;
         }
     }
@@ -200,6 +202,12 @@
         
     int timingColumnCount = 0;
 
+    SVDEBUG << "Estimated column qualities overall: ";
+    for (int i = 0; i < m_columnCount; ++i) {
+        SVDEBUG << int(m_columnQualities[i]) << " ";
+    }
+    SVDEBUG << endl;
+
     // if our first column has zero or one entries in it and the rest
     // have more, then we'll default to ignoring the first column and
     // counting the next one as primary. (e.g. Sonic Annotator output
--- a/data/fileio/CSVFormat.h	Wed Sep 05 11:56:39 2018 +0100
+++ b/data/fileio/CSVFormat.h	Wed Sep 05 11:56:45 2018 +0100
@@ -117,10 +117,15 @@
     void setColumnPurpose(int i, ColumnPurpose p);
     
     // read-only; only valid if format has been guessed:
-    QList<ColumnQualities> getColumnQualities() const { return m_columnQualities; }
+    const QList<ColumnQualities> &getColumnQualities() const {
+        return m_columnQualities;
+    }
 
     // read-only; only valid if format has been guessed:
-    QList<QStringList> getExample() const { return m_example; }
+    const QList<QStringList> &getExample() const {
+        return m_example;
+    }
+    
     int getMaxExampleCols() const { return m_maxExampleCols; }
         
 protected: