# HG changeset patch # User Chris Cannam # Date 1399471977 -3600 # Node ID 65eb27ea08fd62101c88d1312ba2cdda8c66210a # Parent 410816717c2ce0edaa51640224a8e42c0dc5b603# Parent cdafb1a438e8cb3d185baea54585fb3c833b8e4f Merge from default branch diff -r 410816717c2c -r 65eb27ea08fd widgets/CSVFormatDialog.cpp --- 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);