21 #include <QHBoxLayout>
22 #include <QVBoxLayout>
26 #include <QToolButton>
28 #include <QKeySequence>
38 setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
41 mainLayout->setSpacing(0);
50 QHBoxLayout *linesLayout =
new QHBoxLayout;
52 mainLayout->addLayout(linesLayout);
54 class Line :
public QFrame {
57 setFrameShape(QFrame::VLine);
58 setFrameShadow(QFrame::Plain);
59 setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
63 virtual QSize minimumSizeHint()
const override final {
67 virtual QSize sizeHint()
const override final {
73 Line *offLine =
new Line;
74 Line *onLine =
new Line;
76 linesLayout->addStretch();
77 linesLayout->addWidget(offLine);
78 linesLayout->addStretch();
79 linesLayout->addWidget(onLine);
80 linesLayout->addStretch();
83 QHBoxLayout *textLayout =
new QHBoxLayout;
85 mainLayout->addLayout(textLayout);
86 textLayout->setMargin(0);
87 textLayout->setSpacing(0);
88 textLayout->addStretch();
90 QLabel *offLabel =
new QLabel(
"Off");
91 offLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
92 textLayout->addWidget(offLabel);
94 QHBoxLayout *onLayout =
new QHBoxLayout;
95 onLayout->setMargin(0);
96 textLayout->addLayout(onLayout);
98 QLabel *onLabel =
new QLabel(
"On");
99 onLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
100 onLayout->addWidget(onLabel);
101 onLayout->addStretch();
103 QToolButton *refreshButton =
new QToolButton;
104 onLayout->addWidget(refreshButton);
105 refreshButton->setIcon(QIcon(
":/media/images/refresh.png"));
107 QObject::connect(refreshButton, SIGNAL(clicked(
bool)),
this, SLOT(
onRefreshClicked()));
109 QToolButton *muteMicroButton =
new QToolButton;
110 onLayout->addWidget(muteMicroButton);
111 muteMicroButton->setCheckable(
true);
112 QIcon muteMicroIcons;
113 muteMicroIcons.addFile(QStringLiteral(
":/media/images/micro_active.png"), QSize(), QIcon::Normal, QIcon::Off);
114 muteMicroIcons.addFile(QStringLiteral(
":/media/images/micro_mute.png"), QSize(), QIcon::Normal, QIcon::On);
115 muteMicroButton->setIcon(muteMicroIcons);
117 QObject::connect(muteMicroButton, SIGNAL(toggled(
bool)),
this, SLOT(
onMicroMuteToggled(
bool)));
118 new QShortcut(QKeySequence(Qt::Key_M), muteMicroButton, SLOT(toggle()));
121 QToolButton *muteSpeakerButton =
new QToolButton;
122 onLayout->addWidget(muteSpeakerButton);
123 muteSpeakerButton->setCheckable(
true);
124 QIcon muteSpeakerIcons;
125 muteSpeakerIcons.addFile(QStringLiteral(
":/media/images/speaker_active.png"), QSize(), QIcon::Normal, QIcon::Off);
126 muteSpeakerIcons.addFile(QStringLiteral(
":/media/images/speaker_mute.png"), QSize(), QIcon::Normal, QIcon::On);
127 muteSpeakerButton->setIcon(muteSpeakerIcons);
129 QObject::connect(muteSpeakerButton, SIGNAL(toggled(
bool)),
this, SLOT(
onSpeakerMuteToggled(
bool)));
130 new QShortcut(QKeySequence(Qt::Key_S), muteSpeakerButton, SLOT(toggle()));
131 muteSpeakerButton->setWhatsThis(tr(
"Click this button to mute the speaker or headphone."));
134 mainLayout->addStretch();
142 this->setWhatsThis(tr(
"This widgets provides settings and information about the input level of the input device."));
143 offLabel->setWhatsThis(tr(
"If the input level drops below this mark the recorder stops and does not process the input signal."));
144 onLabel->setWhatsThis(tr(
"If the input level reaches this threshold the recorder starts analyzing the signal of the input device until the level drops below the 'Off' mark."));
145 refreshButton->setWhatsThis(tr(
"Click this button to reset the automatic calibration of the input volume."));
146 muteMicroButton->setWhatsThis(tr(
"Click this button to mute the input device."));
147 offLine->setWhatsThis(offLabel->whatsThis());
148 onLine->setWhatsThis(onLabel->whatsThis());
153 int pos0 = stopLevel * max;
154 int pos1 = onLevel * max;
VolumeControlGroupBox(QWidget *parent)
QHBoxLayout * mTextLayout
void muteSpeakerToggled(bool)
void refreshInputLevels()
QWidget * mMainWidgetContainer
Mode for recording the piano keys.
void onSpeakerMuteToggled(bool)
void muteMicroToggled(bool)
int toFlag(OperationMode mode)
void setTitle(QString title)
void updateLevels(double stopLevel, double onLevel)
Mode for manually tuning the piano.
VolumeControlLevel * mVolumeControlLevel
QHBoxLayout * mLinesLayout
static const std::unique_ptr< DisplaySizeDefines > & getSingleton()
void onMicroMuteToggled(bool)
QProgressBar to display the current input level.