EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
Loading...
Searching...
No Matches
FileChooser.hpp
Go to the documentation of this file.
1
9
10#ifndef ECHOMAP_FILECHOOSER_HPP
11#define ECHOMAP_FILECHOOSER_HPP
12
13#if !defined(__EMSCRIPTEN__) || defined(__DOXYGEN__)
14
15#include <sigc++/slot.h>
16
17#include <filesystem>
18
20#include "../IProjectPanel.hpp"
21#include "FilesystemCombo.hpp"
22
23namespace echomap
24{
25
26class EchoMap;
27
32{
33public:
41 explicit FileChooser(
42 EchoMap* app,
43 RaiseFileChooserNotification::SuccessCallbackT&& success_callback,
44 RaiseFileChooserNotification::CancelledCallbackT&& cancelled_callback
45 );
46
47 void draw() noexcept override;
48
49 [[nodiscard]] const char* get_imgui_name() const noexcept override;
50
51 void change_active_project(const Project* new_project) override;
52
53 static const char* get_imgui_stable_name() noexcept;
54
55private:
56 constexpr static ImVec2 default_modal_size{500.0f, 0.0f};
57
58 std::filesystem::path expected_extension = ".json";
59 std::filesystem::path chosen_path;
60 FilesystemCombo file_combo;
61
62 std::string panel_name;
63 bool is_open = false;
64 EchoMap* app;
65 RaiseFileChooserNotification::SuccessCallbackT success_callback;
66 RaiseFileChooserNotification::CancelledCallbackT cancelled_callback;
67};
68
69} // namespace echomap
70
71#endif // __EMSCRIPTEN__
72
73#endif // ECHOMAP_FILECHOOSER_HPP
FilesystemCombo specification.
IProjectPanel specification.
RaiseFileChooserNotification specification.
The EchoMap maintains state for the application including WebGPU and Dear ImGui context,...
Definition EchoMap.hpp:35
void change_active_project(const Project *new_project) override
Updates the active Project being described by the IPanel.
FileChooser(EchoMap *app, RaiseFileChooserNotification::SuccessCallbackT &&success_callback, RaiseFileChooserNotification::CancelledCallbackT &&cancelled_callback)
Create a new FileChooser modal for the given EchoMap instance.
void draw() noexcept override
Draw the panel to the active rendering context.
const char * get_imgui_name() const noexcept override
Retrieves the name of the IPanel for Dear ImGui API functions.
Provides a platform-independent Dear ImGui combo box for browsing the file-system and selecting files...
An IPanel which can receive updates to the application-wide active Project.
The main EchoMap outermost namespace for all non-exported symbols.