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
signalanalyzergroupbox.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 #include "signalanalyzergroupbox.h"
21 #include <QHBoxLayout>
22 #include <QVBoxLayout>
23 #include <QLabel>
24 
25 #include "recordingqualitybar.h"
27 
30 {
31  setTitle(tr("Signal analyzer"));
32  setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
33 
34  QHBoxLayout *mainLayout = qobject_cast<QHBoxLayout*>(mMainWidgetContainer->layout());
35  mainLayout->setSpacing(0);
36 
37  RecordingQualityBar *qualityBar = new RecordingQualityBar(this);
38  mainLayout->addWidget(qualityBar);
39 
41  mainLayout->addWidget(statusView);
42 
43 
44  QVBoxLayout *labelsLayout = new QVBoxLayout;
45  mainLayout->addLayout(labelsLayout);
46  labelsLayout->setMargin(0);
47 
48  labelsLayout->addStretch();
49 
50  mKeyLabel = new QLabel("-");
51  mKeyLabel->setAlignment(Qt::AlignCenter);
52  QFont keyLabelFont;
53  keyLabelFont.setPointSize(26);
54  mKeyLabel->setFont(keyLabelFont);
55  mKeyLabel->setFixedWidth(mKeyLabel->fontMetrics().width("A#0"));
56  labelsLayout->addWidget(mKeyLabel);
57 
58  labelsLayout->addSpacing(2);
59 
60  QHBoxLayout *frequencyLayout = new QHBoxLayout;
61  labelsLayout->addLayout(frequencyLayout);
62 
63  mFrequencyLabel = new QLabel("-");
64  mFrequencyLabel->setFixedWidth(mFrequencyLabel->fontMetrics().width("0000.0"));
65  mFrequencyLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
66  frequencyLayout->addWidget(mFrequencyLabel);
67 
68  QLabel *hzLabel = new QLabel(tr("Hz"));
69  frequencyLayout->addWidget(hzLabel);
70  hzLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
71  hzLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
72 
73 
74  labelsLayout->addStretch();
75 
76 
77  // set whats this texts
78  mKeyLabel->setWhatsThis(tr("This label displays the current selected key."));
79  mFrequencyLabel->setWhatsThis(tr("This label shows the ground frequency of the selected key."));
80  hzLabel->setWhatsThis(mFrequencyLabel->whatsThis());
81 }
82 
The QGraphicsView that will display the current recording status.
Mode for recording the piano keys.
Definition: prerequisites.h:69
SignalAnalyzerGroupBox(QWidget *parent)
int toFlag(OperationMode mode)
Definition: prerequisites.h:76
Mode for manually tuning the piano.
Definition: prerequisites.h:71
Do nothing.
Definition: prerequisites.h:68
Quality recording bar.