Chris@70: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@70: Chris@70: /* Chris@70: Sonic Visualiser Chris@70: An audio file viewer and annotation editor. Chris@70: Centre for Digital Music, Queen Mary, University of London. Chris@70: This file copyright 2006 Chris Cannam. Chris@70: Chris@70: This program is free software; you can redistribute it and/or Chris@70: modify it under the terms of the GNU General Public License as Chris@70: published by the Free Software Foundation; either version 2 of the Chris@70: License, or (at your option) any later version. See the file Chris@70: COPYING included with this distribution for more information. Chris@70: */ Chris@70: Chris@70: #ifndef _ITEM_EDIT_DIALOG_H_ Chris@70: #define _ITEM_EDIT_DIALOG_H_ Chris@70: Chris@70: #include Chris@70: #include Chris@70: Chris@70: #include "base/RealTime.h" Chris@70: Chris@73: class QSpinBox; Chris@73: class QDoubleSpinBox; Chris@73: class QLineEdit; Chris@73: Chris@70: class ItemEditDialog : public QDialog Chris@70: { Chris@70: Q_OBJECT Chris@70: Chris@70: public: Chris@70: enum { Chris@70: ShowTime = 1 << 0, Chris@70: ShowDuration = 1 << 1, Chris@70: ShowValue = 1 << 2, Chris@70: ShowText = 1 << 3 Chris@70: }; Chris@70: Chris@904: ItemEditDialog(sv_samplerate_t sampleRate, int options, QString valueUnits = "", Chris@73: QWidget *parent = 0); Chris@70: Chris@904: void setFrameTime(sv_frame_t frame); Chris@904: sv_frame_t getFrameTime() const; Chris@70: Chris@70: void setRealTime(RealTime rt); Chris@70: RealTime getRealTime() const; Chris@70: Chris@904: void setFrameDuration(sv_frame_t frame); Chris@904: sv_frame_t getFrameDuration() const; Chris@70: Chris@70: void setRealDuration(RealTime rt); Chris@70: RealTime getRealDuration() const; Chris@70: Chris@70: void setValue(float value); Chris@70: float getValue() const; Chris@73: Chris@70: void setText(QString text); Chris@70: QString getText() const; Chris@70: Chris@70: protected slots: Chris@938: void frameTimeChanged(int); // must be int as invoked from int signal Chris@73: void realTimeSecsChanged(int); Chris@73: void realTimeUSecsChanged(int); Chris@938: void frameDurationChanged(int); // must be int as invoked from int signal Chris@73: void realDurationSecsChanged(int); Chris@73: void realDurationUSecsChanged(int); Chris@70: void valueChanged(double); Chris@70: void textChanged(QString); Chris@73: void reset(); Chris@70: Chris@70: protected: Chris@904: sv_samplerate_t m_sampleRate; Chris@904: sv_frame_t m_defaultFrame; Chris@904: sv_frame_t m_defaultDuration; Chris@73: float m_defaultValue; Chris@73: QString m_defaultText; Chris@73: QSpinBox *m_frameTimeSpinBox; Chris@73: QSpinBox *m_realTimeSecsSpinBox; Chris@73: QSpinBox *m_realTimeUSecsSpinBox; Chris@73: QSpinBox *m_frameDurationSpinBox; Chris@73: QSpinBox *m_realDurationSecsSpinBox; Chris@73: QSpinBox *m_realDurationUSecsSpinBox; Chris@73: QDoubleSpinBox *m_valueSpinBox; Chris@73: QLineEdit *m_textField; Chris@73: QPushButton *m_resetButton; Chris@70: }; Chris@70: Chris@70: #endif