annotate widgets/PropertyBox.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 2f83b6e3b8ca
children 0bcb449d15f4
rev   line source
Chris@58 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@0 2
Chris@0 3 /*
Chris@59 4 Sonic Visualiser
Chris@59 5 An audio file viewer and annotation editor.
Chris@59 6 Centre for Digital Music, Queen Mary, University of London.
Chris@59 7 This file copyright 2006 Chris Cannam.
Chris@0 8
Chris@59 9 This program is free software; you can redistribute it and/or
Chris@59 10 modify it under the terms of the GNU General Public License as
Chris@59 11 published by the Free Software Foundation; either version 2 of the
Chris@59 12 License, or (at your option) any later version. See the file
Chris@59 13 COPYING included with this distribution for more information.
Chris@0 14 */
Chris@0 15
Chris@0 16 #ifndef _PROPERTY_BOX_H_
Chris@0 17 #define _PROPERTY_BOX_H_
Chris@0 18
Chris@0 19 #include "base/PropertyContainer.h"
Chris@0 20
Chris@0 21 #include <QFrame>
Chris@0 22 #include <map>
Chris@0 23
Chris@33 24 class QLayout;
Chris@33 25 class QWidget;
Chris@0 26 class QGridLayout;
Chris@34 27 class QVBoxLayout;
Chris@107 28 class QLabel;
Chris@185 29 class LEDButton;
Chris@0 30
Chris@0 31 class PropertyBox : public QFrame
Chris@0 32 {
Chris@0 33 Q_OBJECT
Chris@0 34
Chris@0 35 public:
Chris@0 36 PropertyBox(PropertyContainer *);
Chris@0 37 ~PropertyBox();
Chris@0 38
Chris@0 39 PropertyContainer *getContainer() { return m_container; }
Chris@0 40
Chris@34 41 signals:
Chris@34 42 void changePlayGain(float);
Chris@34 43 void changePlayGainDial(int);
Chris@34 44 void changePlayPan(float);
Chris@34 45 void changePlayPanDial(int);
Chris@47 46 void showLayer(bool);
Chris@189 47 void contextHelpChanged(const QString &);
Chris@34 48
Chris@0 49 public slots:
Chris@0 50 void propertyContainerPropertyChanged(PropertyContainer *);
Chris@197 51 void propertyContainerPropertyRangeChanged(PropertyContainer *);
Chris@64 52 void pluginConfigurationChanged(QString);
Chris@185 53 void layerVisibilityChanged(bool);
Chris@0 54
Chris@0 55 protected slots:
Chris@0 56 void propertyControllerChanged(int);
Chris@335 57 void propertyControllerChanged(bool);
Chris@0 58
Chris@34 59 void playGainChanged(float);
Chris@34 60 void playGainDialChanged(int);
Chris@34 61 void playPanChanged(float);
Chris@34 62 void playPanDialChanged(int);
Chris@34 63
Chris@34 64 void populateViewPlayFrame();
Chris@34 65
Chris@100 66 void unitDatabaseChanged();
Chris@285 67 void colourDatabaseChanged();
Chris@100 68
Chris@63 69 void editPlugin();
Chris@63 70
Chris@189 71 void mouseEnteredWidget();
Chris@189 72 void mouseLeftWidget();
Chris@189 73
Chris@0 74 protected:
Chris@197 75 void updatePropertyEditor(PropertyContainer::PropertyName,
Chris@197 76 bool rangeChanged = false);
Chris@218 77 void updateContextHelp(QObject *o);
Chris@285 78 void addNewColour();
Chris@0 79
Chris@107 80 QLabel *m_nameWidget;
Chris@33 81 QWidget *m_mainWidget;
Chris@0 82 QGridLayout *m_layout;
Chris@0 83 PropertyContainer *m_container;
Chris@34 84 QFrame *m_viewPlayFrame;
Chris@34 85 QVBoxLayout *m_mainBox;
Chris@185 86 LEDButton *m_showButton;
Chris@189 87 LEDButton *m_playButton;
Chris@0 88 std::map<QString, QLayout *> m_groupLayouts;
Chris@0 89 std::map<QString, QWidget *> m_propertyControllers;
Chris@0 90 };
Chris@0 91
Chris@0 92 #endif