CSVFormatDialog.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2006 Chris Cannam.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef SV_CSV_FORMAT_DIALOG_H
17 #define SV_CSV_FORMAT_DIALOG_H
18 
19 #include "data/fileio/CSVFormat.h"
20 
21 class QTableWidget;
22 class QComboBox;
23 class QLabel;
24 class QFrame;
25 class QCheckBox;
26 
27 #include <QDialog>
28 
29 class CSVFormatDialog : public QDialog
30 {
31  Q_OBJECT
32 
33 public:
34  CSVFormatDialog(QWidget *parent,
35  CSVFormat initialFormat,
36  int maxDisplayCols);
37 
38  CSVFormatDialog(QWidget *parent,
39  QString csvFilePath, // to guess format of
40  sv_samplerate_t referenceSampleRate,
41  int maxDisplayCols);
42 
44 
45  CSVFormat getFormat() const;
46 
47 protected slots:
48  void headerChanged(bool);
49  void separatorChanged(QString);
50  void timingTypeChanged(int type);
51  void sampleRateChanged(QString);
52  void windowSizeChanged(QString);
53  void columnPurposeChanged(int purpose);
54 
56  void updateModelLabel();
57 
58 protected:
59  QString m_csvFilePath;
60  sv_samplerate_t m_referenceSampleRate;
61  CSVFormat m_format;
63 
64  enum TimingOption {
69  };
70  std::map<TimingOption, QString> m_timingLabels;
72 
73  void init();
74  void repopulate();
75  void columnPurposeChangedForAnnotationType(QComboBox *, int purpose);
76  void updateComboVisibility();
77  void applyStartTimePurpose();
79 
80  QString m_tabText;
82 
83  QFrame *m_exampleFrame;
85 
86  QCheckBox *m_headerCheckBox;
87  QComboBox *m_separatorCombo;
88  QComboBox *m_timingTypeCombo;
90  QComboBox *m_sampleRateCombo;
92  QComboBox *m_windowSizeCombo;
93  QLabel *m_modelLabel;
94 
95  QList<QComboBox *> m_columnPurposeCombos;
97 };
98 
99 #endif
void windowSizeChanged(QString)
void columnPurposeChangedForAnnotationType(QComboBox *, int purpose)
void timingTypeChanged(int type)
void headerChanged(bool)
QFrame * m_exampleFrame
QLabel * m_modelLabel
TimingOption m_initialTimingOption
sv_samplerate_t m_referenceSampleRate
QComboBox * m_timingTypeCombo
QString m_whitespaceText
CSVFormat m_format
void columnPurposeChanged(int purpose)
CSVFormat getFormat() const
QLabel * m_sampleRateLabel
QComboBox * m_sampleRateCombo
QComboBox * m_windowSizeCombo
void sampleRateChanged(QString)
CSVFormatDialog(QWidget *parent, CSVFormat initialFormat, int maxDisplayCols)
QList< QComboBox * > m_columnPurposeCombos
QLabel * m_windowSizeLabel
std::map< TimingOption, QString > m_timingLabels
QCheckBox * m_headerCheckBox
QComboBox * m_separatorCombo
void separatorChanged(QString)