annotate widgets/CSVFormatDialog.h @ 1562:3b45788b7804 spectrogram-export

Provide parameters needed for scale and thresholding
author Chris Cannam
date Thu, 09 Jan 2020 14:35:41 +0000
parents 0930a27ebea2
children 129c704566ff
rev   line source
Chris@378 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@378 2
Chris@378 3 /*
Chris@378 4 Sonic Visualiser
Chris@378 5 An audio file viewer and annotation editor.
Chris@378 6 Centre for Digital Music, Queen Mary, University of London.
Chris@378 7 This file copyright 2006 Chris Cannam.
Chris@378 8
Chris@378 9 This program is free software; you can redistribute it and/or
Chris@378 10 modify it under the terms of the GNU General Public License as
Chris@378 11 published by the Free Software Foundation; either version 2 of the
Chris@378 12 License, or (at your option) any later version. See the file
Chris@378 13 COPYING included with this distribution for more information.
Chris@378 14 */
Chris@378 15
Chris@1312 16 #ifndef SV_CSV_FORMAT_DIALOG_H
Chris@1312 17 #define SV_CSV_FORMAT_DIALOG_H
Chris@378 18
Chris@378 19 #include "data/fileio/CSVFormat.h"
Chris@378 20
Chris@378 21 class QTableWidget;
Chris@378 22 class QComboBox;
Chris@378 23 class QLabel;
Chris@1413 24 class QFrame;
Chris@378 25
Chris@378 26 #include <QDialog>
Chris@378 27
Chris@378 28 class CSVFormatDialog : public QDialog
Chris@378 29 {
Chris@378 30 Q_OBJECT
Chris@378 31
Chris@378 32 public:
Chris@1318 33 CSVFormatDialog(QWidget *parent,
Chris@1318 34 CSVFormat initialFormat,
Chris@1413 35 int maxDisplayCols);
Chris@1413 36
Chris@1413 37 CSVFormatDialog(QWidget *parent,
Chris@1413 38 QString csvFilePath, // to guess format of
Chris@1413 39 sv_samplerate_t referenceSampleRate,
Chris@1413 40 int maxDisplayCols);
Chris@1413 41
Chris@378 42 ~CSVFormatDialog();
Chris@378 43
Chris@378 44 CSVFormat getFormat() const;
Chris@378 45
Chris@378 46 protected slots:
Chris@1413 47 void separatorChanged(QString);
Chris@378 48 void timingTypeChanged(int type);
Chris@378 49 void sampleRateChanged(QString);
Chris@378 50 void windowSizeChanged(QString);
Chris@560 51 void columnPurposeChanged(int purpose);
Chris@959 52
Chris@959 53 void updateFormatFromDialog();
Chris@561 54 void updateModelLabel();
Chris@378 55
Chris@378 56 protected:
Chris@1413 57 QString m_csvFilePath;
Chris@1413 58 sv_samplerate_t m_referenceSampleRate;
Chris@560 59 CSVFormat m_format;
Chris@581 60 int m_maxDisplayCols;
Chris@1318 61
Chris@959 62 enum TimingOption {
Chris@959 63 TimingExplicitSeconds = 0,
Chris@959 64 TimingExplicitMsec,
Chris@959 65 TimingExplicitSamples,
Chris@959 66 TimingImplicit
Chris@959 67 };
Chris@959 68 std::map<TimingOption, QString> m_timingLabels;
Chris@959 69 TimingOption m_initialTimingOption;
Chris@959 70
Chris@1413 71 void init();
Chris@1413 72 void repopulate();
Chris@1318 73 void columnPurposeChangedForAnnotationType(QComboBox *, int purpose);
Chris@959 74 void updateComboVisibility();
Chris@959 75 void applyStartTimePurpose();
Chris@959 76 void removeStartTimePurpose();
Chris@1413 77
Chris@1413 78 QFrame *m_exampleFrame;
Chris@1413 79 int m_exampleFrameRow;
Chris@378 80
Chris@1413 81 QComboBox *m_separatorCombo;
Chris@378 82 QComboBox *m_timingTypeCombo;
Chris@378 83 QLabel *m_sampleRateLabel;
Chris@378 84 QComboBox *m_sampleRateCombo;
Chris@378 85 QLabel *m_windowSizeLabel;
Chris@378 86 QComboBox *m_windowSizeCombo;
Chris@561 87 QLabel *m_modelLabel;
Chris@378 88
Chris@560 89 QList<QComboBox *> m_columnPurposeCombos;
Chris@581 90 int m_fuzzyColumn;
Chris@378 91 };
Chris@378 92
Chris@378 93 #endif