annotate widgets/UnitConverter.h @ 891:09b2940f483a

Update units when prefs change
author Chris Cannam
date Tue, 09 Dec 2014 12:17:04 +0000
parents cd59f6e1aa26
children af63372e9002
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@889 36 void freqChanged(double);
Chris@885 37 void midiChanged(int);
Chris@885 38 void noteChanged(int);
Chris@885 39 void octaveChanged(int);
Chris@885 40 void centsChanged(double);
Chris@885 41 void pianoChanged(int);
Chris@889 42
Chris@891 43 void preferenceChanged(PropertyContainer::PropertyName);
Chris@885 44
Chris@885 45 private:
Chris@889 46 QDoubleSpinBox *m_freq;
Chris@885 47 QSpinBox *m_midi;
Chris@885 48 QComboBox *m_note;
Chris@885 49 QSpinBox *m_octave;
Chris@885 50 QDoubleSpinBox *m_cents;
Chris@885 51 QSpinBox *m_piano;
Chris@891 52 QLabel *m_pitchPrefsLabel;
Chris@891 53 void updatePitchesFromFreq();
Chris@891 54 void updatePitchPrefsLabel();
Chris@885 55
Chris@891 56 QDoubleSpinBox *m_samples;
Chris@891 57
Chris@891 58 void updateTempiFromSamples();
Chris@885 59 };
Chris@885 60
Chris@885 61 #endif