indicador de volumen con dos decimales

This commit is contained in:
snt 2024-04-24 20:23:20 +02:00
parent 32a1e5cb0c
commit 3613d8fa51
12 changed files with 53 additions and 187 deletions

View file

@ -10,9 +10,6 @@ AudioLayerWidget::AudioLayerWidget(QWidget *parent, QString name, int layer):
QVBoxLayout *layout = new QVBoxLayout;
QHBoxLayout *progressTime = new QHBoxLayout;
//m_progressTimeLabel = new QLabel;
//m_progressTimeLabel->setText(PROGRESS_TIME_LABEL);
//progressTime->addWidget(m_progressTimeLabel);
m_progressTime = new QTimeEdit;
m_progressTime->text();
m_progressTime->setDisplayFormat("h:mm:ss:zzz");
@ -21,9 +18,6 @@ AudioLayerWidget::AudioLayerWidget(QWidget *parent, QString name, int layer):
m_progressTime->setMaximumWidth(90);
m_progressTime->setFocusPolicy(Qt::NoFocus);
progressTime->addWidget(m_progressTime);
//m_totalTimeLabel = new QLabel;
//m_totalTimeLabel->setText(TOTAL_TIME_LABEL);
//progressTime->addWidget(m_totalTimeLabel);
m_totalTimeValue = new QTimeEdit;
m_totalTimeValue->setDisplayFormat("h:mm:ss:zzz");
m_totalTimeValue->setReadOnly(true);
@ -49,19 +43,19 @@ AudioLayerWidget::AudioLayerWidget(QWidget *parent, QString name, int layer):
layout->addLayout(status);
QHBoxLayout *volumeBox = new QHBoxLayout;
m_volume = new SliderGroup("Vol", 0 , 100, NULL);
m_volume = new SliderGroup("Vol", 0 , 100, 2, NULL);
volumeBox->addWidget(m_volume);
connect(m_volume, SIGNAL(valueChanged(int)), this, SLOT(volumeChanged(int)));
m_pan = new SliderGroup("Pan", 0 , 255, NULL);
connect(m_volume, SIGNAL(valueChanged(float)), this, SLOT(volumeChanged(float)));
m_pan = new SliderGroup("Pan", 0 , 255, 0, NULL);
volumeBox->addWidget(m_pan);
connect(m_pan, SIGNAL(valueChanged(int)), this, SLOT(panChanged(int)));
m_pitch = new SliderGroup("Pitch", 0 , 255, NULL);
connect(m_pan, SIGNAL(valueChanged(float)), this, SLOT(panChanged(float)));
m_pitch = new SliderGroup("Pitch", 0 , 255, 0, NULL);
volumeBox->addWidget(m_pitch);
connect(m_pitch, SIGNAL(valueChanged(int)), this, SLOT(pitchChanged(int)));
connect(m_pitch, SIGNAL(valueChanged(float)), this, SLOT(pitchChanged(float)));
layout->addLayout(volumeBox);
m_suspendResumeButton = new QPushButton(this);
m_suspendResumeButton->setText(tr(SUSPEND_LABEL));
m_suspendResumeButton->setText(StatusStr[Status::Stopped]);
connect(m_suspendResumeButton, SIGNAL(clicked()), SLOT(toggleSuspendResume()));
layout->addWidget(m_suspendResumeButton);
@ -74,17 +68,17 @@ AudioLayerWidget::~AudioLayerWidget()
}
// From UI.
void AudioLayerWidget::volumeChanged(int value)
void AudioLayerWidget::volumeChanged(float value)
{
emit(uiSliderChanged(m_layer, Slider::Volume, value));
}
void AudioLayerWidget::panChanged(int value)
void AudioLayerWidget::panChanged(float value)
{
emit(uiSliderChanged(m_layer, Slider::Pan, value));
}
void AudioLayerWidget::pitchChanged(int value)
void AudioLayerWidget::pitchChanged(float value)
{
emit(uiSliderChanged(m_layer, Slider::Pitch, value));
}
@ -106,7 +100,7 @@ void AudioLayerWidget::toggleSuspendResume()
}
// from DMX signals
void AudioLayerWidget::setVol(int vol)
void AudioLayerWidget::setVol(float vol)
{
m_volume->blockSignals(true);
m_volume->setValue(vol);