comparison main/MainWindow.cpp @ 1779:b660b2fa8411 streaming-csv-writer

Add Lucas's progress dialog change for CSV export
author Chris Cannam
date Mon, 16 Apr 2018 15:23:01 +0100
parents 893f556cd5c9
children 95248f6b9b1d
comparison
equal deleted inserted replaced
1778:08eb2053ef37 1779:b660b2fa8411
56 #include "widgets/KeyReference.h" 56 #include "widgets/KeyReference.h"
57 #include "widgets/TransformFinder.h" 57 #include "widgets/TransformFinder.h"
58 #include "widgets/LabelCounterInputDialog.h" 58 #include "widgets/LabelCounterInputDialog.h"
59 #include "widgets/ActivityLog.h" 59 #include "widgets/ActivityLog.h"
60 #include "widgets/UnitConverter.h" 60 #include "widgets/UnitConverter.h"
61 #include "widgets/ProgressDialog.h"
61 #include "audio/AudioCallbackPlaySource.h" 62 #include "audio/AudioCallbackPlaySource.h"
62 #include "audio/AudioCallbackRecordTarget.h" 63 #include "audio/AudioCallbackRecordTarget.h"
63 #include "audio/PlaySpeedRangeMapper.h" 64 #include "audio/PlaySpeedRangeMapper.h"
64 #include "data/fileio/DataFileReaderFactory.h" 65 #include "data/fileio/DataFileReaderFactory.h"
65 #include "data/fileio/PlaylistFileReader.h" 66 #include "data/fileio/PlaylistFileReader.h"
2724 } 2725 }
2725 } 2726 }
2726 2727
2727 if (!multiple) { 2728 if (!multiple) {
2728 if (asData) { 2729 if (asData) {
2729 CSVFileWriter writer(path, model, 2730 stop();
2731 ProgressDialog dialog {
2732 QObject::tr("Exporting audio data..."),
2733 true,
2734 0,
2735 this,
2736 Qt::ApplicationModal
2737 };
2738 CSVFileWriter writer(path, model, &dialog,
2730 ((QFileInfo(path).suffix() == "csv") ? 2739 ((QFileInfo(path).suffix() == "csv") ?
2731 "," : "\t")); 2740 "," : "\t"));
2732 if (selectionToWrite) { 2741 if (selectionToWrite) {
2733 writer.writeSelection(selectionToWrite); 2742 writer.writeSelection(*selectionToWrite);
2734 } else { 2743 } else {
2735 writer.write(); 2744 writer.write();
2736 } 2745 }
2737 ok = writer.isOK(); 2746 ok = writer.isOK();
2738 error = writer.getError(); 2747 error = writer.getError();