EchoMap
2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
Toggle main menu visibility
Loading...
Searching...
No Matches
AllNotificationsFwd.hpp
Go to the documentation of this file.
1
9
10
#ifndef ECHOMAP_ALLNOTIFICATIONSFWD_HPP
11
#define ECHOMAP_ALLNOTIFICATIONSFWD_HPP
12
13
#include "
../utility/VariantHelpers.hpp
"
14
15
namespace
echomap
16
{
17
18
struct
AddChannelMappingNotification
;
19
struct
ModifySensorColourNotification
;
20
struct
ModifySensorPositionNotification
;
21
struct
ProjectSelectionCompleteNotification
;
22
struct
ClearErrorNotification
;
23
24
#if !defined(__EMSCRIPTEN__) || defined(__DOXYGEN__)
25
26
// Native-only notifications.
27
28
struct
RaiseFileChooserNotification
;
29
30
#endif
// __EMSCRIPTEN__
31
32
#if defined(__EMSCRIPTEN__) || defined(__DOXYGEN__)
33
34
// Web-only notifications.
35
36
struct
CancelProjectLoadNotification
;
37
struct
CompleteProjectLoadNotification
;
38
struct
RegisterVFSMappingNotification
;
39
40
#endif
// __EMSCRIPTEN__
41
46
70
using
Notification
=
std::variant
<
71
AddChannelMappingNotification
,
72
ModifySensorColourNotification
,
73
ModifySensorPositionNotification
,
74
ProjectSelectionCompleteNotification
,
75
ClearErrorNotification
76
#if !defined(__EMSCRIPTEN__) || defined(__DOXYGEN__)
77
// Native-only notifications.
78
,
79
RaiseFileChooserNotification
80
#endif
// __EMSCRIPTEN__
81
#if defined(__EMSCRIPTEN__) || defined(__DOXYGEN__)
82
// Web-only notifications.
83
,
84
RegisterVFSMappingNotification
,
85
CompleteProjectLoadNotification
,
86
CancelProjectLoadNotification
87
#endif
// __EMSCRIPTEN__
88
>;
89
95
struct
NotificationNames
96
{
102
template
<
typename
NotificationT>
103
requires
variant_helpers::VariantAlternative
<
104
NotificationT,
105
Notification
>
106
static
constexpr
std::string_view
get
()
107
{
108
// ReSharper disable once CppStaticAssertFailure
109
static_assert
(
false
,
"Missing notification name."
);
110
return
{};
111
}
112
116
static
const
std::array<std::string_view, std::variant_size_v<Notification>
>
indexed_names
;
117
};
118
119
template
<>
constexpr
std::string_view
NotificationNames::get<AddChannelMappingNotification>
()
120
{
121
return
"Add Channel Mapping Notification"
;
122
}
123
124
template
<>
constexpr
std::string_view
NotificationNames::get<ModifySensorColourNotification>
()
125
{
126
return
"Modify Sensor Colour Notification"
;
127
}
128
129
template
<>
constexpr
std::string_view
NotificationNames::get<ModifySensorPositionNotification>
()
130
{
131
return
"Modify Sensor Position Notification"
;
132
}
133
134
template
<>
constexpr
std::string_view
NotificationNames::get<ProjectSelectionCompleteNotification>
()
135
{
136
return
"Project Selected Notification"
;
137
}
138
139
template
<>
constexpr
std::string_view
NotificationNames::get<ClearErrorNotification>
()
140
{
141
return
"Clear Error State Notification"
;
142
}
143
144
#if !defined(__EMSCRIPTEN__) || defined(__DOXYGEN__)
145
146
// Names of native-only notifications.
147
148
template
<>
constexpr
std::string_view
NotificationNames::get<RaiseFileChooserNotification>
()
149
{
150
return
"Raise File Chooser Notification"
;
151
}
152
153
#endif
// __EMSCRIPTEN__
154
155
#if defined(__EMSCRIPTEN__) || defined(__DOXYGEN__)
156
157
// Names of web-only notifications.
158
159
template
<>
constexpr
std::string_view
NotificationNames::get<CancelProjectLoadNotification>
()
160
{
161
return
"Cancel Project Load Notification"
;
162
}
163
164
template
<>
constexpr
std::string_view
NotificationNames::get<CompleteProjectLoadNotification>
()
165
{
166
return
"Complete Project Load Notification"
;
167
}
168
169
template
<>
constexpr
std::string_view
NotificationNames::get<RegisterVFSMappingNotification>
()
170
{
171
return
"Register VFS Mapping Notification"
;
172
}
173
174
#endif
// __EMSCRIPTEN__
175
176
constexpr
std::array<std::string_view, std::variant_size_v<Notification>>
NotificationNames::indexed_names
=
177
variant_helpers::variant_name_array<Notification, NotificationNames>
;
178
179
}
// namespace echomap
180
181
#endif
// ECHOMAP_ALLNOTIFICATIONSFWD_HPP
VariantHelpers.hpp
VariantHelpers specification.
echomap::variant_helpers::variant_name_array
constexpr auto variant_name_array
Array of human-readable names for every alternative in a variant.
Definition
VariantHelpers.hpp:157
std::array
std::string_view
echomap::variant_helpers::VariantAlternative
Constrains a type to be one of the alternatives of a std::variant.
Definition
VariantHelpers.hpp:67
echomap::Notification
std::variant< AddChannelMappingNotification, ModifySensorColourNotification, ModifySensorPositionNotification, ProjectSelectionCompleteNotification, ClearErrorNotification, RaiseFileChooserNotification, RegisterVFSMappingNotification, CompleteProjectLoadNotification, CancelProjectLoadNotification > Notification
A Notification is a trivial message sent exclusively to the EchoMap controller.
Definition
AllNotificationsFwd.hpp:70
echomap
The main EchoMap outermost namespace for all non-exported symbols.
Definition
ActionController.hpp:20
echomap::AddChannelMappingNotification
A notification indicating that a new channel mapping should be established.
Definition
AddChannelMappingNotification.hpp:26
echomap::CancelProjectLoadNotification
A notification indicating that a pending Project load should be cancelled.
Definition
CancelProjectLoadNotification.hpp:26
echomap::ClearErrorNotification
A notification indicating that any error state visible to the user should be reset.
Definition
ClearErrorNotification.hpp:20
echomap::CompleteProjectLoadNotification
A notification indicating that a pending Project is ready to be loaded.
Definition
CompleteProjectLoadNotification.hpp:31
echomap::ModifySensorColourNotification
A notification indicating that the colour of a Sensor should be changed.
Definition
ModifySensorColourNotification.hpp:29
echomap::ModifySensorPositionNotification
A notification indicating that the position of a Sensor should be changed.
Definition
ModifySensorPositionNotification.hpp:29
echomap::NotificationNames
Helper to retrieve names of Notification variant alternatives.
Definition
AllNotificationsFwd.hpp:96
echomap::NotificationNames::get
static constexpr std::string_view get()
Retrieve a human-readable name for the templated Notification.
Definition
AllNotificationsFwd.hpp:106
echomap::NotificationNames::indexed_names
static const std::array< std::string_view, std::variant_size_v< Notification > > indexed_names
Aggregated names by the index of the alternative.
Definition
AllNotificationsFwd.hpp:116
echomap::ProjectSelectionCompleteNotification
A notification indicating that a new Project file has been selected by the user, or the load operatio...
Definition
ProjectSelectionCompleteNotification.hpp:28
echomap::RaiseFileChooserNotification
A notification indicating that the NativeFileChooser should be raised to prompt for a new Project.
Definition
RaiseFileChooserNotification.hpp:30
echomap::RegisterVFSMappingNotification
A notification to indicate a new VFS mapping from an external source.
Definition
RegisterVFSMappingNotification.hpp:33
std::variant
src
notifications
AllNotificationsFwd.hpp
Generated by
1.17.0