Chris@378: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@378: Chris@378: /* Chris@378: Sonic Visualiser Chris@378: An audio file viewer and annotation editor. Chris@378: Centre for Digital Music, Queen Mary, University of London. Chris@378: This file copyright 2006 Chris Cannam. Chris@378: Chris@378: This program is free software; you can redistribute it and/or Chris@378: modify it under the terms of the GNU General Public License as Chris@378: published by the Free Software Foundation; either version 2 of the Chris@378: License, or (at your option) any later version. See the file Chris@378: COPYING included with this distribution for more information. Chris@378: */ Chris@378: Chris@1312: #ifndef SV_CSV_FORMAT_DIALOG_H Chris@1312: #define SV_CSV_FORMAT_DIALOG_H Chris@378: Chris@378: #include "data/fileio/CSVFormat.h" Chris@378: Chris@378: class QTableWidget; Chris@378: class QComboBox; Chris@378: class QLabel; Chris@1413: class QFrame; Chris@378: Chris@378: #include Chris@378: Chris@378: class CSVFormatDialog : public QDialog Chris@378: { Chris@378: Q_OBJECT Chris@378: Chris@378: public: Chris@1318: CSVFormatDialog(QWidget *parent, Chris@1318: CSVFormat initialFormat, Chris@1413: int maxDisplayCols); Chris@1413: Chris@1413: CSVFormatDialog(QWidget *parent, Chris@1413: QString csvFilePath, // to guess format of Chris@1413: sv_samplerate_t referenceSampleRate, Chris@1413: int maxDisplayCols); Chris@1413: Chris@378: ~CSVFormatDialog(); Chris@378: Chris@378: CSVFormat getFormat() const; Chris@378: Chris@378: protected slots: Chris@1413: void separatorChanged(QString); Chris@378: void timingTypeChanged(int type); Chris@378: void sampleRateChanged(QString); Chris@378: void windowSizeChanged(QString); Chris@560: void columnPurposeChanged(int purpose); Chris@959: Chris@959: void updateFormatFromDialog(); Chris@561: void updateModelLabel(); Chris@378: Chris@378: protected: Chris@1413: QString m_csvFilePath; Chris@1413: sv_samplerate_t m_referenceSampleRate; Chris@560: CSVFormat m_format; Chris@581: int m_maxDisplayCols; Chris@1318: Chris@959: enum TimingOption { Chris@959: TimingExplicitSeconds = 0, Chris@959: TimingExplicitMsec, Chris@959: TimingExplicitSamples, Chris@959: TimingImplicit Chris@959: }; Chris@959: std::map m_timingLabels; Chris@959: TimingOption m_initialTimingOption; Chris@959: Chris@1413: void init(); Chris@1413: void repopulate(); Chris@1318: void columnPurposeChangedForAnnotationType(QComboBox *, int purpose); Chris@959: void updateComboVisibility(); Chris@959: void applyStartTimePurpose(); Chris@959: void removeStartTimePurpose(); Chris@1413: Chris@1413: QFrame *m_exampleFrame; Chris@1413: int m_exampleFrameRow; Chris@378: Chris@1413: QComboBox *m_separatorCombo; Chris@378: QComboBox *m_timingTypeCombo; Chris@378: QLabel *m_sampleRateLabel; Chris@378: QComboBox *m_sampleRateCombo; Chris@378: QLabel *m_windowSizeLabel; Chris@378: QComboBox *m_windowSizeCombo; Chris@561: QLabel *m_modelLabel; Chris@378: Chris@560: QList m_columnPurposeCombos; Chris@581: int m_fuzzyColumn; Chris@378: }; Chris@378: Chris@378: #endif