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@889
|
41
|
Chris@892
|
42 void samplesChanged(double);
|
Chris@892
|
43 void periodChanged(double);
|
Chris@892
|
44 void bpmChanged(double);
|
Chris@892
|
45 void tempofreqChanged(double);
|
Chris@892
|
46 void samplerateChanged(QString);
|
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@885
|
68 };
|
Chris@885
|
69
|
Chris@885
|
70 #endif
|