cambiada curva de volume de cúbia a cuadrática, en pruebas a ver si es
suficiente. valuebox de volumen en decibelios.
This commit is contained in:
parent
5d56921aeb
commit
f0f6e595fb
3 changed files with 12 additions and 6 deletions
|
@ -82,7 +82,7 @@ AudioLayerWidget::AudioLayerWidget(QWidget *parent, int layer):
|
||||||
m_pan = new SliderGroup("Pan", 0 , 255, 0, NULL);
|
m_pan = new SliderGroup("Pan", 0 , 255, 0, NULL);
|
||||||
volumeBox->addWidget(m_pan);
|
volumeBox->addWidget(m_pan);
|
||||||
connect(m_pan, SIGNAL(valueChanged(int)), this, SLOT(panChanged(int)));
|
connect(m_pan, SIGNAL(valueChanged(int)), this, SLOT(panChanged(int)));
|
||||||
m_volume = new SliderGroup("Vol", 0 , 100, 2, NULL);
|
m_volume = new SliderGroup("Vol", 0, 100, 2, NULL);
|
||||||
volumeBox->addWidget(m_volume);
|
volumeBox->addWidget(m_volume);
|
||||||
connect(m_volume, SIGNAL(valueChanged(int)), this, SLOT(volumeChanged(int)));
|
connect(m_volume, SIGNAL(valueChanged(int)), this, SLOT(volumeChanged(int)));
|
||||||
volumeBox->setSpacing(0);
|
volumeBox->setSpacing(0);
|
||||||
|
|
|
@ -420,7 +420,7 @@ void MiniAudioEngine::volChanged(int layer, float vol)
|
||||||
return;
|
return;
|
||||||
if (vol >= 1)
|
if (vol >= 1)
|
||||||
vol = 0.99f;
|
vol = 0.99f;
|
||||||
ma_sound_group_set_fade_in_milliseconds(&m_mae.sounds[layer], -1, pow(vol, 3), FADE_TIME);
|
ma_sound_group_set_fade_in_milliseconds(&m_mae.sounds[layer], -1, pow(vol, 2), FADE_TIME);
|
||||||
m_mae.currentStatus[layer].vol = vol;
|
m_mae.currentStatus[layer].vol = vol;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "slidergroup.h"
|
#include "slidergroup.h"
|
||||||
|
#include <cmath>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
@ -39,7 +39,10 @@ SliderGroup::SliderGroup(QString name,
|
||||||
valueBox.setFocusPolicy(Qt::NoFocus);
|
valueBox.setFocusPolicy(Qt::NoFocus);
|
||||||
valueBox.setButtonSymbols(QAbstractSpinBox::NoButtons);
|
valueBox.setButtonSymbols(QAbstractSpinBox::NoButtons);
|
||||||
valueBox.setMinimumWidth(50);
|
valueBox.setMinimumWidth(50);
|
||||||
valueBox.setRange(min, max);
|
if (decimals)
|
||||||
|
valueBox.setRange(-100, 100);
|
||||||
|
else
|
||||||
|
valueBox.setRange(min, max);
|
||||||
valueBox.setValue(0);
|
valueBox.setValue(0);
|
||||||
valueBox.setDecimals(decimals);
|
valueBox.setDecimals(decimals);
|
||||||
valueBox.setObjectName(name);
|
valueBox.setObjectName(name);
|
||||||
|
@ -51,7 +54,7 @@ SliderGroup::SliderGroup(QString name,
|
||||||
layout->addWidget(&slider);
|
layout->addWidget(&slider);
|
||||||
layout->addWidget(&valueBox);
|
layout->addWidget(&valueBox);
|
||||||
this->setStyleSheet("border: 1px solid #5a4855;"
|
this->setStyleSheet("border: 1px solid #5a4855;"
|
||||||
"width: 50px;"
|
"width: 60px;"
|
||||||
"margin: 0px;"
|
"margin: 0px;"
|
||||||
"background-color: #383034;"
|
"background-color: #383034;"
|
||||||
);
|
);
|
||||||
|
@ -74,7 +77,10 @@ void SliderGroup::setValue(float value)
|
||||||
valueBox.blockSignals(true);
|
valueBox.blockSignals(true);
|
||||||
if (int(value) != slider.value())
|
if (int(value) != slider.value())
|
||||||
slider.setValue(value);
|
slider.setValue(value);
|
||||||
valueBox.setValue(value);
|
if (valueBox.decimals())
|
||||||
|
valueBox.setValue(value - 100.0f);
|
||||||
|
else
|
||||||
|
valueBox.setValue(value);
|
||||||
slider.blockSignals(false);
|
slider.blockSignals(false);
|
||||||
valueBox.blockSignals(false);
|
valueBox.blockSignals(false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue