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
EchoMapNative.cpp
Go to the documentation of this file.
1
9
10
#if !defined(__EMSCRIPTEN__) || defined(__DOXYGEN__)
11
12
#include "
EchoMapNative.hpp
"
13
14
#include "
../notifications/AllNotifications.hpp
"
15
#include "
../panels/native/FileChooser.hpp
"
16
#include "
../utility/Logger.hpp
"
17
18
namespace
echomap
19
{
20
21
void
EchoMapNative::run_event_loop
()
22
{
23
render
();
24
instance.ProcessEvents();
25
26
while
(glfwWindowShouldClose(window) == 0) {
27
if
(forced_frames > 0) {
28
glfwPollEvents();
29
--forced_frames;
30
}
else
31
glfwWaitEvents();
32
33
render
();
34
instance.ProcessEvents();
35
}
36
}
37
38
void
EchoMapNative::visit_notification
(
39
Notification
& notification
40
)
41
{
42
std::visit
(
43
// clang-format off
44
45
variant_helpers::Overloaded
{
46
make_common_notification_visitors
(),
47
[
this
](
RaiseFileChooserNotification
& n) { handle_notification(n); },
48
},
49
50
// clang-format on
51
notification
52
);
53
}
54
55
void
EchoMapNative::handle_notification(
56
RaiseFileChooserNotification
& notification
57
)
58
{
59
if
(
active_modal
!=
nullptr
) {
60
LOG_WARN
(
"Ignoring request to raise file chooser since there is an active modal."
);
61
return
;
62
}
63
64
active_modal
=
std::make_unique<FileChooser>
(
65
this
,
66
std::move(notification.success_callback),
67
std::move(notification.cancelled_callback)
68
);
69
}
70
71
}
// namespace echomap
72
73
#endif
// __EMSCRIPTEN__
AllNotifications.hpp
AllNotifications specification.
EchoMapNative.hpp
EchoMapNative specification.
FileChooser.hpp
FileChooser specification.
Logger.hpp
EchoMap portable logger specification.
LOG_WARN
#define LOG_WARN(msg)
Logs an unformatted warning-level message using echomap::Logger::log.
Definition
Logger.hpp:162
echomap::EchoMapNative::run_event_loop
void run_event_loop() override
Runs the platform-dependent event loop to manage and propagate interaction with the EchoMap applicati...
Definition
EchoMapNative.cpp:21
echomap::EchoMapNative::visit_notification
void visit_notification(Notification ¬ification) override
Uses std::visit on the given notification to invoke the corresponding handler.
Definition
EchoMapNative.cpp:38
echomap::EchoMap::render
void render() noexcept
Perform a render cycle on the configured Surface and Device.
Definition
EchoMap.cpp:256
echomap::EchoMap::active_modal
std::unique_ptr< IPanel > active_modal
The current active non-ErrorModal modal panel.
Definition
EchoMap.hpp:246
echomap::EchoMap::make_common_notification_visitors
auto make_common_notification_visitors()
Produce an overload set for std::visit for all platform-independent Notification objects.
Definition
EchoMap.hpp:94
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
std::make_unique
T make_unique(T... args)
echomap
The main EchoMap outermost namespace for all non-exported symbols.
Definition
ActionController.hpp:20
echomap::RaiseFileChooserNotification
A notification indicating that the NativeFileChooser should be raised to prompt for a new Project.
Definition
RaiseFileChooserNotification.hpp:30
echomap::variant_helpers::Overloaded
A helper type for succinctly specifying callable visitors over a variant alternative.
Definition
VariantHelpers.hpp:91
std::visit
T visit(T... args)
src
platform
EchoMapNative.cpp
Generated by
1.17.0