| 560 | /////////////////////////////////////////////////////////////////////////////// |
| 561 | |
| 562 | void EqualizationUI::UpdateCurves() |
| 563 | { |
| 564 | auto ¶meters = 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 | |
| 593 | void EqualizationUI::UpdateDraw() |
| 594 | { |