Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 1991:0cdf87d2f05b import-audio-data
Range and normalisation work
| author | Chris Cannam | 
|---|---|
| date | Fri, 07 Sep 2018 16:15:49 +0100 | 
| parents | 0088a8f452ff | 
| children | 64e8701e77b4 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 1990:3f3986821ee4 | 1991:0cdf87d2f05b | 
|---|---|
| 2902 if (format.isColumnNumeric(CSVFormat::ColumnNumeric)) { | 2902 if (format.isColumnNumeric(CSVFormat::ColumnNumeric)) { | 
| 2903 format.setColumnPurpose(i, CSVFormat::ColumnValue); | 2903 format.setColumnPurpose(i, CSVFormat::ColumnValue); | 
| 2904 } | 2904 } | 
| 2905 } | 2905 } | 
| 2906 | 2906 | 
| 2907 CSVAudioFormatDialog::CSVSampleRange range; | |
| 2908 | |
| 2907 { | 2909 { | 
| 2908 CSVAudioFormatDialog *dialog = new CSVAudioFormatDialog(this, format); | 2910 CSVAudioFormatDialog *dialog = new CSVAudioFormatDialog(this, format); | 
| 2909 if (dialog->exec() != QDialog::Accepted) { | 2911 if (dialog->exec() != QDialog::Accepted) { | 
| 2910 delete dialog; | 2912 delete dialog; | 
| 2911 return; | 2913 return; | 
| 2912 } | 2914 } | 
| 2913 format = dialog->getFormat(); | 2915 format = dialog->getFormat(); | 
| 2916 range = dialog->getSampleRange(); | |
| 2914 delete dialog; | 2917 delete dialog; | 
| 2915 } | 2918 } | 
| 2916 | 2919 | 
| 2917 FileOpenStatus status = FileOpenSucceeded; | 2920 FileOpenStatus status = FileOpenSucceeded; | 
| 2918 | 2921 | 
| 2919 ProgressDialog *progress = new ProgressDialog | 2922 ProgressDialog *progress = new ProgressDialog | 
| 2920 (tr("Importing audio data..."), true, 0, this, Qt::ApplicationModal); | 2923 (tr("Importing audio data..."), true, 0, this, Qt::ApplicationModal); | 
| 2924 | |
| 2925 //!!! + sample range / scaling | |
| 2926 (void)range; | |
| 2921 | 2927 | 
| 2922 WaveFileModel *model = qobject_cast<WaveFileModel *> | 2928 WaveFileModel *model = qobject_cast<WaveFileModel *> | 
| 2923 (DataFileReaderFactory::loadCSV | 2929 (DataFileReaderFactory::loadCSV | 
| 2924 (path, format, | 2930 (path, format, | 
| 2925 getMainModel() ? getMainModel()->getSampleRate() : rate, | 2931 getMainModel() ? getMainModel()->getSampleRate() : rate, | 
