forked from stuerp/foo_uie_webview
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathConfiguration.h
More file actions
95 lines (74 loc) · 2.77 KB
/
Configuration.h
File metadata and controls
95 lines (74 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/** Configuration.h: Copyright (c) P. Stuer, J. Cassis **/
#pragma once
enum WindowSizeUnit : uint32_t
{
Milliseconds = 0,
Samples,
Count,
};
enum ClearOnStartup : uint32_t
{
None = 0,
BrowsingHistory,
DownloadHistory,
Cookies,
Cache,
Passwords,
Autofill,
SitePermissions,
All = (uint32_t)~0,
};
enum ScrollbarStyle : uint32_t
{
Default = 0,
Fluent,
};
enum Permission : uint64_t
{
ReadFiles = 1,
ReadDirectories = 2,
ExecuteShellOperations = 4,
};
inline Permission operator|(Permission a, Permission b)
{
return static_cast<Permission>(static_cast<int>(a) | static_cast<int>(b));
}
inline Permission& operator|=(Permission& a, Permission b)
{
return a = a | b;
}
/// <summary>
/// Represents the configuration of the component.
/// </summary>
class configuration_t
{
public:
configuration_t();
configuration_t(const configuration_t&) = default;
configuration_t& operator=(const configuration_t&) = default;
configuration_t(configuration_t&&) = default;
configuration_t& operator=(configuration_t&&) = default;
virtual ~configuration_t() {}
void Reset() noexcept;
void Read(stream_reader* reader, size_t size, abort_callback& abortHandler = fb2k::noAbort, bool isPreset = false) noexcept;
void Write(stream_writer* writer, abort_callback& abortHandler = fb2k::noAbort, bool isPreset = false) const noexcept;
std::wstring _Name;
std::wstring _TemplateFilePath;
std::wstring _UserDataFolderPath;
std::wstring _BrowserFlags; // Browser flags (https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/webview-features-flags?tabs=win32cpp)
std::wstring _HostObjectModule; // Module to load as host objet.
std::wstring _HostObjectExport; // Export function name to use to load COM interface.
uint32_t _WindowSize; // Milliseconds or samples.
WindowSizeUnit _WindowSizeUnit;
double _ReactionAlignment; // Like in Vizzy.io. Controls the delay between the actual playback and the visualization.
// < 0: All samples are ahead the actual playback (with the first sample equal to the actual playback)
// 0: The first half of samples are behind the actual playback and the second half are ahead of it (just like original foo_musical_spectrum and basically any get_spectrum_absolute() visualizations
// > 0: All samples are behind the playback (similar to VST audio analyzer plugins like Voxengo SPAN) with the last sample equal to the actual playback.
std::wstring _ProfileName;
ClearOnStartup _ClearOnStartup;
bool _InPrivateMode;
ScrollbarStyle _ScrollbarStyle;
Permission _Permissions;
private:
static constexpr int32_t _CurrentVersion = 10;
};