EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
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
16#include "../utility/Logger.hpp"
17
18namespace echomap
19{
20
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
39 Notification& notification
40)
41{
43 // clang-format off
44
47 [this](RaiseFileChooserNotification& n) { handle_notification(n); },
48 },
49
50 // clang-format on
51 notification
52 );
53}
54
55void EchoMapNative::handle_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
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 specification.
EchoMapNative specification.
FileChooser specification.
EchoMap portable logger specification.
#define LOG_WARN(msg)
Logs an unformatted warning-level message using echomap::Logger::log.
Definition Logger.hpp:162
void run_event_loop() override
Runs the platform-dependent event loop to manage and propagate interaction with the EchoMap applicati...
void visit_notification(Notification &notification) override
Uses std::visit on the given notification to invoke the corresponding handler.
void render() noexcept
Perform a render cycle on the configured Surface and Device.
Definition EchoMap.cpp:256
std::unique_ptr< IPanel > active_modal
The current active non-ErrorModal modal panel.
Definition EchoMap.hpp:246
auto make_common_notification_visitors()
Produce an overload set for std::visit for all platform-independent Notification objects.
Definition EchoMap.hpp:94
std::variant< AddChannelMappingNotification, ModifySensorColourNotification, ModifySensorPositionNotification, ProjectSelectionCompleteNotification, ClearErrorNotification, RaiseFileChooserNotification, RegisterVFSMappingNotification, CompleteProjectLoadNotification, CancelProjectLoadNotification > Notification
A Notification is a trivial message sent exclusively to the EchoMap controller.
T make_unique(T... args)
The main EchoMap outermost namespace for all non-exported symbols.
A notification indicating that the NativeFileChooser should be raised to prompt for a new Project.
A helper type for succinctly specifying callable visitors over a variant alternative.
T visit(T... args)