annotate widgets/UnitConverter.h @ 1496:d09345e578a7

Separate out handling of alignment progress bar from the layer progress bars and fix tendency to have them hanging around even when alignment has completed
author Chris Cannam
date Wed, 14 Aug 2019 10:58:24 +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