changeset 766:65eb27ea08fd tony_integration

Merge from default branch
author Chris Cannam
date Wed, 07 May 2014 15:12:57 +0100
parents 410816717c2c (current diff) cdafb1a438e8 (diff)
children 336ccf8fc3f8
files
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/widgets/CSVFormatDialog.cpp	Wed May 07 15:12:13 2014 +0100
+++ b/widgets/CSVFormatDialog.cpp	Wed May 07 15:12:57 2014 +0100
@@ -94,6 +94,7 @@
         cpc->addItem(tr("End time")); // ColumnEndTime
         cpc->addItem(tr("Duration")); // ColumnDuration
         cpc->addItem(tr("Value"));    // ColumnValue
+        cpc->addItem(tr("Pitch"));    // ColumnPitch
         cpc->addItem(tr("Label"));    // ColumnLabel
         cpc->setCurrentIndex(int(m_format.getColumnPurpose(i)));
 
@@ -212,6 +213,9 @@
     case CSVFormat::TwoDimensionalModelWithDuration:
         s = f->getLayerPresentationName(LayerFactory::Regions);
         break;
+    case CSVFormat::TwoDimensionalModelWithDurationAndPitch:
+        s = f->getLayerPresentationName(LayerFactory::Notes);
+        break;
     case CSVFormat::ThreeDimensionalModel:
         s = f->getLayerPresentationName(LayerFactory::Colour3DPlot);
         break;
@@ -282,6 +286,7 @@
 
     bool haveStartTime = false;
     bool haveDuration = false;
+    bool havePitch = false;
     int valueCount = 0;
 
     for (int i = 0; i < m_columnPurposeCombos.size(); ++i) {
@@ -343,6 +348,9 @@
             cp == CSVFormat::ColumnDuration) {
             haveDuration = true;
         }
+        if (cp == CSVFormat::ColumnPitch) {
+            havePitch = true;
+        }
         if (cp == CSVFormat::ColumnValue) {
             ++valueCount;
         }
@@ -357,7 +365,11 @@
     }
 
     if (haveStartTime && haveDuration) {
-        m_format.setModelType(CSVFormat::TwoDimensionalModelWithDuration);
+        if (havePitch) {
+            m_format.setModelType(CSVFormat::TwoDimensionalModelWithDurationAndPitch);
+        } else {
+            m_format.setModelType(CSVFormat::TwoDimensionalModelWithDuration);
+        }
     } else {
         if (valueCount > 1) {
             m_format.setModelType(CSVFormat::ThreeDimensionalModel);