The FileManager manages all file input and output plugins.
More...
#include <FileManager.h>
The FileManager manages all file input and output plugins.
◆ createReader() [1/2]
static std::shared_ptr< IReader > FileManager::createReader |
( |
const std::string & | filename, |
|
|
int | stream = 0 ) |
|
static |
Creates a file reader for the given filename if a registed IFileInput is able to read it.
- Parameters
-
filename | The path to the file. |
stream | The index of the audio stream within the file if it contains multiple audio streams. |
- Returns
- The reader created.
- Exceptions
-
Exception | If no file input can read the file an exception is thrown. |
◆ createReader() [2/2]
static std::shared_ptr< IReader > FileManager::createReader |
( |
std::shared_ptr< Buffer > | buffer, |
|
|
int | stream = 0 ) |
|
static |
Creates a file reader for the given buffer if a registed IFileInput is able to read it.
- Parameters
-
buffer | The buffer to read the file from. |
stream | The index of the audio stream within the file if it contains multiple audio streams. |
- Returns
- The reader created.
- Exceptions
-
Exception | If no file input can read the file an exception is thrown. |
◆ createWriter()
static std::shared_ptr< IWriter > FileManager::createWriter |
( |
const std::string & | filename, |
|
|
DeviceSpecs | specs, |
|
|
Container | format, |
|
|
Codec | codec, |
|
|
unsigned int | bitrate ) |
|
static |
Creates a file writer that writes a sound to the given file path.
Existing files will be overwritten.
- Parameters
-
filename | The file path to write to. |
specs | The output specification. |
format | The container format for the file. |
codec | The codec used inside the container. |
bitrate | The bitrate to write with. |
- Returns
- A writer that creates the file.
- Exceptions
-
Exception | If no file output can write the file with the given specification an exception is thrown. |
◆ queryStreams() [1/2]
static std::vector< StreamInfo > FileManager::queryStreams |
( |
const std::string & | filename | ) |
|
|
static |
Queries the streams of a sound file.
- Parameters
-
filename | Path to the file to be read. |
- Returns
- A vector with as many streams as there are in the file.
- Exceptions
-
Exception | Thrown if the file specified cannot be read. |
◆ queryStreams() [2/2]
static std::vector< StreamInfo > FileManager::queryStreams |
( |
std::shared_ptr< Buffer > | buffer | ) |
|
|
static |
Queries the streams of a sound file.
- Parameters
-
buffer | The in-memory file buffer. |
- Returns
- A vector with as many streams as there are in the file.
- Exceptions
-
Exception | Thrown if the file specified cannot be read. |
◆ registerInput()
static void FileManager::registerInput |
( |
std::shared_ptr< IFileInput > | input | ) |
|
|
static |
Registers a file input used to create an IReader to read from a file.
- Parameters
-
◆ registerOutput()
static void FileManager::registerOutput |
( |
std::shared_ptr< IFileOutput > | output | ) |
|
|
static |
Registers a file output used to create an IWriter to write to a file.
- Parameters
-
The documentation for this class was generated from the following file: