MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Depot.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * @file API/Depot.hpp
5 * @brief Audio file loading and container management API
6 *
7 * This header provides the public API for working with IOManager,
8 * container creation, and file type checking within the MayaFlux engine.
9 * It includes:
10 * - `create_container<ContainerType>(args...)`: Template function to create signal source containers.
11 * - `is_audio(filepath)`: Check if a file is an audio file based on its extension.
12 * - `is_image(filepath)`: Check if a file is an image file based on its extension.
13 * - `get_io_manager()`: Access the global IOManager instance for file loading and buffer management.
14 */
15
16namespace MayaFlux {
17
18namespace IO {
19 class IOManager;
20}
21
22namespace Kakshya {
25}
26
27namespace Buffers {
29 class TextureBuffer;
30}
31
32/**
33 * @brief creates a new container of the specified type
34 * @tparam ContainerType Type of container to create (must be derived from SignalSourceContainer)
35 * @tparam Args Constructor argument types
36 * @param args Constructor arguments for the container
37 * @return Shared pointer to the created container
38 */
39template <typename ContainerType, typename... Args>
40 requires std::derived_from<ContainerType, Kakshya::SignalSourceContainer>
41auto create_container(Args&&... args) -> std::shared_ptr<ContainerType>
42{
43 return std::make_shared<ContainerType>(std::forward<Args>(args)...);
44}
45
46/**
47 * @brief Checks if the given file is an audio file based on its extension
48 * @param filepath Path to the file to check
49 * @return true if the file is recognized as an audio file, false otherwise
50 */
51MAYAFLUX_API bool is_audio(const std::filesystem::path& filepath);
52
53/**
54 * @brief Checks if the given file is an image file based on its extension
55 * @param filepath Path to the file to check
56 * @return true if the file is recognized as an image file, false otherwise
57 */
58MAYAFLUX_API bool is_image(const std::filesystem::path& filepath);
59
60/**
61 * @brief Retrieves the global IOManager instance for file loading and buffer management
62 * @return Shared pointer to the IOManager instance
63 *
64 * Provides access to the central IOManager responsible for all file loading operations,
65 * container management, and buffer integration. This is the primary interface for
66 * performing file I/O tasks within the MayaFlux engine.
67 */
68MAYAFLUX_API std::shared_ptr<IO::IOManager> get_io_manager();
69
70}
AudioBuffer implementation backed by a StreamContainer.
A hybrid buffer managing both a textured quad geometry and its pixel data.
Optional orchestration layer for IO reader lifetime and IOService dispatch.
Definition IOManager.hpp:75
Data-driven interface for managing arbitrary processable signal sources.
File-backed audio container with complete streaming functionality.
bool is_image(const fs::path &filepath)
Definition Depot.cpp:14
bool is_audio(const fs::path &filepath)
Definition Depot.cpp:32
auto create_container(Args &&... args) -> std::shared_ptr< ContainerType >
creates a new container of the specified type
Definition Depot.hpp:41
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