| 1378 | } |
| 1379 | |
| 1380 | void LfoPanel::parameterChanged(const juce::String& parameterID, float newValue) |
| 1381 | { |
| 1382 | auto currentSyncModeID = ParameterIDAndName::getIDString(LFO_SYNC_MODE_ID, currentLfoIndex); |
| 1383 | if (parameterID == currentSyncModeID) |
| 1384 | { |
| 1385 | triggerAsyncUpdate(); |
| 1386 | return; |
| 1387 | } |
| 1388 | |
| 1389 | for (int i = 0; i < 4; ++i) |
| 1390 | { |
| 1391 | auto smoothParamID = ParameterIDAndName::getIDString(LFO_SMOOTH_ID, i); |
| 1392 | if (parameterID == smoothParamID) |
| 1393 | { |
| 1394 | // FIX: Correct, thread-safe way to update a member of LfoData |
| 1395 | // 1. Get a copy of the current data |
| 1396 | auto lfoDataCopy = processor.getLfoManager().getLfoData()[i]; |
| 1397 | // 2. Modify the copy |
| 1398 | lfoDataCopy.smoothness = newValue; |
| 1399 | // 3. Set the data back using the thread-safe method |
| 1400 | processor.getLfoManager().setLfoData(i, lfoDataCopy); |
| 1401 | |
| 1402 | // The LfoManager will handle flagging the shape for update. |
| 1403 | // We still call onDataChanged to mark the preset as dirty. |
| 1404 | if (onDataChanged) |
| 1405 | onDataChanged(); |
| 1406 | |
| 1407 | return; |
| 1408 | } |
| 1409 | } |
| 1410 | } |
| 1411 | |
| 1412 | void LfoPanel::sliderValueChanged(juce::Slider* slider) |
| 1413 | { |
nothing calls this directly
no test coverage detected