comparison main/MainWindow.cpp @ 1998:6d82eecd4164 import-audio-data

Rely more heavily on the "value"-column estimation from CSVFormat to determine which columns might contain sample data when importing audio from CSV; this makes things a bit more consistent, & can easily enough be overridden
author Chris Cannam
date Wed, 12 Sep 2018 15:29:01 +0100
parents 2b83ca602ece
children 5d3ef2c450cc
comparison
equal deleted inserted replaced
1997:2f14745d8e7b 1998:6d82eecd4164
2887 CSVFormat format(path); 2887 CSVFormat format(path);
2888 format.setModelType(CSVFormat::WaveFileModel); 2888 format.setModelType(CSVFormat::WaveFileModel);
2889 format.setTimingType(CSVFormat::ImplicitTiming); 2889 format.setTimingType(CSVFormat::ImplicitTiming);
2890 format.setTimeUnits(CSVFormat::TimeAudioFrames); 2890 format.setTimeUnits(CSVFormat::TimeAudioFrames);
2891 format.setSampleRate(defaultRate); // as a default for the dialog 2891 format.setSampleRate(defaultRate); // as a default for the dialog
2892
2893 for (int i = 0; i < format.getColumnCount(); ++i) {
2894 if (format.isColumnNumeric(CSVFormat::ColumnNumeric)) {
2895 format.setColumnPurpose(i, CSVFormat::ColumnValue);
2896 }
2897 }
2898 2892
2899 { 2893 {
2900 CSVAudioFormatDialog *dialog = new CSVAudioFormatDialog(this, format); 2894 CSVAudioFormatDialog *dialog = new CSVAudioFormatDialog(this, format);
2901 if (dialog->exec() != QDialog::Accepted) { 2895 if (dialog->exec() != QDialog::Accepted) {
2902 delete dialog; 2896 delete dialog;