feat: add precision setting for mix delay up & down (#5314)
This commit is contained in:
@@ -143,6 +143,7 @@ Node convert<MixData>::encode(const MixData& rhs)
|
||||
node["weight"] = YamlSourceNumRefEncode(rhs.weight);
|
||||
node["swtch"] = rhs.swtch;
|
||||
node["curve"] = rhs.curve;
|
||||
node["delayPrec"] = rhs.delayPrec;
|
||||
node["delayUp"] = rhs.delayUp;
|
||||
node["delayDown"] = rhs.delayDown;
|
||||
node["speedPrec"] = rhs.speedPrec;
|
||||
@@ -166,6 +167,7 @@ bool convert<MixData>::decode(const Node& node, MixData& rhs)
|
||||
}
|
||||
node["swtch"] >> rhs.swtch;
|
||||
node["curve"] >> rhs.curve;
|
||||
node["delayPrec"] >> rhs.delayPrec;
|
||||
node["delayUp"] >> rhs.delayUp;
|
||||
node["delayDown"] >> rhs.delayDown;
|
||||
node["speedPrec"] >> rhs.speedPrec;
|
||||
|
||||
@@ -48,6 +48,7 @@ class MixData {
|
||||
int weight;
|
||||
RawSwitch swtch;
|
||||
CurveReference curve;
|
||||
unsigned int delayPrec;
|
||||
unsigned int delayUp;
|
||||
unsigned int delayDown;
|
||||
unsigned int speedPrec;
|
||||
|
||||
@@ -145,20 +145,23 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData * mixdata,
|
||||
ui->switchesCB->setCurrentIndex(ui->switchesCB->findData(md->swtch.toValue()));
|
||||
ui->warningCB->setCurrentIndex(md->mixWarn);
|
||||
ui->mltpxCB->setCurrentIndex(md->mltpx);
|
||||
ui->delayPrecCB->setCurrentIndex(md->delayPrec);
|
||||
ui->speedPrecCB->setCurrentIndex(md->speedPrec);
|
||||
|
||||
int scale=firmware->getCapability(SlowScale);
|
||||
float range=firmware->getCapability(SlowRange);
|
||||
float range = firmware->getCapability(SlowRange);
|
||||
|
||||
int scale = firmware->getCapability(SlowScale);
|
||||
if (md->delayPrec) scale = scale * 10;
|
||||
ui->delayDownSB->setMaximum(range / scale);
|
||||
ui->delayDownSB->setSingleStep(1.0 / scale);
|
||||
ui->delayDownSB->setDecimals((scale == 1 ? 0 : 1));
|
||||
ui->delayDownSB->setDecimals((scale == 1 ? 0 : scale == 10 ? 1 : 2));
|
||||
ui->delayDownSB->setValue((float)md->delayDown / scale);
|
||||
ui->delayUpSB->setMaximum(range / scale);
|
||||
ui->delayUpSB->setSingleStep(1.0 / scale);
|
||||
ui->delayUpSB->setDecimals((scale == 1 ? 0 : 1));
|
||||
ui->delayUpSB->setDecimals((scale == 1 ? 0 : scale == 10 ? 1 : 2));
|
||||
ui->delayUpSB->setValue((float)md->delayUp / scale);
|
||||
|
||||
scale = firmware->getCapability(SlowScale);
|
||||
if (md->speedPrec) scale = scale * 10;
|
||||
ui->slowDownSB->setMaximum(range / scale);
|
||||
ui->slowDownSB->setSingleStep(1.0 / scale);
|
||||
@@ -178,6 +181,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData * mixdata,
|
||||
connect(ui->switchesCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
connect(ui->warningCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
connect(ui->mltpxCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
connect(ui->delayPrecCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
connect(ui->delayDownSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
|
||||
connect(ui->delayUpSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
|
||||
connect(ui->speedPrecCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
@@ -229,18 +233,35 @@ void MixerDialog::valuesChanged()
|
||||
md->mixWarn = ui->warningCB->currentIndex();
|
||||
md->mltpx = (MltpxValue)ui->mltpxCB->currentIndex();
|
||||
|
||||
float range = firmware->getCapability(SlowRange);
|
||||
|
||||
// Update values based on old precision (in case it changed)
|
||||
int scale = firmware->getCapability(SlowScale);
|
||||
if (md->delayPrec) scale = scale * 10;
|
||||
md->delayDown = round(ui->delayDownSB->value() * scale);
|
||||
md->delayUp = round(ui->delayUpSB->value() * scale);
|
||||
|
||||
// Get new precion and update controls
|
||||
md->delayPrec = ui->delayPrecCB->currentIndex();
|
||||
scale = firmware->getCapability(SlowScale);
|
||||
if (md->delayPrec) scale = scale * 10;
|
||||
ui->delayDownSB->setMaximum(range / scale);
|
||||
ui->delayDownSB->setSingleStep(1.0 / scale);
|
||||
ui->delayDownSB->setDecimals((scale == 1 ? 0 : scale == 10 ? 1 : 2));
|
||||
ui->delayDownSB->setValue((float)md->delayDown / scale);
|
||||
ui->delayUpSB->setMaximum(range / scale);
|
||||
ui->delayUpSB->setSingleStep(1.0 / scale);
|
||||
ui->delayUpSB->setDecimals((scale == 1 ? 0 : scale == 10 ? 1 : 2));
|
||||
ui->delayUpSB->setValue((float)md->delayUp / scale);
|
||||
|
||||
// Update values based on old precision (in case it changed)
|
||||
scale = firmware->getCapability(SlowScale);
|
||||
if (md->speedPrec) scale = scale * 10;
|
||||
md->speedDown = round(ui->slowDownSB->value() * scale);
|
||||
md->speedUp = round(ui->slowUpSB->value() * scale);
|
||||
|
||||
// Get new precion and update controls
|
||||
md->speedPrec = ui->speedPrecCB->currentIndex();
|
||||
float range = firmware->getCapability(SlowRange);
|
||||
scale = firmware->getCapability(SlowScale);
|
||||
if (md->speedPrec) scale = scale * 10;
|
||||
ui->slowDownSB->setMaximum(range / scale);
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>752</width>
|
||||
<height>623</height>
|
||||
<width>763</width>
|
||||
<height>655</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -63,13 +63,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>Slow up/dn prec</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="sourceCB"/>
|
||||
</item>
|
||||
@@ -80,20 +73,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QComboBox" name="speedPrecCB">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>0.0</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>0.00</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QComboBox" name="switchesCB"/>
|
||||
</item>
|
||||
@@ -521,37 +500,8 @@
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0,0,0">
|
||||
<item row="1" column="2">
|
||||
<widget class="QDoubleSpinBox" name="slowUpSB">
|
||||
<property name="whatsThis">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Delay ans Slow</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These values control the speed and delay of the output of the mix. </p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Delay is not zero the actuation of the mix will be delayed by the specified amount of seconds.</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Slow is not zero then the speed of the mix will be set by the value specified -&gt; the value states the number of seconds it takes to transit from -100 to 100.</p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>7.500000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="delayUpSB">
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="delayDownSB">
|
||||
<property name="whatsThis">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
@@ -573,7 +523,48 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Slow</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Delay</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Up</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Down</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QDoubleSpinBox" name="slowDownSB">
|
||||
<property name="whatsThis">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
@@ -602,49 +593,8 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Down</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>Up</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Delay</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Slow</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="delayDownSB">
|
||||
<widget class="QDoubleSpinBox" name="delayUpSB">
|
||||
<property name="whatsThis">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
@@ -666,6 +616,73 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QDoubleSpinBox" name="slowUpSB">
|
||||
<property name="whatsThis">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Delay ans Slow</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These values control the speed and delay of the output of the mix. </p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Delay is not zero the actuation of the mix will be delayed by the specified amount of seconds.</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Slow is not zero then the speed of the mix will be set by the value specified -&gt; the value states the number of seconds it takes to transit from -100 to 100.</p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>7.500000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>Precision</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QComboBox" name="speedPrecCB">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>0.0</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>0.00</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="delayPrecCB">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>0.0</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>0.00</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -440,10 +440,15 @@ QString ModelPrinter::printMixerLine(const MixData & mix, bool showMultiplex, in
|
||||
if (mix.curve.value)
|
||||
str += " " + mix.curve.toString(&model, true, &generalSettings).toHtmlEscaped();
|
||||
int scale = firmware->getCapability(SlowScale);
|
||||
if (scale == 0)
|
||||
scale = 1;
|
||||
if (scale == 0) scale = 1;
|
||||
if (mix.delayPrec) {
|
||||
scale = scale * 10;
|
||||
str += " " + tr("Delay precision(0.00)").toHtmlEscaped();
|
||||
}
|
||||
if (mix.delayDown || mix.delayUp)
|
||||
str += " " + tr("Delay(u%1:d%2)").arg((double)mix.delayUp / scale).arg((double)mix.delayDown / scale).toHtmlEscaped();
|
||||
scale = firmware->getCapability(SlowScale);
|
||||
if (scale == 0) scale = 1;
|
||||
if (mix.speedPrec) {
|
||||
scale = scale * 10;
|
||||
str += " " + tr("Slow precision(0.00)").toHtmlEscaped();
|
||||
|
||||
Reference in New Issue
Block a user