annotate layer/TimeRulerLayer.h @ 101:0f36cdf407a6 sv1-v0.9rc1

* Make vertical scale alignment modes work in note layer as well as time-value layer, and several significant fixes to it * Make it possible to draw notes properly on the note layer * Show units (and frequencies etc in note layer's case) in the time-value and note layer description boxes * Minor fix to item edit dialog layout * Some minor menu rearrangement * Comment out a lot of debug output * Add SV website and reference URLs to Help menu, and add code to (attempt to) open them in the user's preferred browser
author Chris Cannam
date Fri, 12 May 2006 14:40:43 +0000
parents 4b98bda7e94d
children 999ae0f7d10c
rev   line source
Chris@58 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@0 2
Chris@0 3 /*
Chris@59 4 Sonic Visualiser
Chris@59 5 An audio file viewer and annotation editor.
Chris@59 6 Centre for Digital Music, Queen Mary, University of London.
Chris@59 7 This file copyright 2006 Chris Cannam.
Chris@0 8
Chris@59 9 This program is free software; you can redistribute it and/or
Chris@59 10 modify it under the terms of the GNU General Public License as
Chris@59 11 published by the Free Software Foundation; either version 2 of the
Chris@59 12 License, or (at your option) any later version. See the file
Chris@59 13 COPYING included with this distribution for more information.
Chris@0 14 */
Chris@0 15
Chris@0 16 #ifndef _TIME_RULER_H_
Chris@0 17 #define _TIME_RULER_H_
Chris@0 18
Chris@0 19 #include "base/Layer.h"
Chris@0 20
Chris@0 21 #include <QRect>
Chris@0 22 #include <QColor>
Chris@0 23
Chris@0 24 class View;
Chris@0 25 class Model;
Chris@0 26 class QPainter;
Chris@0 27
Chris@0 28 class TimeRulerLayer : public Layer
Chris@0 29 {
Chris@0 30 Q_OBJECT
Chris@0 31
Chris@0 32 public:
Chris@44 33 TimeRulerLayer();
Chris@0 34
Chris@44 35 virtual void paint(View *v, QPainter &paint, QRect rect) const;
Chris@0 36
Chris@0 37 void setModel(Model *);
Chris@0 38 virtual const Model *getModel() const { return m_model; }
Chris@0 39
Chris@0 40 void setBaseColour(QColor);
Chris@0 41 QColor getBaseColour() const { return m_colour; }
Chris@0 42
Chris@0 43 enum LabelHeight { LabelTop, LabelMiddle, LabelBottom };
Chris@0 44 void setLabelHeight(LabelHeight h) { m_labelHeight = h; }
Chris@0 45 LabelHeight getLabelHeight() const { return m_labelHeight; }
Chris@0 46
Chris@0 47 virtual PropertyList getProperties() const;
Chris@87 48 virtual QString getPropertyLabel(const PropertyName &) const;
Chris@0 49 virtual PropertyType getPropertyType(const PropertyName &) const;
Chris@0 50 virtual int getPropertyRangeAndValue(const PropertyName &,
Chris@0 51 int *min, int *max) const;
Chris@0 52 virtual QString getPropertyValueLabel(const PropertyName &,
Chris@0 53 int value) const;
Chris@0 54 virtual void setProperty(const PropertyName &, int value);
Chris@0 55
Chris@101 56 virtual bool getValueExtents(float &min, float &max,
Chris@101 57 bool &log, QString &unit) const {
Chris@79 58 return false;
Chris@79 59 }
Chris@79 60
Chris@6 61 virtual QString toXmlString(QString indent = "",
Chris@6 62 QString extraAttributes = "") const;
Chris@6 63
Chris@11 64 void setProperties(const QXmlAttributes &attributes);
Chris@11 65
Chris@0 66 protected:
Chris@0 67 Model *m_model;
Chris@0 68 QColor m_colour;
Chris@0 69 LabelHeight m_labelHeight;
Chris@0 70 };
Chris@0 71
Chris@0 72 #endif