PropertyBox.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 SV_PROPERTY_BOX_H
17 #define SV_PROPERTY_BOX_H
18 
19 #include "base/PropertyContainer.h"
20 
21 #include <QFrame>
22 #include <map>
23 
24 class QLayout;
25 class QWidget;
26 class QGridLayout;
27 class QVBoxLayout;
28 class QLabel;
29 class LEDButton;
30 class QToolButton;
32 class QMenu;
33 
34 class PropertyBox : public QFrame
35 {
36  Q_OBJECT
37 
38 public:
39  PropertyBox(PropertyContainer *);
40  ~PropertyBox();
41 
42  PropertyContainer *getContainer() { return m_container; }
43 
44 signals:
45  void showLayer(bool);
46  void contextHelpChanged(const QString &);
47 
48 public slots:
49  void propertyContainerPropertyChanged(PropertyContainer *);
50  void propertyContainerPropertyRangeChanged(PropertyContainer *);
51  void playClipChanged(QString);
52  void layerVisibilityChanged(bool);
53 
54 protected slots:
55  void propertyControllerChanged(int);
56  void propertyControllerChanged(bool);
58 
59  void playAudibleChanged(bool);
60  void playAudibleButtonChanged(bool);
61  void playGainControlChanged(float);
62  void playPanControlChanged(float);
63 
64  void populateViewPlayFrame();
65 
66  void unitDatabaseChanged();
67 
68  void editPlayParameters();
69 
70  void mouseEnteredWidget();
71  void mouseLeftWidget();
72 
73  void contextMenuRequested(const QPoint &);
74 
75 protected:
76  void updatePropertyEditor(PropertyContainer::PropertyName,
77  bool rangeChanged = false);
78  void updateContextHelp(QObject *o);
79 
80  QLabel *m_nameWidget;
81  QWidget *m_mainWidget;
82  QGridLayout *m_layout;
83  PropertyContainer *m_container;
84  QFrame *m_viewPlayFrame;
85  QVBoxLayout *m_mainBox;
87  QToolButton *m_playButton;
89  QObject *m_contextMenuOn;
90  std::map<QString, QGridLayout *> m_groupLayouts;
91  std::map<QString, QWidget *> m_propertyControllers;
92 };
93 
94 #endif
QGridLayout * m_layout
Definition: PropertyBox.h:82
void propertyContainerPropertyChanged(PropertyContainer *)
QFrame * m_viewPlayFrame
Definition: PropertyBox.h:84
Very trivial enhancement to QPushButton to make it emit signals when the mouse enters and leaves (for...
void playPanControlChanged(float)
void mouseEnteredWidget()
std::map< QString, QWidget * > m_propertyControllers
Definition: PropertyBox.h:91
void updateContextHelp(QObject *o)
void propertyControllerChanged(int)
QVBoxLayout * m_mainBox
Definition: PropertyBox.h:85
void playGainControlChanged(float)
void updatePropertyEditor(PropertyContainer::PropertyName, bool rangeChanged=false)
LEDButton * m_showButton
Definition: PropertyBox.h:86
QWidget * m_mainWidget
Definition: PropertyBox.h:81
void contextHelpChanged(const QString &)
QToolButton * m_playButton
Definition: PropertyBox.h:87
void playAudibleChanged(bool)
QLabel * m_nameWidget
Definition: PropertyBox.h:80
QMenu * m_lastContextMenu
Definition: PropertyBox.h:88
void layerVisibilityChanged(bool)
void showLayer(bool)
PropertyContainer * getContainer()
Definition: PropertyBox.h:42
void propertyContainerPropertyRangeChanged(PropertyContainer *)
void propertyControllerResetRequested()
std::map< QString, QGridLayout * > m_groupLayouts
Definition: PropertyBox.h:90
void contextMenuRequested(const QPoint &)
PropertyContainer * m_container
Definition: PropertyBox.h:83
void editPlayParameters()
void mouseLeftWidget()
PropertyBox(PropertyContainer *)
Definition: PropertyBox.cpp:60
void populateViewPlayFrame()
void playAudibleButtonChanged(bool)
void playClipChanged(QString)
void unitDatabaseChanged()
QObject * m_contextMenuOn
Definition: PropertyBox.h:89