annotate widgets/CSVFormatDialog.h @ 1349:615eb28768ca zoom

Merge from default branch
author Chris Cannam
date Mon, 01 Oct 2018 15:48:20 +0100
parents fbda05431ce0
children 0930a27ebea2
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@378 24
Chris@378 25 #include <QDialog>
Chris@378 26
Chris@378 27 class CSVFormatDialog : public QDialog
Chris@378 28 {
Chris@378 29 Q_OBJECT
Chris@378 30
Chris@378 31 public:
Chris@1318 32 CSVFormatDialog(QWidget *parent,
Chris@1318 33 CSVFormat initialFormat,
Chris@581 34 int maxDisplayCols = 5);
Chris@378 35 ~CSVFormatDialog();
Chris@378 36
Chris@378 37 CSVFormat getFormat() const;
Chris@378 38
Chris@378 39 protected slots:
Chris@378 40 void timingTypeChanged(int type);
Chris@378 41 void sampleRateChanged(QString);
Chris@378 42 void windowSizeChanged(QString);
Chris@560 43 void columnPurposeChanged(int purpose);
Chris@959 44
Chris@959 45 void updateFormatFromDialog();
Chris@561 46 void updateModelLabel();
Chris@378 47
Chris@378 48 protected:
Chris@560 49 CSVFormat m_format;
Chris@581 50 int m_maxDisplayCols;
Chris@1318 51
Chris@959 52 enum TimingOption {
Chris@959 53 TimingExplicitSeconds = 0,
Chris@959 54 TimingExplicitMsec,
Chris@959 55 TimingExplicitSamples,
Chris@959 56 TimingImplicit
Chris@959 57 };
Chris@959 58 std::map<TimingOption, QString> m_timingLabels;
Chris@959 59 TimingOption m_initialTimingOption;
Chris@959 60
Chris@1318 61 void columnPurposeChangedForAnnotationType(QComboBox *, int purpose);
Chris@959 62 void updateComboVisibility();
Chris@959 63 void applyStartTimePurpose();
Chris@959 64 void removeStartTimePurpose();
Chris@378 65
Chris@378 66 QComboBox *m_timingTypeCombo;
Chris@378 67 QLabel *m_sampleRateLabel;
Chris@378 68 QComboBox *m_sampleRateCombo;
Chris@378 69 QLabel *m_windowSizeLabel;
Chris@378 70 QComboBox *m_windowSizeCombo;
Chris@561 71 QLabel *m_modelLabel;
Chris@378 72
Chris@560 73 QList<QComboBox *> m_columnPurposeCombos;
Chris@581 74 int m_fuzzyColumn;
Chris@378 75 };
Chris@378 76
Chris@378 77 #endif