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
|
@ -420,7 +420,7 @@ void MiniAudioEngine::volChanged(int layer, float vol)
|
|||
return;
|
||||
if (vol >= 1)
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "slidergroup.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <QWidget>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
|
@ -39,6 +39,9 @@ SliderGroup::SliderGroup(QString name,
|
|||
valueBox.setFocusPolicy(Qt::NoFocus);
|
||||
valueBox.setButtonSymbols(QAbstractSpinBox::NoButtons);
|
||||
valueBox.setMinimumWidth(50);
|
||||
if (decimals)
|
||||
valueBox.setRange(-100, 100);
|
||||
else
|
||||
valueBox.setRange(min, max);
|
||||
valueBox.setValue(0);
|
||||
valueBox.setDecimals(decimals);
|
||||
|
@ -51,7 +54,7 @@ SliderGroup::SliderGroup(QString name,
|
|||
layout->addWidget(&slider);
|
||||
layout->addWidget(&valueBox);
|
||||
this->setStyleSheet("border: 1px solid #5a4855;"
|
||||
"width: 50px;"
|
||||
"width: 60px;"
|
||||
"margin: 0px;"
|
||||
"background-color: #383034;"
|
||||
);
|
||||
|
@ -74,6 +77,9 @@ void SliderGroup::setValue(float value)
|
|||
valueBox.blockSignals(true);
|
||||
if (int(value) != slider.value())
|
||||
slider.setValue(value);
|
||||
if (valueBox.decimals())
|
||||
valueBox.setValue(value - 100.0f);
|
||||
else
|
||||
valueBox.setValue(value);
|
||||
slider.blockSignals(false);
|
||||
valueBox.blockSignals(false);
|
||||
|
|
Loading…
Add table
Reference in a new issue