annotate widgets/RangeInputDialog.h @ 1127:9fb8dfd7ce4c 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 dd573e090eed
children 05d614f6e46d
rev   line source
Chris@188 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@188 2
Chris@188 3 /*
Chris@188 4 Sonic Visualiser
Chris@188 5 An audio file viewer and annotation editor.
Chris@188 6 Centre for Digital Music, Queen Mary, University of London.
Chris@188 7 This file copyright 2007 QMUL.
Chris@188 8
Chris@188 9 This program is free software; you can redistribute it and/or
Chris@188 10 modify it under the terms of the GNU General Public License as
Chris@188 11 published by the Free Software Foundation; either version 2 of the
Chris@188 12 License, or (at your option) any later version. See the file
Chris@188 13 COPYING included with this distribution for more information.
Chris@188 14 */
Chris@188 15
Chris@188 16 #ifndef _RANGE_INPUT_DIALOG_H_
Chris@188 17 #define _RANGE_INPUT_DIALOG_H_
Chris@188 18
Chris@188 19 #include <QDialog>
Chris@188 20 #include <QString>
Chris@188 21
Chris@188 22 class QDoubleSpinBox;
Chris@188 23
Chris@188 24 class RangeInputDialog : public QDialog
Chris@188 25 {
Chris@188 26 Q_OBJECT
Chris@188 27
Chris@188 28 public:
Chris@188 29 RangeInputDialog(QString title, QString message, QString unit,
Chris@188 30 float min, float max, QWidget *parent = 0);
Chris@188 31 virtual ~RangeInputDialog();
Chris@188 32
Chris@188 33 void getRange(float &start, float &end);
Chris@188 34
Chris@188 35 signals:
Chris@188 36 void rangeChanged(float start, float end);
Chris@188 37
Chris@188 38 public slots:
Chris@188 39 void setRange(float start, float end);
Chris@188 40
Chris@188 41 protected slots:
Chris@188 42 void rangeStartChanged(double);
Chris@188 43 void rangeEndChanged(double);
Chris@188 44
Chris@188 45 protected:
Chris@188 46 QDoubleSpinBox *m_rangeStart;
Chris@188 47 QDoubleSpinBox *m_rangeEnd;
Chris@188 48 };
Chris@188 49
Chris@188 50 #endif