Fix the plugin description update (regression)#381
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts track analysis execution so the plugin Description is produced and applied as part of the analysis completion path (via the async result), addressing a regression where the description update timing/flow was incorrect.
Changes:
- Change
Track::Processor::runAnalysisto returnbool(launch success) instead of returning an optionalPlugin::Description. - Extend the analysis completion callback / future result to include
Plugin::Description, and apply it when analysis ends. - Update
Track::Directorto set the track description from the analysis-ended callback rather than at launch time.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Source/Track/AnlTrackProcessor.h | Updates analysis API + async result/callback signatures to carry Plugin::Description. |
| Source/Track/AnlTrackProcessor.cpp | Includes Plugin::Description in async results for waveform/plugin analyses and forwards it to onAnalysisEnded. |
| Source/Track/AnlTrackDirector.cpp | Consumes the new callback signature and updates when/where AttrType::description is set. |
f662bb7 to
9f65aa7
Compare
There was a problem hiding this comment.
Pull request overview
This PR aims to fix a regression where track plugin descriptions were not being updated correctly by ensuring the analysis pipeline returns the Plugin::Description alongside the computed results and applying it when analysis completes.
Changes:
- Changed
Track::Processor::runAnalysisto returnbool(launched or not) instead of returning an optional description. - Extended the async analysis result to include
Plugin::Description, and expandedonAnalysisEndedto provide it. - Updated
Track::Directorto setAttrType::descriptionwhen analysis completes (instead of at launch).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Source/Track/AnlTrackProcessor.h | Updates processor API and async result type to carry Plugin::Description. |
| Source/Track/AnlTrackProcessor.cpp | Builds description into async result and forwards it via callback. |
| Source/Track/AnlTrackDirector.cpp | Applies description on analysis completion and adapts to new runAnalysis() return type. |
Comments suppressed due to low confidence (1)
Source/Track/AnlTrackDirector.cpp:733
runAnalysis()no longer updatesAttrType::descriptionwhen launching the analysis; it’s now only updated on successful completion inonAnalysisEnded. This can leaveAttrType::keyandAttrType::descriptiontemporarily inconsistent while analysis is running, and permanently inconsistent if the analysis is aborted or fails (since the callback only sets description onresult.wasOk()). Consider setting the new description at launch (or clearing it) so UI/state derived fromdescriptionstays consistent with the selected key even when the analysis doesn’t complete.
mProcessor.stopAnalysis();
auto const result = mProcessor.runAnalysis(mAccessor, *mAudioFormatReader.get(), inputResults);
if(result)
{
MiscDebug("Track", "analysis launched");
mAccessor.setAttr<AttrType::warnings>(WarningType::none, notification);
startTimer(50);
timerCallback();
}
be58577 to
7e9b27d
Compare
There was a problem hiding this comment.
Pull request overview
This PR addresses a regression in how a track’s plugin description is updated by ensuring the description is propagated when the analysis completes (together with the results), rather than being returned synchronously at launch time.
Changes:
- Change
Track::Processor::runAnalysisto returnbool(launched or not) and carryPlugin::Descriptionthrough the async result. - Extend
onAnalysisEndedto includePlugin::Description, and updateTrack::Directorto setAttrType::descriptionwhen analysis finishes successfully. - Update processor async state (
std::future) to includePlugin::Descriptionin its completion tuple.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Source/Track/AnlTrackProcessor.h | Updates analysis API and callback signature to include Plugin::Description. |
| Source/Track/AnlTrackProcessor.cpp | Threads plugin description through the async analysis completion result. |
| Source/Track/AnlTrackDirector.cpp | Applies the completed analysis description/results to the model on success. |
7e9b27d to
7e15396
Compare
There was a problem hiding this comment.
Pull request overview
This PR adjusts the track analysis pipeline so that plugin Description is propagated alongside analysis Results when the async analysis finishes, addressing a regression where the description was not updated correctly.
Changes:
- Change
Track::Processor::runAnalysis()to returnbool(launch success) instead of returning aPlugin::Description. - Extend async analysis results to include
Plugin::Descriptionand forward it viaonAnalysisEnded. - Update
Track::Directorto consume the new callback signature and set the track description/results on completion.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
Source/Track/AnlTrackProcessor.h |
Updates processor API and callback signature to deliver Plugin::Description on completion. |
Source/Track/AnlTrackProcessor.cpp |
Carries Plugin::Description through the async future result tuple and forwards it to onAnalysisEnded. |
Source/Track/AnlTrackDirector.cpp |
Updates callback wiring and stops setting description at launch time; sets it on analysis completion instead. |
Comments suppressed due to low confidence (2)
Source/Track/AnlTrackDirector.cpp:385
onAnalysisEndednow receives the computedPlugin::Description, but the Director only writes it toAttrType::descriptionon success. If the analysis fails (plugin error), the track may keep a stale description that no longer matches the currentkey/state, which can break subsequent state sanitization/UI (especially sincerunAnalysis()no longer returns a description). Consider updatingAttrType::descriptionregardless ofresult.wasOk()(or at least in the error branch too) so the model stays consistent with the selected plugin.
mProcessor.onAnalysisEnded = [&](juce::Result const& result, Results const& data, Plugin::Description const& description)
{
if(result.wasOk())
{
mAccessor.setAttr<AttrType::description>(description, NotificationType::synchronous);
mAccessor.setAttr<AttrType::results>(data, NotificationType::synchronous);
runRendering();
}
else
{
mAccessor.setAttr<AttrType::warnings>(WarningType::plugin, NotificationType::synchronous);
warmAboutPlugin(result.getErrorMessage());
}
Source/Track/AnlTrackDirector.cpp:734
Processor::runAnalysis()now returnsfalsefor cases like allocation failure (it no longer throws). InDirector::runAnalysis, whenresultis false the code silently does nothing (no warnings/alert), whereas previously the exception path would setWarningType::pluginand inform the user. Please handle thefalsereturn explicitly (e.g., set an appropriate warning and show an error) or change the API to return an error-bearing type (juce::Result/expected) so failures aren’t silent.
try
{
mProcessor.stopAnalysis();
auto const result = mProcessor.runAnalysis(mAccessor, *mAudioFormatReader.get(), inputResults);
if(result)
{
MiscDebug("Track", "analysis launched");
mAccessor.setAttr<AttrType::warnings>(WarningType::none, notification);
startTimer(50);
timerCallback();
}
}
7e15396 to
e569b2c
Compare
No description provided.