Audacity 3.2.0
AsyncPluginValidator.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file AsyncPluginValidator.h
6
7 @author Vitaly Sverchinsky
8
9 Part of lib-module-manager library
10
11**********************************************************************/
12
13#pragma once
14
15#include <chrono>
16#include <memory>
17
18#include <wx/string.h>
19
21
22
31class MODULE_MANAGER_API AsyncPluginValidator final
32{
33 class Impl;
34 std::shared_ptr<Impl> mImpl;
35public:
39 class MODULE_MANAGER_API Delegate
40 {
41 public:
42 virtual ~Delegate();
43
45 virtual void OnPluginFound(const PluginDescriptor& plugin) = 0;
46 virtual void OnPluginValidationFailed(const wxString& providerId, const wxString& path) = 0;
48 virtual void OnValidationFinished() = 0;
50 virtual void OnInternalError(const wxString& msg) = 0;
51 };
52
57
58 explicit AsyncPluginValidator(Delegate& delegate);
60
61 void SetDelegate(Delegate* delegate);
62
63 std::chrono::system_clock::time_point InactiveSince() const noexcept;
64
72 void Validate(const wxString& providerId, const wxString& pluginPath);
73};
Used to talk back to calling side.
virtual void OnValidationFinished()=0
Called when module processing finished.
virtual void OnInternalError(const wxString &msg)=0
Called on error, further processing is not possible.
virtual void OnPluginValidationFailed(const wxString &providerId, const wxString &path)=0
virtual void OnPluginFound(const PluginDescriptor &plugin)=0
Called for each plugin instance found inside module.
Starts and communicates with a dedicated process to perform plugin validation. Once instantiated,...
AsyncPluginValidator & operator=(AsyncPluginValidator &&)=delete
AsyncPluginValidator(AsyncPluginValidator &&)=delete
std::shared_ptr< Impl > mImpl
AsyncPluginValidator(AsyncPluginValidator &)=delete
AsyncPluginValidator & operator=(AsyncPluginValidator &)=delete