Fix for bug #985

Was not able to reproduce the assert mentioned in the report though.
This commit is contained in:
Leland Lucius 2015-05-29 11:32:55 -05:00
parent 1992b0c7e3
commit c816d2562d
2 changed files with 25 additions and 12 deletions

36
src/effects/Equalization.cpp Normal file → Executable file
View File

@ -880,18 +880,7 @@ bool EffectEqualization::TransferDataToWindow()
mdBMax = 0; // force refresh in TransferDataFromWindow()
// Reload the curve names
mCurve->Clear();
for (size_t i = 0, cnt = mCurves.GetCount(); i < cnt; i++)
{
mCurve->Append(mCurves[ i ].Name);
}
mCurve->SetStringSelection(mCurveName);
// Allow the control to resize
mCurve->SetSizeHints(-1, -1);
// Set initial curve
setCurve( mCurveName );
UpdateCurves();
// Set graphic interpolation mode
mInterpChoice->SetSelection(mInterp);
@ -1847,6 +1836,23 @@ void EffectEqualization::LayoutEQSliders()
mUIParent->RefreshRect(wxRect(szrG->GetPosition(), szrGSize));
}
void EffectEqualization::UpdateCurves()
{
// Reload the curve names
mCurve->Clear();
for (size_t i = 0, cnt = mCurves.GetCount(); i < cnt; i++)
{
mCurve->Append(mCurves[ i ].Name);
}
mCurve->SetStringSelection(mCurveName);
// Allow the control to resize
mCurve->SetSizeHints(-1, -1);
// Set initial curve
setCurve( mCurveName );
}
void EffectEqualization::UpdateDraw()
{
int numPoints = mLogEnvelope->GetNumberOfPoints();
@ -2416,6 +2422,12 @@ void EffectEqualization::OnManage(wxCommandEvent & WXUNUSED(event))
{
EditCurvesDialog d(mUIParent, this, mCurve->GetSelection());
d.ShowModal();
// Reload the curve names
UpdateCurves();
// Allow control to resize
mUIParent->Layout();
}
void EffectEqualization::OnClear(wxCommandEvent & WXUNUSED(event))

1
src/effects/Equalization.h Normal file → Executable file
View File

@ -150,6 +150,7 @@ private:
XMLTagHandler *HandleXMLChild(const wxChar *tag);
void WriteXML(XMLWriter &xmlFile);
void UpdateCurves();
void UpdateDraw();
void LayoutEQSliders();