comparison layer/TimeRulerLayer.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_RULER_H_
11 #define _TIME_RULER_H_
12
13 #include "base/Layer.h"
14
15 #include <QRect>
16 #include <QColor>
17
18 class View;
19 class Model;
20 class QPainter;
21
22 class TimeRulerLayer : public Layer
23 {
24 Q_OBJECT
25
26 public:
27 TimeRulerLayer(View *w);
28
29 virtual void paint(QPainter &paint, QRect rect) const;
30
31 void setModel(Model *);
32 virtual const Model *getModel() const { return m_model; }
33
34 void setBaseColour(QColor);
35 QColor getBaseColour() const { return m_colour; }
36
37 enum LabelHeight { LabelTop, LabelMiddle, LabelBottom };
38 void setLabelHeight(LabelHeight h) { m_labelHeight = h; }
39 LabelHeight getLabelHeight() const { return m_labelHeight; }
40
41 virtual PropertyList getProperties() const;
42 virtual PropertyType getPropertyType(const PropertyName &) const;
43 virtual int getPropertyRangeAndValue(const PropertyName &,
44 int *min, int *max) const;
45 virtual QString getPropertyValueLabel(const PropertyName &,
46 int value) const;
47 virtual void setProperty(const PropertyName &, int value);
48
49 virtual QString getPropertyContainerIconName() const { return "timeruler"; }
50
51 protected:
52 Model *m_model;
53 QColor m_colour;
54 LabelHeight m_labelHeight;
55 };
56
57 #endif