annotate layer/TimeRulerLayer.h @ 282:d9319859a4cf tip

(none)
author benoitrigolleau
date Fri, 31 Oct 2008 11:00:24 +0000
parents 0387f53242b2
children
rev   line source
lbajardsilogic@0 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
lbajardsilogic@0 2
lbajardsilogic@0 3 /*
lbajardsilogic@0 4 Sonic Visualiser
lbajardsilogic@0 5 An audio file viewer and annotation editor.
lbajardsilogic@0 6 Centre for Digital Music, Queen Mary, University of London.
lbajardsilogic@0 7 This file copyright 2006 Chris Cannam.
lbajardsilogic@0 8
lbajardsilogic@0 9 This program is free software; you can redistribute it and/or
lbajardsilogic@0 10 modify it under the terms of the GNU General Public License as
lbajardsilogic@0 11 published by the Free Software Foundation; either version 2 of the
lbajardsilogic@0 12 License, or (at your option) any later version. See the file
lbajardsilogic@0 13 COPYING included with this distribution for more information.
lbajardsilogic@0 14 */
lbajardsilogic@0 15
lbajardsilogic@0 16 #ifndef _TIME_RULER_H_
lbajardsilogic@0 17 #define _TIME_RULER_H_
lbajardsilogic@0 18
lbajardsilogic@0 19 #include "Layer.h"
lbajardsilogic@0 20
lbajardsilogic@0 21 #include <QRect>
lbajardsilogic@0 22 #include <QColor>
lbajardsilogic@0 23
lbajardsilogic@0 24 class View;
lbajardsilogic@0 25 class Model;
lbajardsilogic@0 26 class QPainter;
lbajardsilogic@0 27
lbajardsilogic@0 28 class TimeRulerLayer : public Layer
lbajardsilogic@0 29 {
lbajardsilogic@0 30 Q_OBJECT
lbajardsilogic@0 31
lbajardsilogic@0 32 public:
lbajardsilogic@0 33 TimeRulerLayer();
lbajardsilogic@0 34
lbajardsilogic@0 35 virtual void paint(View *v, QPainter &paint, QRect rect) const;
lbajardsilogic@0 36
lbajardsilogic@0 37 void setModel(Model *);
lbajardsilogic@0 38 virtual const Model *getModel() const { return m_model; }
lbajardsilogic@0 39
benoitrigolleau@61 40 virtual void setBaseColour(QColor);
benoitrigolleau@61 41 virtual QColor getBaseColour() const { return m_colour; }
lbajardsilogic@0 42
lbajardsilogic@0 43 enum LabelHeight { LabelTop, LabelMiddle, LabelBottom };
lbajardsilogic@0 44 void setLabelHeight(LabelHeight h) { m_labelHeight = h; }
lbajardsilogic@0 45 LabelHeight getLabelHeight() const { return m_labelHeight; }
lbajardsilogic@0 46
lbajardsilogic@0 47 virtual PropertyList getProperties() const;
lbajardsilogic@0 48 virtual QString getPropertyLabel(const PropertyName &) const;
lbajardsilogic@0 49 virtual PropertyType getPropertyType(const PropertyName &) const;
lbajardsilogic@0 50 virtual int getPropertyRangeAndValue(const PropertyName &,
lbajardsilogic@0 51 int *min, int *max, int *deflt) const;
lbajardsilogic@0 52 virtual QString getPropertyValueLabel(const PropertyName &,
lbajardsilogic@0 53 int value) const;
lbajardsilogic@0 54 virtual void setProperty(const PropertyName &, int value);
lbajardsilogic@0 55
lbajardsilogic@0 56 virtual bool getValueExtents(float &, float &, bool &, QString &) const {
lbajardsilogic@0 57 return false;
lbajardsilogic@0 58 }
lbajardsilogic@0 59
lbajardsilogic@0 60 virtual QString toXmlString(QString indent = "",
lbajardsilogic@0 61 QString extraAttributes = "") const;
lbajardsilogic@0 62
lbajardsilogic@18 63 virtual QString toEasaierXmlString(QString indent = "",
lbajardsilogic@18 64 QString extraAttributes = "") const;
lbajardsilogic@18 65
lbajardsilogic@0 66 void setProperties(const QXmlAttributes &attributes);
lbajardsilogic@0 67
lbajardsilogic@0 68 protected:
lbajardsilogic@0 69 Model *m_model;
lbajardsilogic@0 70 QColor m_colour;
lbajardsilogic@0 71 LabelHeight m_labelHeight;
lbajardsilogic@0 72 };
lbajardsilogic@0 73
lbajardsilogic@0 74 #endif