EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
Loading...
Searching...
No Matches
Register VFS Mapping

Queries the user for the location of an externally sourced file. More...

Collaboration diagram for Register VFS Mapping:

Classes

struct  echomap::RegisterVFSMappingNotification
 A notification to indicate a new VFS mapping from an external source. More...

Functions

static void echomap::ActionControllerBase< Derived >::register_vfs_mapping (const std::size_t project_id, const std::filesystem::path &external)
 Invokes the Register VFS Mapping.
EMSCRIPTEN_KEEPALIVE int echomap_on_register_vfs_mapping (const std::size_t project_id, const char *const external, const char *const internal) noexcept
 Services the Register VFS Mapping callback for Emscripten.
static void echomap::JSActionController::register_vfs_mapping_impl (std::size_t project_id, const std::filesystem::path &external)
 Invokes the JS function for Register VFS Mapping.
static void echomap::NativeActionController::register_vfs_mapping_impl (std::size_t project_id, const std::filesystem::path &external)
 Invokes the native function for Register VFS Mapping.

Detailed Description

Queries the user for the location of an externally sourced file.

Function Documentation

◆ echomap_on_register_vfs_mapping()

EMSCRIPTEN_KEEPALIVE int echomap_on_register_vfs_mapping ( const std::size_t project_id,
const char *const external,
const char *const internal )
noexcept

Services the Register VFS Mapping callback for Emscripten.

Parameters
project_idThe ID of the Project that owns the destination Signal.
externalThe path of the external file being mapped into the VFS.
internalThe path of the VFS file.
Returns
Zero status to indicate success; non-zero to indicate failure.

Definition at line 127 of file JSActionController.cpp.

132{
133 using namespace echomap;
134
135 if (external == nullptr || internal == nullptr)
136 return 2;
137
138 try {
140 return 0;
141 } catch (const ConfigurationError& error) {
142 LOG_F_ERROR("Could not load path {} due to error: {}", internal, error.what());
143 return 3;
144 } catch (const std::exception& error) {
145 LOG_F_ERROR("Could not load path {} due to unexpected error: {}", internal, error.what());
146 return 4;
147 } catch (...) {
148 LOG_F_ERROR("Could not load path {} due to unknown error.", internal);
149 return 5;
150 }
151}
#define LOG_F_ERROR(msg,...)
Logs a formatted error-level message using echomap::Logger::log_f.
Definition Logger.hpp:125
A ConfigurationError indicates an error encountered during the initial configuration of the EchoMap g...
The main EchoMap outermost namespace for all non-exported symbols.
T what(T... args)

◆ register_vfs_mapping()

template<typename Derived>
void echomap::ActionControllerBase< Derived >::register_vfs_mapping ( const std::size_t project_id,
const std::filesystem::path & external )
inlinestatic

Invokes the Register VFS Mapping.

Parameters
project_idThe ID of the Project that owns the destination Signal.
externalThe path of the external file being mapped into the VFS.

Definition at line 106 of file ActionControllerBase.hpp.

110 {
112 }
Provides a platform-independent static mechanism for performing "system actions", such as raising a f...

◆ register_vfs_mapping_impl() [1/2]

void echomap::JSActionController::register_vfs_mapping_impl ( std::size_t project_id,
const std::filesystem::path & external )
staticprivate

Invokes the JS function for Register VFS Mapping.

Parameters
project_idThe ID of the Project that owns the destination Signal.
externalThe path of the external file being mapped into the VFS.

Definition at line 74 of file JSActionController.cpp.

78{
79 js::register_vfs_mapping(project_id, external.c_str());
80}

◆ register_vfs_mapping_impl() [2/2]

void echomap::NativeActionController::register_vfs_mapping_impl ( std::size_t project_id,
const std::filesystem::path & external )
staticprivate

Invokes the native function for Register VFS Mapping.

Parameters
project_idThe ID of the Project that owns the destination Signal.
externalThe path of the external file being mapped into the VFS.

Definition at line 25 of file NativeActionController.cpp.

29{
30 std::ignore = project_id;
31 std::ignore = external;
32
33 throw std::runtime_error(
34 "The NativeActionController received a request to query for VFS mappings, which are not applicable on the "
35 "native platform."
36 );
37}