MCPcopy Create free account
hub / github.com/audacity/audacity / UpdateCurves

Method UpdateCurves

src/effects/EqualizationUI.cpp:562–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560///////////////////////////////////////////////////////////////////////////////
561
562void EqualizationUI::UpdateCurves()
563{
564 auto &parameters = mCurvesList.mParameters;
565 auto &curveName = parameters.mCurveName;
566 const auto &curves = mCurvesList.mCurves;
567
568 // Reload the curve names
569 if( mCurve )
570 mCurve->Clear();
571 bool selectedCurveExists = false;
572 for (size_t i = 0, cnt = curves.size(); i < cnt; i++)
573 {
574 if (curveName == curves[ i ].Name)
575 selectedCurveExists = true;
576 if( mCurve )
577 mCurve->Append(curves[ i ].Name);
578 }
579 // In rare circumstances, curveName may not exist (bug 1891)
580 if (!selectedCurveExists)
581 curveName = curves[ (int)curves.size() - 1 ].Name;
582 if( mCurve )
583 mCurve->SetStringSelection(curveName);
584
585 // Allow the control to resize
586 if( mCurve )
587 mCurve->SetMinSize({-1, -1});
588
589 // Set initial curve
590 mCurvesList.setCurve( curveName );
591}
592
593void EqualizationUI::UpdateDraw()
594{

Callers

nothing calls this directly

Calls 4

setCurveMethod · 0.80
ClearMethod · 0.45
sizeMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected