svgui  1.9
ItemEditDialog.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 _ITEM_EDIT_DIALOG_H_
17 #define _ITEM_EDIT_DIALOG_H_
18 
19 #include <QDialog>
20 #include <QString>
21 
22 #include "base/RealTime.h"
23 
24 class QSpinBox;
25 class QDoubleSpinBox;
26 class QLineEdit;
27 
28 class ItemEditDialog : public QDialog
29 {
30  Q_OBJECT
31 
32 public:
33  enum {
34  ShowTime = 1 << 0,
35  ShowDuration = 1 << 1,
36  ShowValue = 1 << 2,
37  ShowText = 1 << 3
38  };
39 
40  ItemEditDialog(int sampleRate, int options, QString valueUnits = "",
41  QWidget *parent = 0);
42 
43  void setFrameTime(int frame);
44  int getFrameTime() const;
45 
46  void setRealTime(RealTime rt);
47  RealTime getRealTime() const;
48 
49  void setFrameDuration(int frame);
50  int getFrameDuration() const;
51 
52  void setRealDuration(RealTime rt);
53  RealTime getRealDuration() const;
54 
55  void setValue(float value);
56  float getValue() const;
57 
58  void setText(QString text);
59  QString getText() const;
60 
61 protected slots:
62  void frameTimeChanged(int);
63  void realTimeSecsChanged(int);
64  void realTimeUSecsChanged(int);
65  void frameDurationChanged(int);
66  void realDurationSecsChanged(int);
67  void realDurationUSecsChanged(int);
68  void valueChanged(double);
69  void textChanged(QString);
70  void reset();
71 
72 protected:
77  QString m_defaultText;
78  QSpinBox *m_frameTimeSpinBox;
84  QDoubleSpinBox *m_valueSpinBox;
85  QLineEdit *m_textField;
86  QPushButton *m_resetButton;
87 };
88 
89 #endif
RealTime getRealDuration() const
ItemEditDialog(int sampleRate, int options, QString valueUnits="", QWidget *parent=0)
QSpinBox * m_realDurationSecsSpinBox
QSpinBox * m_frameTimeSpinBox
void valueChanged(double)
void setFrameTime(int frame)
void frameDurationChanged(int)
void realDurationUSecsChanged(int)
QString m_defaultText
QSpinBox * m_realTimeUSecsSpinBox
QSpinBox * m_realTimeSecsSpinBox
int getFrameTime() const
RealTime getRealTime() const
void setText(QString text)
QLineEdit * m_textField
void setRealDuration(RealTime rt)
void realTimeUSecsChanged(int)
QDoubleSpinBox * m_valueSpinBox
QPushButton * m_resetButton
QSpinBox * m_frameDurationSpinBox
void realDurationSecsChanged(int)
void setRealTime(RealTime rt)
void frameTimeChanged(int)
float getValue() const
void textChanged(QString)
QSpinBox * m_realDurationUSecsSpinBox
int getFrameDuration() const
void realTimeSecsChanged(int)
void setValue(float value)
void setFrameDuration(int frame)
QString getText() const