Mercurial > hg > svgui
annotate widgets/UnitConverter.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 | 78ae34f388f6 |
children |
rev | line source |
---|---|
Chris@885 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
Chris@885 | 2 |
Chris@885 | 3 /* |
Chris@885 | 4 Sonic Visualiser |
Chris@885 | 5 An audio file viewer and annotation editor. |
Chris@885 | 6 Centre for Digital Music, Queen Mary, University of London. |
Chris@885 | 7 |
Chris@885 | 8 This program is free software; you can redistribute it and/or |
Chris@885 | 9 modify it under the terms of the GNU General Public License as |
Chris@885 | 10 published by the Free Software Foundation; either version 2 of the |
Chris@885 | 11 License, or (at your option) any later version. See the file |
Chris@885 | 12 COPYING included with this distribution for more information. |
Chris@885 | 13 */ |
Chris@885 | 14 |
Chris@885 | 15 #ifndef UNIT_CONVERTER_H |
Chris@885 | 16 #define UNIT_CONVERTER_H |
Chris@885 | 17 |
Chris@885 | 18 #include <QDialog> |
Chris@885 | 19 |
Chris@891 | 20 #include "base/PropertyContainer.h" |
Chris@891 | 21 |
Chris@885 | 22 class QSpinBox; |
Chris@885 | 23 class QDoubleSpinBox; |
Chris@885 | 24 class QComboBox; |
Chris@891 | 25 class QLabel; |
Chris@885 | 26 |
Chris@885 | 27 class UnitConverter : public QDialog |
Chris@885 | 28 { |
Chris@885 | 29 Q_OBJECT |
Chris@885 | 30 |
Chris@885 | 31 public: |
Chris@885 | 32 UnitConverter(QWidget *parent = 0); |
Chris@885 | 33 virtual ~UnitConverter(); |
Chris@885 | 34 |
Chris@885 | 35 private slots: |
Chris@893 | 36 void freqChanged(); |
Chris@893 | 37 void midiChanged(); |
Chris@893 | 38 void noteChanged(); |
Chris@893 | 39 void octaveChanged(); |
Chris@893 | 40 void centsChanged(); |
Chris@889 | 41 |
Chris@893 | 42 void samplesChanged(); |
Chris@893 | 43 void periodChanged(); |
Chris@893 | 44 void bpmChanged(); |
Chris@893 | 45 void tempofreqChanged(); |
Chris@893 | 46 void samplerateChanged(); |
Chris@892 | 47 |
Chris@891 | 48 void preferenceChanged(PropertyContainer::PropertyName); |
Chris@885 | 49 |
Chris@885 | 50 private: |
Chris@889 | 51 QDoubleSpinBox *m_freq; |
Chris@885 | 52 QSpinBox *m_midi; |
Chris@885 | 53 QComboBox *m_note; |
Chris@885 | 54 QSpinBox *m_octave; |
Chris@885 | 55 QDoubleSpinBox *m_cents; |
Chris@891 | 56 QLabel *m_pitchPrefsLabel; |
Chris@891 | 57 void updatePitchesFromFreq(); |
Chris@891 | 58 void updatePitchPrefsLabel(); |
Chris@885 | 59 |
Chris@891 | 60 QDoubleSpinBox *m_samples; |
Chris@892 | 61 QDoubleSpinBox *m_period; |
Chris@892 | 62 QDoubleSpinBox *m_bpm; |
Chris@892 | 63 QDoubleSpinBox *m_tempofreq; |
Chris@892 | 64 QComboBox *m_samplerate; |
Chris@891 | 65 void updateTempiFromSamples(); |
Chris@892 | 66 |
Chris@892 | 67 double getSampleRate(); |
Chris@893 | 68 |
Chris@893 | 69 void setTo(QSpinBox *, int); |
Chris@893 | 70 void setTo(QDoubleSpinBox *, double); |
Chris@885 | 71 }; |
Chris@885 | 72 |
Chris@885 | 73 #endif |