comparison layer/TimeInstantLayer.h @ 0:2a4f26e85b4c

initial import
author Chris Cannam
date Tue, 10 Jan 2006 16:33:16 +0000
parents
children 37b110168acf
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_INSTANT_VIEW_H_
11 #define _TIME_INSTANT_VIEW_H_
12
13 #include "base/Layer.h"
14 #include "model/SparseOneDimensionalModel.h"
15
16 #include <QObject>
17 #include <QColor>
18
19 class View;
20 class QPainter;
21
22 class TimeInstantLayer : public Layer
23 {
24 Q_OBJECT
25
26 public:
27 TimeInstantLayer(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(SparseOneDimensionalModel *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 virtual QString getPropertyContainerIconName() const { return "instants"; }
49
50 virtual bool isLayerScrollable() const;
51
52 virtual int getCompletion() const { return m_model->getCompletion(); }
53
54 protected:
55 SparseOneDimensionalModel::PointList getLocalPoints(int) const;
56
57 SparseOneDimensionalModel *m_model;
58 QColor m_colour;
59 };
60
61 #endif
62