19 #include <QDoubleSpinBox> 21 #include <QGridLayout> 22 #include <QHBoxLayout> 24 #include <QPushButton> 26 #include <QDialogButtonBox> 32 valueLabel(tr(
"Value")),
33 levelLabel(tr(
"Level"))
38 QString scaleUnits, QWidget *parent) :
65 QGridLayout *grid =
new QGridLayout;
68 QGroupBox *timeBox =
nullptr;
69 QGroupBox *valueBox =
nullptr;
70 QGridLayout *subgrid =
nullptr;
72 int row = 0, subrow = 0;
74 int singleStep = RealTime::frame2RealTime(2, sampleRate).usec() - 1;
78 timeBox =
new QGroupBox;
79 timeBox->setTitle(tr(
"Timing"));
80 grid->addWidget(timeBox, row, 0);
82 subgrid =
new QGridLayout;
83 timeBox->setLayout(subgrid);
88 if (options & ShowTime) {
90 subgrid->addWidget(
new QLabel(tr(
"Time:")), subrow, 0);
119 if (options & ShowDuration) {
121 subgrid->addWidget(
new QLabel(tr(
"Duration:")), subrow, 0);
154 valueBox =
new QGroupBox;
155 valueBox->setTitle(tr(
"Properties"));
156 grid->addWidget(valueBox, row, 0);
158 subgrid =
new QGridLayout;
159 valueBox->setLayout(subgrid);
166 if (options & ShowValue) {
168 subgrid->addWidget(
new QLabel(tr(
"%1:").arg(labelOptions.
valueLabel)),
183 if (options & ShowLevel) {
185 subgrid->addWidget(
new QLabel(tr(
"%1:").arg(labelOptions.
levelLabel)),
200 if (options & ShowText) {
202 subgrid->addWidget(
new QLabel(tr(
"Text:")), subrow, 0);
212 if (options & ShowText) {
214 }
else if (options & ShowValue) {
216 }
else if (options & ShowLevel) {
220 QDialogButtonBox *bb =
new QDialogButtonBox(Qt::Horizontal);
221 grid->addWidget(bb, row, 0, 1, 2);
223 QPushButton *ok =
new QPushButton(tr(
"OK"));
225 QPushButton *cancel =
new QPushButton(tr(
"Cancel"));
226 bb->addButton(ok, QDialogButtonBox::AcceptRole);
228 bb->addButton(cancel, QDialogButtonBox::RejectRole);
229 connect(ok, SIGNAL(clicked()),
this, SLOT(accept()));
231 connect(cancel, SIGNAL(clicked()),
this, SLOT(reject()));
240 RealTime rt(RealTime::frame2RealTime(frame,
m_sampleRate));
271 RealTime rt(RealTime::frame2RealTime(duration,
m_sampleRate));
365 sv_frame_t frame = RealTime::realTime2Frame(rt,
m_sampleRate);
375 sv_frame_t frame = RealTime::realTime2Frame(rt,
m_sampleRate);
400 sv_frame_t frame = RealTime::realTime2Frame(rt,
m_sampleRate);
410 sv_frame_t frame = RealTime::realTime2Frame(rt,
m_sampleRate);
RealTime getRealDuration() const
QSpinBox * m_realDurationSecsSpinBox
QSpinBox * m_frameTimeSpinBox
void levelChanged(double)
void valueChanged(double)
void setFrameDuration(sv_frame_t frame)
sv_samplerate_t m_sampleRate
void frameDurationChanged(int)
void realDurationUSecsChanged(int)
QSpinBox * m_realTimeUSecsSpinBox
sv_frame_t m_defaultDuration
QSpinBox * m_realTimeSecsSpinBox
void setFrameTime(sv_frame_t frame)
sv_frame_t getFrameTime() const
void setText(QString text)
RealTime getRealTime() const
void setRealDuration(RealTime rt)
void realTimeUSecsChanged(int)
QDoubleSpinBox * m_valueSpinBox
QPushButton * m_resetButton
QSpinBox * m_frameDurationSpinBox
sv_frame_t m_defaultFrame
void realDurationSecsChanged(int)
ItemEditDialog(sv_samplerate_t sampleRate, int options, LabelOptions labelOptions={}, QWidget *parent=0)
void setRealTime(RealTime rt)
void frameTimeChanged(int)
void textChanged(QString)
QSpinBox * m_realDurationUSecsSpinBox
QDoubleSpinBox * m_levelSpinBox
void setLevel(float level)
sv_frame_t getFrameDuration() const
void realTimeSecsChanged(int)
void setValue(float value)