Fixed: When removing a row with embedded VST plugin, the Configuration Editor crashed.

Fixed: Analysis panel was not always working correctly when the loudness correction was active, especially on single-core systems.
Fixed: Font of attribution in loudness correction GUI was too small.
This commit is contained in:
jthedering committed 2017-07-19 19:20:02 +00:00
1 parent a3cb12ff8a
commit 2997d2151c
4 files changed
+29 -9

No files matched your search

+3 -1
View File
@@ -98,8 +98,10 @@
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="font"> <property name="font">
<font> <font>
<pointsize>6</pointsize> <pointsize>7</pointsize>
<weight>50</weight>
<italic>true</italic> <italic>true</italic>
<bold>false</bold>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
+7 -6
View File
@@ -59,7 +59,7 @@ VSTPluginFilterGUI::~VSTPluginFilterGUI()
{ {
if (effect != NULL) if (effect != NULL)
{ {
if (ui->embedAction->isChecked()) if (embedded)
on_embedAction_toggled(false); on_embedAction_toggled(false);
delete effect; delete effect;
effect = NULL; effect = NULL;
@@ -295,9 +295,9 @@ void VSTPluginFilterGUI::on_embedAction_toggled(bool checked)
if (effect == NULL) if (effect == NULL)
enable = false; enable = false;
bool wasEnabled = ui->frame->isVisible(); if (enable != embedded)
if (enable != wasEnabled)
{ {
embedded = enable;
ui->frame->setVisible(enable); ui->frame->setVisible(enable);
ui->statusLabel->setVisible(!enable); ui->statusLabel->setVisible(!enable);
@@ -310,6 +310,7 @@ void VSTPluginFilterGUI::on_embedAction_toggled(bool checked)
} }
else else
{ {
embedded = false;
ui->frame->setVisible(false); ui->frame->setVisible(false);
ui->statusLabel->setVisible(true); ui->statusLabel->setVisible(true);
@@ -339,7 +340,7 @@ void VSTPluginFilterGUI::on_idle()
{ {
effect->doIdle(); effect->doIdle();
if (ui->frame->isVisible() || autoApplyDialog) if (embedded || autoApplyDialog)
{ {
if (!lastReadTimer.isValid() || lastReadTimer.elapsed() > 1000) if (!lastReadTimer.isValid() || lastReadTimer.elapsed() > 1000)
{ {
@@ -361,7 +362,7 @@ void VSTPluginFilterGUI::on_idle()
void VSTPluginFilterGUI::onAutomate() void VSTPluginFilterGUI::onAutomate()
{ {
if (ui->frame->isVisible() || autoApplyDialog) if (embedded || autoApplyDialog)
{ {
effect->readFromEffect(chunkData, paramMap); effect->readFromEffect(chunkData, paramMap);
updateModel(); updateModel();
@@ -371,7 +372,7 @@ void VSTPluginFilterGUI::onAutomate()
void VSTPluginFilterGUI::onSizeWindow(int w, int h) void VSTPluginFilterGUI::onSizeWindow(int w, int h)
{ {
if (ui->frame->isVisible()) if (embedded)
ui->frame->setFixedSize(w, h); ui->frame->setFixedSize(w, h);
} }
+1
View File
@@ -61,6 +61,7 @@ private:
VSTPluginInstance* effect = NULL; VSTPluginInstance* effect = NULL;
std::wstring chunkData; std::wstring chunkData;
std::unordered_map<std::wstring, float> paramMap; std::unordered_map<std::wstring, float> paramMap;
bool embedded = false;
bool autoApplyDialog = false; bool autoApplyDialog = false;
QElapsedTimer lastReadTimer; QElapsedTimer lastReadTimer;
}; };
@@ -62,10 +62,26 @@ std::vector<std::wstring> LoudnessCorrectionFilter::initialize(float sampleRate,
_highShelfBiquads.resize(_channelCount); _highShelfBiquads.resize(_channelCount);
_sampleRate = sampleRate; _sampleRate = sampleRate;
_attFactor = 1.0; _attFactor = 1.0;
_neutral = true;
double freqLS = 75, qLS = 1, gainLS = 0;
double freqHS = 10000, qHS = 1, gainHS = 0;
VolumeController VolumeController;
float vol;
HRESULT res = VolumeController.getVolume(vol);
if (res == S_OK)
{
double preAmp;
getLShelfParamter(vol, freqLS, qLS, gainLS, preAmp);
_attFactor = exp(preAmp / 6 * log(2));
getHShelfParamter(vol + (float)preAmp, freqHS, qHS, gainHS);
_neutral = std::max<double>(std::abs(gainLS), std::abs(gainHS)) < 0.2 ? true : false;
}
for (unsigned i = 0; i < _channelCount; i++) for (unsigned i = 0; i < _channelCount; i++)
{ {
_lowShelfBiquads[i] = BiQuad(BiQuad::LOW_SHELF, 0, 75, _sampleRate, 1, false); _lowShelfBiquads[i] = BiQuad(BiQuad::LOW_SHELF, gainLS, freqLS, _sampleRate, qLS, false);
_highShelfBiquads[i] = BiQuad(BiQuad::HIGH_SHELF, 0, 10000, _sampleRate, 1, false); _highShelfBiquads[i] = BiQuad(BiQuad::HIGH_SHELF, gainHS, freqHS, _sampleRate, qHS, false);
} }
_stopParameterUpdateThreadEvent = CreateEvent(NULL, true, false, NULL); _stopParameterUpdateThreadEvent = CreateEvent(NULL, true, false, NULL);
_parameterchangedEvent = CreateEvent(NULL, true, false, NULL); _parameterchangedEvent = CreateEvent(NULL, true, false, NULL);