Audacity 3.2.0
PluginStartupRegistration.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file PluginStartupRegistration.h
6
7 @author Vitaly Sverchinsky
8
9**********************************************************************/
10
11#pragma once
12
13#include <vector>
14#include <map>
15#include <memory>
16#include <chrono>
17#include <wx/string.h>
18#include <wx/timer.h>
20#include "wxPanelWrapper.h"
21
27{
28 std::unique_ptr<AsyncPluginValidator> mValidator;
29 std::vector<std::pair<wxString, std::vector<wxString>>> mPluginsToProcess;
33 std::vector<wxString> mFailedPluginsPaths;
34 std::vector<PluginDescriptor> mFailedPluginsCache;
35 wxWeakRef<wxDialogWrapper> mScanDialog;
36 wxWeakRef<wxTimer> mTimeoutTimer;
37 std::chrono::system_clock::duration mTimeout{};
38 std::chrono::system_clock::time_point mRequestStartTime{};
39public:
40
41 PluginStartupRegistration(const std::map<wxString, std::vector<wxString>>& pluginsToProcess);
42
47 void Run(std::chrono::seconds timeout = std::chrono::seconds(30));
48
50 const std::vector<wxString>& GetFailedPluginsPaths() const noexcept;
51
52 void OnInternalError(const wxString& error) override;
53 void OnPluginFound(const PluginDescriptor& desc) override;
54 void OnPluginValidationFailed(const wxString& providerId, const wxString& path) override;
55 void OnValidationFinished() override;
56
57private:
58
59 void Stop();
60 void Skip();
61 void StopWithError(const wxString& msg);
62 void ProcessNext();
63};
Used to talk back to calling side.
void OnInternalError(const wxString &error) override
Called on error, further processing is not possible.
void Run(std::chrono::seconds timeout=std::chrono::seconds(30))
std::unique_ptr< AsyncPluginValidator > mValidator
void OnValidationFinished() override
Called when module processing finished.
std::vector< PluginDescriptor > mFailedPluginsCache
wxWeakRef< wxDialogWrapper > mScanDialog
void OnPluginFound(const PluginDescriptor &desc) override
Called for each plugin instance found inside module.
std::chrono::system_clock::time_point mRequestStartTime
void StopWithError(const wxString &msg)
std::vector< wxString > mFailedPluginsPaths
void OnPluginValidationFailed(const wxString &providerId, const wxString &path) override
const std::vector< wxString > & GetFailedPluginsPaths() const noexcept
Returns list of paths of plugins that didn't pass validation for some reason.
std::vector< std::pair< wxString, std::vector< wxString > > > mPluginsToProcess
PluginStartupRegistration(const std::map< wxString, std::vector< wxString > > &pluginsToProcess)
std::chrono::system_clock::duration mTimeout
const TranslatableString desc
Definition: ExportPCM.cpp:51