Mercurial > hg > svgui
comparison layer/TimeValueLayer.h @ 0:2a4f26e85b4c
initial import
author | Chris Cannam |
---|---|
date | Tue, 10 Jan 2006 16:33:16 +0000 |
parents | |
children | 7af44e8578c8 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:2a4f26e85b4c |
---|---|
1 /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */ | |
2 | |
3 /* | |
4 A waveform viewer and audio annotation editor. | |
5 Chris Cannam, Queen Mary University of London, 2005 | |
6 | |
7 This is experimental software. Not for distribution. | |
8 */ | |
9 | |
10 #ifndef _TIME_VALUE_VIEW_H_ | |
11 #define _TIME_VALUE_VIEW_H_ | |
12 | |
13 #include "base/Layer.h" | |
14 #include "model/SparseTimeValueModel.h" | |
15 | |
16 #include <QObject> | |
17 #include <QColor> | |
18 | |
19 class View; | |
20 class QPainter; | |
21 | |
22 class TimeValueLayer : public Layer | |
23 { | |
24 Q_OBJECT | |
25 | |
26 public: | |
27 TimeValueLayer(View *w); | |
28 | |
29 virtual void paint(QPainter &paint, QRect rect) const; | |
30 | |
31 virtual QRect getFeatureDescriptionRect(QPainter &, QPoint) const; | |
32 virtual void paintLocalFeatureDescription(QPainter &, QRect, QPoint) const; | |
33 | |
34 virtual const Model *getModel() const { return m_model; } | |
35 void setModel(SparseTimeValueModel *model); | |
36 | |
37 virtual PropertyList getProperties() const; | |
38 virtual PropertyType getPropertyType(const PropertyName &) const; | |
39 virtual int getPropertyRangeAndValue(const PropertyName &, | |
40 int *min, int *max) const; | |
41 virtual QString getPropertyValueLabel(const PropertyName &, | |
42 int value) const; | |
43 virtual void setProperty(const PropertyName &, int value); | |
44 | |
45 void setBaseColour(QColor); | |
46 QColor getBaseColour() const { return m_colour; } | |
47 | |
48 enum PlotStyle { PlotPoints, PlotStems, PlotLines }; | |
49 | |
50 void setPlotStyle(PlotStyle style); | |
51 PlotStyle getPlotStyle() const { return m_plotStyle; } | |
52 | |
53 virtual QString getPropertyContainerIconName() const { return "values"; } | |
54 | |
55 virtual bool isLayerScrollable() const; | |
56 | |
57 virtual int getCompletion() const { return m_model->getCompletion(); } | |
58 | |
59 protected: | |
60 SparseTimeValueModel::PointList getLocalPoints(int) const; | |
61 | |
62 SparseTimeValueModel *m_model; | |
63 QColor m_colour; | |
64 PlotStyle m_plotStyle; | |
65 }; | |
66 | |
67 #endif | |
68 |