annotate widgets/ListInputDialog.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 d632a1e87018
children 05d614f6e46d
rev   line source
Chris@126 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@126 2
Chris@126 3 /*
Chris@126 4 Sonic Visualiser
Chris@126 5 An audio file viewer and annotation editor.
Chris@126 6 Centre for Digital Music, Queen Mary, University of London.
Chris@229 7 This file copyright 2006 Chris Cannam.
Chris@126 8
Chris@126 9 This program is free software; you can redistribute it and/or
Chris@126 10 modify it under the terms of the GNU General Public License as
Chris@126 11 published by the Free Software Foundation; either version 2 of the
Chris@126 12 License, or (at your option) any later version. See the file
Chris@126 13 COPYING included with this distribution for more information.
Chris@126 14 */
Chris@126 15
Chris@126 16 #ifndef _LIST_INPUT_DIALOG_H_
Chris@126 17 #define _LIST_INPUT_DIALOG_H_
Chris@126 18
Chris@126 19 #include <QDialog>
Chris@126 20 #include <QString>
Chris@126 21 #include <QStringList>
Chris@126 22
Chris@126 23 #include <vector>
Chris@126 24
Chris@126 25 class QRadioButton;
Chris@231 26 class QLabel;
Chris@126 27
Chris@126 28 /**
Chris@126 29 * Like QInputDialog::getItem(), except that it offers the items as a
Chris@126 30 * set of radio buttons instead of in a single combo box.
Chris@126 31 */
Chris@126 32
Chris@126 33 class ListInputDialog : public QDialog
Chris@126 34 {
Chris@222 35 Q_OBJECT
Chris@222 36
Chris@126 37 public:
Chris@231 38 ListInputDialog(QWidget *parent, const QString &title,
Chris@231 39 const QString &label, const QStringList &list,
Chris@616 40 int current = 0);
Chris@126 41 virtual ~ListInputDialog();
Chris@126 42
Chris@231 43 void setItemAvailability(int item, bool available);
Chris@231 44 void setFootnote(QString footnote);
Chris@231 45
Chris@231 46 QString getCurrentString() const;
Chris@231 47
Chris@126 48 static QString getItem(QWidget *parent, const QString &title,
Chris@126 49 const QString &label, const QStringList &list,
Chris@616 50 int current = 0, bool *ok = 0);
Chris@126 51
Chris@126 52 protected:
Chris@126 53 QStringList m_strings;
Chris@126 54 std::vector<QRadioButton *> m_radioButtons;
Chris@231 55 QLabel *m_footnote;
Chris@126 56 };
Chris@126 57
Chris@126 58 #endif