Entropy Piano Tuner  1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
plotsdialog.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright 2015 Haye Hinrichsen, Christoph Wick
3  *
4  * This file is part of Entropy Piano Tuner.
5  *
6  * Entropy Piano Tuner is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * Entropy Piano Tuner is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * Entropy Piano Tuner. If not, see http://www.gnu.org/licenses/.
18  *****************************************************************************/
19 
20 #ifndef PLOTSDIALOG_H
21 #define PLOTSDIALOG_H
22 
23 #include <QDialog>
24 #include <QToolButton>
25 #include <array>
26 #include "centralplotframe.h"
27 #include "core/piano/piano.h"
28 
29 class QwtPlotCurve;
30 class QwtPlotZoomer;
31 class PlotToolButton;
32 
33 class PlotsDialog : public QDialog
34 {
35  Q_OBJECT
36 public:
37  enum Curves {
42 
44  };
45 
46  PlotsDialog(const Piano &piano, QWidget *parent);
47  virtual ~PlotsDialog();
48 
49 private:
50  int getKeyOffset();
51  void prepareCurve(Curves curve);
52 
53 private slots:
54 
55  void updateTickWidth(double d);
56  void plotToolButtonToggled(bool);
57 
58 private:
60  std::array<QwtPlotCurve *, CURVE_COUNT> mCurves;
61  std::array<PlotToolButton *, CURVE_COUNT> mPlotToolButtons;
62 
63  const Piano &mPiano;
65 };
66 
67 class PlotToolButton : public QToolButton {
68  Q_OBJECT
69 public:
71  mCurve(curve) {
72  }
73  const PlotsDialog::Curves &getCurve() const {return mCurve;}
74 private:
76 };
77 #endif // PLOTSDIALOG_H
CentralPlotFrame * mPlot
Definition: plotsdialog.h:59
const Keyboard & mKeyboard
Definition: plotsdialog.h:64
Class describing the piano keyboard, holding a collection of keys.
Definition: keyboard.h:39
const Piano & mPiano
Definition: plotsdialog.h:63
PlotsDialog(const Piano &piano, QWidget *parent)
Definition: plotsdialog.cpp:45
Definition: piano.h:40
std::array< QwtPlotCurve *, CURVE_COUNT > mCurves
Definition: plotsdialog.h:60
const PlotsDialog::Curves & getCurve() const
Definition: plotsdialog.h:73
virtual ~PlotsDialog()
PlotToolButton(PlotsDialog::Curves curve)
Definition: plotsdialog.h:70
void prepareCurve(Curves curve)
void updateTickWidth(double d)
int getKeyOffset()
const PlotsDialog::Curves mCurve
Definition: plotsdialog.h:75
void plotToolButtonToggled(bool)
std::array< PlotToolButton *, CURVE_COUNT > mPlotToolButtons
Definition: plotsdialog.h:61