annotate layer/PaintAssistant.h @ 220:8dc50f57d480

* Make the vertical scale a bit less thtoopid for many linear scale spectra * Don't forget to reload slice layer properties when loading a session, as well as spectrum layer (i.e. subclass) properties
author Chris Cannam
date Mon, 05 Mar 2007 13:04:52 +0000
parents 4a3bdde1ef13
children b66fb15de477
rev   line source
Chris@195 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@195 2
Chris@195 3 /*
Chris@195 4 Sonic Visualiser
Chris@195 5 An audio file viewer and annotation editor.
Chris@195 6 Centre for Digital Music, Queen Mary, University of London.
Chris@195 7 This file copyright 2006-2007 Chris Cannam and QMUL.
Chris@195 8
Chris@195 9 This program is free software; you can redistribute it and/or
Chris@195 10 modify it under the terms of the GNU General Public License as
Chris@195 11 published by the Free Software Foundation; either version 2 of the
Chris@195 12 License, or (at your option) any later version. See the file
Chris@195 13 COPYING included with this distribution for more information.
Chris@195 14 */
Chris@195 15
Chris@195 16 #ifndef _PAINT_ASSISTANT_H_
Chris@195 17 #define _PAINT_ASSISTANT_H_
Chris@195 18
Chris@195 19 #include <QRect>
Chris@195 20 #include <vector>
Chris@195 21
Chris@195 22 class QPainter;
Chris@195 23
Chris@195 24 class PaintAssistant
Chris@195 25 {
Chris@195 26 public:
Chris@195 27 enum Scale { LinearScale, MeterScale, dBScale };
Chris@195 28
Chris@195 29 static void paintVerticalLevelScale(QPainter &p, QRect rect,
Chris@195 30 float minVal, float maxVal,
Chris@220 31 Scale scale, int &multRtn,
Chris@195 32 std::vector<int> *markCoordRtns = 0);
Chris@195 33
Chris@195 34 static int getYForValue(Scale scale, float value,
Chris@195 35 float minVal, float maxVal,
Chris@195 36 int minY, int height);
Chris@195 37 };
Chris@195 38
Chris@195 39 #endif