annotate data/model/TabularModel.h @ 1196:c7b9c902642f
spectrogram-minor-refactor
Fix threshold in spectrogram -- it wasn't working in the last release.
There is a new protocol for this. Formerly the threshold parameter had a
range from -50dB to 0 with the default at -50, and -50 treated internally
as "no threshold". However, there was a hardcoded, hidden internal threshold
for spectrogram colour mapping at -80dB with anything below this being rounded
to zero. Now the threshold parameter has range -81 to -1 with the default
at -80, -81 is treated internally as "no threshold", and there is no hidden
internal threshold. So the default behaviour is the same as before, an
effective -80dB threshold, but it is now possible to change this in both
directions. Sessions reloaded from prior versions may look slightly different
because, if the session says there should be no threshold, there will now
actually be no threshold instead of having the hidden internal one.
Still need to do something in the UI to make it apparent that the -81dB
setting removes the threshold entirely. This is at least no worse than the
previous, also obscured, magic -50dB setting.
author |
Chris Cannam |
date |
Mon, 01 Aug 2016 16:21:01 +0100 |
parents |
0559f25b99f2 |
children |
ad5f892c0c4d |
rev |
line source |
Chris@420
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@420
|
2
|
Chris@420
|
3 /*
|
Chris@420
|
4 Sonic Visualiser
|
Chris@420
|
5 An audio file viewer and annotation editor.
|
Chris@420
|
6 Centre for Digital Music, Queen Mary, University of London.
|
Chris@420
|
7 This file copyright 2008 QMUL.
|
Chris@420
|
8
|
Chris@420
|
9 This program is free software; you can redistribute it and/or
|
Chris@420
|
10 modify it under the terms of the GNU General Public License as
|
Chris@420
|
11 published by the Free Software Foundation; either version 2 of the
|
Chris@420
|
12 License, or (at your option) any later version. See the file
|
Chris@420
|
13 COPYING included with this distribution for more information.
|
Chris@420
|
14 */
|
Chris@420
|
15
|
Chris@420
|
16 #ifndef _TABULAR_MODEL_H_
|
Chris@420
|
17 #define _TABULAR_MODEL_H_
|
Chris@420
|
18
|
Chris@420
|
19 #include <QVariant>
|
Chris@420
|
20 #include <QString>
|
Chris@420
|
21
|
Chris@420
|
22 class Command;
|
Chris@420
|
23
|
Chris@420
|
24 /**
|
Chris@420
|
25 * TabularModel is an abstract base class for models that support
|
Chris@420
|
26 * direct access to data in a tabular form. A model that implements
|
Chris@420
|
27 * TabularModel may be displayed and, perhaps, edited in a data
|
Chris@420
|
28 * spreadsheet window.
|
Chris@420
|
29 *
|
Chris@420
|
30 * This is very like a cut-down QAbstractItemModel. It assumes a
|
Chris@420
|
31 * relationship between row number and frame time.
|
Chris@420
|
32 */
|
Chris@420
|
33
|
Chris@420
|
34 class TabularModel
|
Chris@420
|
35 {
|
Chris@420
|
36 public:
|
Chris@462
|
37 virtual ~TabularModel() { }
|
Chris@462
|
38
|
Chris@420
|
39 virtual int getRowCount() const = 0;
|
Chris@420
|
40 virtual int getColumnCount() const = 0;
|
Chris@420
|
41
|
Chris@420
|
42 virtual QString getHeading(int column) const = 0;
|
Chris@422
|
43
|
Chris@422
|
44 enum { SortRole = Qt::UserRole };
|
Chris@422
|
45 enum SortType { SortNumeric, SortAlphabetical };
|
Chris@422
|
46
|
Chris@420
|
47 virtual QVariant getData(int row, int column, int role) const = 0;
|
Chris@422
|
48 virtual bool isColumnTimeValue(int col) const = 0;
|
Chris@422
|
49 virtual SortType getSortType(int col) const = 0;
|
Chris@420
|
50
|
Chris@1055
|
51 virtual sv_frame_t getFrameForRow(int row) const = 0;
|
Chris@1055
|
52 virtual int getRowForFrame(sv_frame_t frame) const = 0;
|
Chris@420
|
53
|
Chris@420
|
54 virtual bool isEditable() const { return false; }
|
Chris@425
|
55 virtual Command *getSetDataCommand(int /* row */, int /* column */, const QVariant &, int /* role */) { return 0; }
|
Chris@427
|
56 virtual Command *getInsertRowCommand(int /* beforeRow */) { return 0; }
|
Chris@427
|
57 virtual Command *getRemoveRowCommand(int /* row */) { return 0; }
|
Chris@420
|
58 };
|
Chris@420
|
59
|
Chris@420
|
60 #endif
|