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
centralplotframe.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 CENTRALPLOTFRAME_H
21 #define CENTRALPLOTFRAME_H
22 
23 #include "qwt_plot.h"
24 #include "qwt_plot_zoomer.h"
25 #include <QTouchEvent>
26 #include <QTime>
27 
28 class CentralPlotFrame : public QwtPlot
29 {
30  Q_OBJECT
31 public:
33 
34  CentralPlotFrame(int numberOfKeys, int keyOffset);
35 
36  double currentTickDistanceInPixel() const;
37 protected:
38  void applyTouchTransform(int final);
39 
40  virtual bool event(QEvent *) override;
41  virtual bool touchEvent(QTouchEvent *e);
42  virtual void updateLayout() override;
43  virtual void showEvent(QShowEvent *e) override;
44  virtual void resizeEvent(QResizeEvent *e) override;
45  virtual void paintEvent(QPaintEvent *e) override;
46 
47 signals:
48  void keyWidthChanged(double width);
49  void moveCanvas(int dx, int dy);
50 
51 public slots:
52  void resetView();
53  void zoomGoNext();
54  void zoomGoPrevious();
55  void zoomGoLast();
56  void zoomGoFirst();
57 
58 
59 private:
60  const int mNumberOfKeys;
61  const int mKeyOffset;
62  QwtPlotZoomer *mPlotZoomer;
63  QwtPlotZoomer *mNonStackInvisibleZoomer;
64 
65  QTime mPlotTimer;
66 
67 
68  QList<QTouchEvent::TouchPoint> mTouchPoints;
69 };
70 
71 #endif // CENTRALPLOTFRAME_H
virtual bool touchEvent(QTouchEvent *e)
QwtPlotZoomer * mPlotZoomer
virtual void resizeEvent(QResizeEvent *e) override
CentralPlotFrame(int numberOfKeys, int keyOffset)
const int mNumberOfKeys
void keyWidthChanged(double width)
void moveCanvas(int dx, int dy)
static const int FLYING_UPDATE_INTERVALL_IN_MS
virtual void paintEvent(QPaintEvent *e) override
virtual void updateLayout() override
virtual void showEvent(QShowEvent *e) override
QwtPlotZoomer * mNonStackInvisibleZoomer
void applyTouchTransform(int final)
virtual bool event(QEvent *) override
double currentTickDistanceInPixel() const
QList< QTouchEvent::TouchPoint > mTouchPoints