annotate widgets/ImageDialog.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 e9fe3923bdf4
children a18e78b9c78b
rev   line source
Chris@303 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@303 2
Chris@303 3 /*
Chris@303 4 Sonic Visualiser
Chris@303 5 An audio file viewer and annotation editor.
Chris@303 6 Centre for Digital Music, Queen Mary, University of London.
Chris@303 7 This file copyright 2007 QMUL.
Chris@303 8
Chris@303 9 This program is free software; you can redistribute it and/or
Chris@303 10 modify it under the terms of the GNU General Public License as
Chris@303 11 published by the Free Software Foundation; either version 2 of the
Chris@303 12 License, or (at your option) any later version. See the file
Chris@303 13 COPYING included with this distribution for more information.
Chris@303 14 */
Chris@303 15
Chris@303 16 #ifndef _IMAGE_DIALOG_H_
Chris@303 17 #define _IMAGE_DIALOG_H_
Chris@303 18
Chris@303 19 #include <QDialog>
Chris@303 20 #include <QString>
Chris@303 21
Chris@303 22 class QLineEdit;
Chris@303 23 class QLabel;
Chris@303 24 class QPushButton;
Chris@318 25 class FileSource;
Chris@303 26
Chris@303 27 class ImageDialog : public QDialog
Chris@303 28 {
Chris@303 29 Q_OBJECT
Chris@303 30
Chris@303 31 public:
Chris@303 32 ImageDialog(QString title,
Chris@303 33 QString image = "",
Chris@303 34 QString label = "",
Chris@303 35 QWidget *parent = 0);
Chris@303 36 virtual ~ImageDialog();
Chris@303 37
Chris@303 38 QString getImage();
Chris@303 39 QPixmap getPixmap();
Chris@303 40 QString getLabel();
Chris@303 41
Chris@303 42 signals:
Chris@303 43 void imageChanged(QString image);
Chris@303 44 void labelChanged(QString label);
Chris@303 45
Chris@303 46 public slots:
Chris@303 47 void setImage(QString image);
Chris@303 48 void setLabel(QString label);
Chris@303 49 void updatePreview();
Chris@303 50
Chris@303 51 protected slots:
Chris@303 52 void browseClicked();
Chris@304 53 void imageEditEdited(const QString &);
Chris@305 54 void imageEditEdited();
Chris@303 55
Chris@303 56 protected:
Chris@303 57 void resizeEvent(QResizeEvent *);
Chris@303 58
Chris@303 59 QLineEdit *m_imageEdit;
Chris@303 60 QLineEdit *m_labelEdit;
Chris@303 61 QLabel *m_imagePreview;
Chris@303 62
Chris@303 63 QString m_loadedImageFile;
Chris@303 64 QPixmap m_loadedImage;
Chris@303 65
Chris@303 66 QPushButton *m_okButton;
Chris@305 67
Chris@318 68 FileSource *m_remoteFile;
Chris@303 69 };
Chris@303 70
Chris@303 71 #endif