Audacity 3.2.0
|
#include <PluginStartupRegistration.h>
Public Member Functions | |
PluginStartupRegistration (const std::map< wxString, std::vector< wxString > > &pluginsToProcess) | |
void | Run (std::chrono::seconds timeout=std::chrono::seconds(30)) |
const std::vector< wxString > & | GetFailedPluginsPaths () const noexcept |
Returns list of paths of plugins that didn't pass validation for some reason. More... | |
void | OnInternalError (const wxString &error) override |
Called on error, further processing is not possible. More... | |
void | OnPluginFound (const PluginDescriptor &desc) override |
Called for each plugin instance found inside module. More... | |
void | OnPluginValidationFailed (const wxString &providerId, const wxString &path) override |
void | OnValidationFinished () override |
Called when module processing finished. More... | |
Public Member Functions inherited from AsyncPluginValidator::Delegate | |
virtual | ~Delegate () |
virtual void | OnPluginFound (const PluginDescriptor &plugin)=0 |
Called for each plugin instance found inside module. More... | |
virtual void | OnPluginValidationFailed (const wxString &providerId, const wxString &path)=0 |
virtual void | OnValidationFinished ()=0 |
Called when module processing finished. More... | |
virtual void | OnInternalError (const wxString &msg)=0 |
Called on error, further processing is not possible. More... | |
Private Member Functions | |
void | Stop () |
void | Skip () |
void | StopWithError (const wxString &msg) |
void | ProcessNext () |
Private Attributes | |
std::unique_ptr< AsyncPluginValidator > | mValidator |
std::vector< std::pair< wxString, std::vector< wxString > > > | mPluginsToProcess |
size_t | mCurrentPluginIndex {0} |
size_t | mCurrentPluginProviderIndex {0} |
bool | mValidProviderFound {false} |
std::vector< wxString > | mFailedPluginsPaths |
std::vector< PluginDescriptor > | mFailedPluginsCache |
wxWeakRef< wxDialogWrapper > | mScanDialog |
wxWeakRef< wxTimer > | mTimeoutTimer |
std::chrono::system_clock::duration | mTimeout {} |
std::chrono::system_clock::time_point | mRequestStartTime {} |
Helper class that passes plugins provided in constructor to plugin validator, then "good" plugins are registered in PluginManager.
Definition at line 25 of file PluginStartupRegistration.h.
PluginStartupRegistration::PluginStartupRegistration | ( | const std::map< wxString, std::vector< wxString > > & | pluginsToProcess | ) |
Definition at line 130 of file PluginStartupRegistration.cpp.
References mPluginsToProcess.
|
noexcept |
Returns list of paths of plugins that didn't pass validation for some reason.
Definition at line 205 of file PluginStartupRegistration.cpp.
References mFailedPluginsPaths.
|
overridevirtual |
Called on error, further processing is not possible.
Implements AsyncPluginValidator::Delegate.
Definition at line 136 of file PluginStartupRegistration.cpp.
References StopWithError().
|
overridevirtual |
Called for each plugin instance found inside module.
Implements AsyncPluginValidator::Delegate.
Definition at line 141 of file PluginStartupRegistration.cpp.
References anonymous_namespace{ExportPCM.cpp}::desc, PluginManager::Get(), mFailedPluginsCache, mValidProviderFound, and PluginManager::RegisterPlugin().
|
overridevirtual |
Implements AsyncPluginValidator::Delegate.
Definition at line 152 of file PluginStartupRegistration.cpp.
References mFailedPluginsCache, PluginTypeStub, PluginDescriptor::SetEnabled(), PluginDescriptor::SetID(), PluginDescriptor::SetPath(), PluginDescriptor::SetPluginType(), PluginDescriptor::SetProviderID(), PluginDescriptor::SetValid(), and wxT().
Referenced by Skip().
|
overridevirtual |
Called when module processing finished.
Implements AsyncPluginValidator::Delegate.
Definition at line 169 of file PluginStartupRegistration.cpp.
References anonymous_namespace{ExportPCM.cpp}::desc, PluginManager::Get(), mCurrentPluginIndex, mCurrentPluginProviderIndex, mFailedPluginsCache, mFailedPluginsPaths, mPluginsToProcess, mValidProviderFound, PluginTypeStub, ProcessNext(), and PluginManager::RegisterPlugin().
Referenced by Skip().
|
private |
Definition at line 289 of file PluginStartupRegistration.cpp.
References mCurrentPluginIndex, mCurrentPluginProviderIndex, mPluginsToProcess, mRequestStartTime, mScanDialog, mTimeout, mTimeoutTimer, mValidator, Stop(), and StopWithError().
Referenced by OnValidationFinished(), and Run().
void PluginStartupRegistration::Run | ( | std::chrono::seconds | timeout = std::chrono::seconds(30) | ) |
Starts validation, showing dialog that blocks execution until process is complete or canceled
timeout | Time allowed to spend on a single plugin validation. Pass 0 to disable timeout. |
Definition at line 210 of file PluginStartupRegistration.cpp.
References PluginManager::Get(), mScanDialog, mTimeout, mTimeoutTimer, mValidator, PluginManager::NotifyPluginsChanged(), anonymous_namespace{PluginStartupRegistration.cpp}::OnPluginScanTimeout, ProcessNext(), PluginManager::Save(), Skip(), and XO().
|
private |
Definition at line 252 of file PluginStartupRegistration.cpp.
References mCurrentPluginIndex, mCurrentPluginProviderIndex, mPluginsToProcess, mValidator, mValidProviderFound, OnPluginValidationFailed(), and OnValidationFinished().
Referenced by Run().
|
private |
Definition at line 246 of file PluginStartupRegistration.cpp.
References mScanDialog.
Referenced by ProcessNext(), and StopWithError().
|
private |
Definition at line 282 of file PluginStartupRegistration.cpp.
References Stop().
Referenced by OnInternalError(), and ProcessNext().
|
private |
Definition at line 30 of file PluginStartupRegistration.h.
Referenced by OnValidationFinished(), ProcessNext(), and Skip().
|
private |
Definition at line 31 of file PluginStartupRegistration.h.
Referenced by OnValidationFinished(), ProcessNext(), and Skip().
|
private |
Definition at line 34 of file PluginStartupRegistration.h.
Referenced by OnPluginFound(), OnPluginValidationFailed(), and OnValidationFinished().
|
private |
Definition at line 33 of file PluginStartupRegistration.h.
Referenced by GetFailedPluginsPaths(), and OnValidationFinished().
|
private |
Definition at line 29 of file PluginStartupRegistration.h.
Referenced by OnValidationFinished(), PluginStartupRegistration(), ProcessNext(), and Skip().
|
private |
Definition at line 38 of file PluginStartupRegistration.h.
Referenced by ProcessNext().
|
private |
Definition at line 35 of file PluginStartupRegistration.h.
Referenced by ProcessNext(), Run(), and Stop().
|
private |
Definition at line 37 of file PluginStartupRegistration.h.
Referenced by ProcessNext(), and Run().
|
private |
Definition at line 36 of file PluginStartupRegistration.h.
Referenced by ProcessNext(), and Run().
|
private |
Definition at line 28 of file PluginStartupRegistration.h.
Referenced by ProcessNext(), Run(), and Skip().
|
private |
Definition at line 32 of file PluginStartupRegistration.h.
Referenced by OnPluginFound(), OnValidationFinished(), and Skip().