MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Depot.cpp
Go to the documentation of this file.
1#include "Depot.hpp"
3
7
9
10namespace fs = std::filesystem;
11
12namespace MayaFlux {
13
14bool is_image(const fs::path& filepath)
15{
16 if (!fs::exists(filepath) || !fs::is_regular_file(filepath)) {
17 return false;
18 }
19
20 auto ext = filepath.extension().string();
21 std::ranges::transform(ext, ext.begin(),
22 [](unsigned char c) { return std::tolower(c); });
23
24 static const std::unordered_set<std::string> image_extensions = {
25 ".png", ".jpg", ".jpeg", ".bmp", ".tga",
26 ".psd", ".gif", ".hdr", ".pic", ".pnm"
27 };
28
29 return image_extensions.contains(ext);
30}
31
32bool is_audio(const fs::path& filepath)
33{
34 if (!fs::exists(filepath) || !fs::is_regular_file(filepath)) {
35 return false;
36 }
37
38 auto ext = filepath.extension().string();
39 std::ranges::transform(ext, ext.begin(),
40 [](unsigned char c) { return std::tolower(c); });
41
42 static const std::unordered_set<std::string> audio_extensions = {
43 ".wav", ".aiff", ".aif", ".flac", ".ogg",
44 ".mp3", ".m4a", ".wma"
45 };
46
47 return audio_extensions.contains(ext);
48}
49
50std::shared_ptr<IO::IOManager> get_io_manager()
51{
53 return get_context().get_io_manager();
54 }
55
57 "Attempted to access IOManager before engine initialization");
58 return nullptr;
59}
60
61}
#define MF_ERROR(comp, ctx,...)
Core engine lifecycle and configuration API.
Audio file loading and container management API.
std::shared_ptr< IO::IOManager > get_io_manager()
Gets the IO manager.
Definition Engine.hpp:304
@ Runtime
General runtime operations (default fallback)
@ API
MayaFlux/API Wrapper and convenience functions.
bool is_image(const fs::path &filepath)
Definition Depot.cpp:14
bool is_engine_initialized()
Checks if the default audio engine is initialized.
Definition Config.cpp:10
bool is_audio(const fs::path &filepath)
Definition Depot.cpp:32
Core::Engine & get_context()
Gets the default engine instance.
Definition Core.cpp:58
std::shared_ptr< IO::IOManager > get_io_manager()
Retrieves the global IOManager instance for file loading and buffer management.
Definition Depot.cpp:50
Main namespace for the Maya Flux audio engine.
Definition LiveAid.hpp:6