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