Registry of audio format readers and writers. More...
#include <format_registry.hpp>
Public Member Functions | |
| void | register_reader (std::unique_ptr< FormatReader > reader) |
| Register a custom reader. | |
| void | register_writer (std::unique_ptr< FormatWriter > writer) |
| Register a custom writer. | |
| FormatReader * | find_reader (std::string_view extension) const |
| Find a reader for the given file extension. | |
| FormatWriter * | find_writer (std::string_view extension) const |
| Find a writer for the given file extension. | |
| std::optional< AudioFileInfo > | read_info (const std::string &path) const |
| Read any supported audio file (dispatches to the right reader). | |
| std::optional< AudioFileData > | read (const std::string &path) const |
| std::optional< AudioFileData > | read (const std::string &path, const DecodeLimits &limits) const |
| Read with explicit decode ceilings. | |
| bool | write (const std::string &path, const AudioFileData &data) const |
| Write audio data (dispatches to the right writer based on extension). | |
| std::vector< std::string > | supported_read_extensions () const |
| List all supported read extensions. | |
| std::vector< std::string > | supported_write_extensions () const |
| List all supported write extensions. | |
Static Public Member Functions | |
| static FormatRegistry & | instance () |
| Get the global singleton registry (pre-populated with built-in formats). | |
Registry of audio format readers and writers.
| FormatReader * pulp::audio::FormatRegistry::find_reader | ( | std::string_view | extension | ) | const |
Find a reader for the given file extension.
| FormatWriter * pulp::audio::FormatRegistry::find_writer | ( | std::string_view | extension | ) | const |
Find a writer for the given file extension.
|
static |
Get the global singleton registry (pre-populated with built-in formats).
| std::optional< AudioFileData > pulp::audio::FormatRegistry::read | ( | const std::string & | path | ) | const |
| std::optional< AudioFileData > pulp::audio::FormatRegistry::read | ( | const std::string & | path, |
| const DecodeLimits & | limits ) const |
Read with explicit decode ceilings.
Every built-in reader refuses a file whose header or decoded output would exceed them; a custom reader registered without a limits overload reads unbounded.
| std::optional< AudioFileInfo > pulp::audio::FormatRegistry::read_info | ( | const std::string & | path | ) | const |
Read any supported audio file (dispatches to the right reader).
| void pulp::audio::FormatRegistry::register_reader | ( | std::unique_ptr< FormatReader > | reader | ) |
Register a custom reader.
| void pulp::audio::FormatRegistry::register_writer | ( | std::unique_ptr< FormatWriter > | writer | ) |
Register a custom writer.
| std::vector< std::string > pulp::audio::FormatRegistry::supported_read_extensions | ( | ) | const |
List all supported read extensions.
| std::vector< std::string > pulp::audio::FormatRegistry::supported_write_extensions | ( | ) | const |
List all supported write extensions.
| bool pulp::audio::FormatRegistry::write | ( | const std::string & | path, |
| const AudioFileData & | data ) const |
Write audio data (dispatches to the right writer based on extension).