comparison layer/SpectrumLayer.h @ 133:9e6b3e239b9d

* Add zoom thumbwheels to Pane. Implement horizontal thumbwheel, and vertical depending on layer type (supported for waveform and spectrogram, though wrong for log-scale spectrogram at the moment). * Add bare bones of a spectrum layer. * Add window icon * Add shortcut for "insert time instant" on laptops without keypad enter (";") * Delete FFT processing thread when it exits (at least, next time we're asked for something interesting) * Get audio file extensions from the file readers, and thus from libsndfile for the wave file reader -- leads to rather a wide combo box in file dialog though * Better refresh order for spectrogram (redraw centre section first)
author Chris Cannam
date Fri, 04 Aug 2006 17:01:37 +0000
parents
children aaa3a53dbb10
comparison
equal deleted inserted replaced
132:5d3a483856ff 133:9e6b3e239b9d
1
2 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
3
4 /*
5 Sonic Visualiser
6 An audio file viewer and annotation editor.
7 Centre for Digital Music, Queen Mary, University of London.
8 This file copyright 2006 Chris Cannam.
9
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2 of the
13 License, or (at your option) any later version. See the file
14 COPYING included with this distribution for more information.
15 */
16
17 #ifndef _SPECTRUM_LAYER_H_
18 #define _SPECTRUM_LAYER_H_
19
20 #include "Layer.h"
21
22 #include "data/model/DenseTimeValueModel.h"
23
24 #include <QColor>
25
26 class FFTModel;
27
28 class SpectrumLayer : public Layer
29 {
30 Q_OBJECT
31
32 public:
33 SpectrumLayer();
34 ~SpectrumLayer();
35
36 void setModel(DenseTimeValueModel *model);
37 virtual const Model *getModel() const { return m_model; }
38 virtual void paint(View *v, QPainter &paint, QRect rect) const;
39
40 virtual void setProperties(const QXmlAttributes &);
41
42 virtual bool getValueExtents(float &min, float &max,
43 bool &logarithmic, QString &unit) const;
44
45 virtual bool isLayerScrollable(const View *v) const { return false; }
46
47 virtual QString getPropertyLabel(const PropertyName &) const { return ""; }
48
49 protected:
50 DenseTimeValueModel *m_model;
51 FFTModel *m_fft;
52 QColor m_colour;
53 };
54
55 #endif