annotate widgets/ItemEditDialog.h @ 349:369a197737c7

* Various fixes to object lifetime management, particularly in the spectrum layer and for notification of main model deletion. The main purpose of this is to improve the behaviour of the spectrum, but I think it may also help with #1840922 Various crashes in Layer Summary window.
author Chris Cannam
date Wed, 23 Jan 2008 15:43:27 +0000
parents ad1fe715b480
children e4773943c9c1
rev   line source
Chris@70 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@70 2
Chris@70 3 /*
Chris@70 4 Sonic Visualiser
Chris@70 5 An audio file viewer and annotation editor.
Chris@70 6 Centre for Digital Music, Queen Mary, University of London.
Chris@70 7 This file copyright 2006 Chris Cannam.
Chris@70 8
Chris@70 9 This program is free software; you can redistribute it and/or
Chris@70 10 modify it under the terms of the GNU General Public License as
Chris@70 11 published by the Free Software Foundation; either version 2 of the
Chris@70 12 License, or (at your option) any later version. See the file
Chris@70 13 COPYING included with this distribution for more information.
Chris@70 14 */
Chris@70 15
Chris@70 16 #ifndef _ITEM_EDIT_DIALOG_H_
Chris@70 17 #define _ITEM_EDIT_DIALOG_H_
Chris@70 18
Chris@70 19 #include <QDialog>
Chris@70 20 #include <QString>
Chris@70 21
Chris@70 22 #include "base/RealTime.h"
Chris@70 23
Chris@73 24 class QSpinBox;
Chris@73 25 class QDoubleSpinBox;
Chris@73 26 class QLineEdit;
Chris@73 27
Chris@70 28 class ItemEditDialog : public QDialog
Chris@70 29 {
Chris@70 30 Q_OBJECT
Chris@70 31
Chris@70 32 public:
Chris@70 33 enum {
Chris@70 34 ShowTime = 1 << 0,
Chris@70 35 ShowDuration = 1 << 1,
Chris@70 36 ShowValue = 1 << 2,
Chris@70 37 ShowText = 1 << 3
Chris@70 38 };
Chris@70 39
Chris@73 40 ItemEditDialog(size_t sampleRate, int options, QString valueUnits = "",
Chris@73 41 QWidget *parent = 0);
Chris@70 42
Chris@70 43 void setFrameTime(long frame);
Chris@70 44 long getFrameTime() const;
Chris@70 45
Chris@70 46 void setRealTime(RealTime rt);
Chris@70 47 RealTime getRealTime() const;
Chris@70 48
Chris@70 49 void setFrameDuration(long frame);
Chris@70 50 long getFrameDuration() const;
Chris@70 51
Chris@70 52 void setRealDuration(RealTime rt);
Chris@70 53 RealTime getRealDuration() const;
Chris@70 54
Chris@70 55 void setValue(float value);
Chris@70 56 float getValue() const;
Chris@73 57
Chris@70 58 void setText(QString text);
Chris@70 59 QString getText() const;
Chris@70 60
Chris@70 61 protected slots:
Chris@73 62 void frameTimeChanged(int);
Chris@73 63 void realTimeSecsChanged(int);
Chris@73 64 void realTimeUSecsChanged(int);
Chris@73 65 void frameDurationChanged(int);
Chris@73 66 void realDurationSecsChanged(int);
Chris@73 67 void realDurationUSecsChanged(int);
Chris@70 68 void valueChanged(double);
Chris@70 69 void textChanged(QString);
Chris@73 70 void reset();
Chris@70 71
Chris@70 72 protected:
Chris@70 73 size_t m_sampleRate;
Chris@73 74 long m_defaultFrame;
Chris@73 75 long m_defaultDuration;
Chris@73 76 float m_defaultValue;
Chris@73 77 QString m_defaultText;
Chris@73 78 QSpinBox *m_frameTimeSpinBox;
Chris@73 79 QSpinBox *m_realTimeSecsSpinBox;
Chris@73 80 QSpinBox *m_realTimeUSecsSpinBox;
Chris@73 81 QSpinBox *m_frameDurationSpinBox;
Chris@73 82 QSpinBox *m_realDurationSecsSpinBox;
Chris@73 83 QSpinBox *m_realDurationUSecsSpinBox;
Chris@73 84 QDoubleSpinBox *m_valueSpinBox;
Chris@73 85 QLineEdit *m_textField;
Chris@73 86 QPushButton *m_resetButton;
Chris@70 87 };
Chris@70 88
Chris@70 89 #endif