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
tuningindicatorview.cpp
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 //=============================================================================
21 // Graphical Qt interface for the tuning indicator
22 //=============================================================================
23 
24 #include "tuningindicatorview.h"
25 
26 #include <QMouseEvent>
27 
28 #include "../core/system/log.h"
29 #include "../core/settings.h"
30 
31 //-----------------------------------------------------------------------------
32 // Constructor
33 //-----------------------------------------------------------------------------
34 
40 
42  : StroboscopicViewAdapterForQt (parent, this, QRect(0, 0, 200, 200)),
44 {
45  setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
46  setWhatsThis(tr("This is the tuning indicator. Touch this field to toggle between spectral and stroboscopic mode. In the spectral mode you should bring the peak to the center of the window for optimal tuning. When tuning several strings of unisons at once, several peaks might appear and all of them should be tuned to match the center. In the stroboscopic mode several stripes of drifiting rainbows are shown. The stripes represent the partials. Optimal tuning of single strings is obtained when the rainbows come to a halt."));
47 
48 }
49 
50 
51 //-----------------------------------------------------------------------------
52 // A mouse click toggles the operation mode of the tuning indicator
53 //-----------------------------------------------------------------------------
54 
62 
63 void TuningIndicatorView::mousePressEvent(QMouseEvent *event)
64 {
65  if (event->button() != Qt::NoButton)
66  {
68  }
69 }
70 
71 
72 //-----------------------------------------------------------------------------
73 // double click also toggles the operation mode of the tuning indicator
74 //-----------------------------------------------------------------------------
75 
84 
86 {
87  mousePressEvent(event);
88 }
TuningIndicatorView(QWidget *parent)
Constructor to link AutoScaledToKeyboardGraphicsView with the TuningIndicatorDrawer.
void toggleSpectralAndStroboscopeMode()
Toggle between spectral and stroboscopic operation mode.
Drawer for the tuning indicator.
void mouseDoubleClickEvent(QMouseEvent *event) overridefinal
Function called when the tuning indicator is double-clicked.
void mousePressEvent(QMouseEvent *event) overridefinal
Function called when the tuning indicator is clicked or touched.
Stroboscopic view adapter for Qt.