Audaspace  1.3.0
A high level audio library.
Static Public Member Functions | List of all members
FileManager Class Reference

The FileManager manages all file input and output plugins. More...

#include <FileManager.h>

Static Public Member Functions

static void registerInput (std::shared_ptr< IFileInput > input)
 Registers a file input used to create an IReader to read from a file. More...
 
static void registerOutput (std::shared_ptr< IFileOutput > output)
 Registers a file output used to create an IWriter to write to a file. More...
 
static std::shared_ptr< IReadercreateReader (std::string filename)
 Creates a file reader for the given filename if a registed IFileInput is able to read it. More...
 
static std::shared_ptr< IReadercreateReader (std::shared_ptr< Buffer > buffer)
 Creates a file reader for the given buffer if a registed IFileInput is able to read it. More...
 
static std::shared_ptr< IWritercreateWriter (std::string filename, DeviceSpecs specs, Container format, Codec codec, unsigned int bitrate)
 Creates a file writer that writes a sound to the given file path. More...
 

Detailed Description

The FileManager manages all file input and output plugins.

Member Function Documentation

◆ createReader() [1/2]

static std::shared_ptr<IReader> FileManager::createReader ( std::string  filename)
static

Creates a file reader for the given filename if a registed IFileInput is able to read it.

Parameters
filenameThe path to the file.
Returns
The reader created.
Exceptions
ExceptionIf 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)
static

Creates a file reader for the given buffer if a registed IFileInput is able to read it.

Parameters
bufferThe buffer to read the file from.
Returns
The reader created.
Exceptions
ExceptionIf no file input can read the file an exception is thrown.

◆ createWriter()

static std::shared_ptr<IWriter> FileManager::createWriter ( 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
filenameThe file path to write to.
specsThe output specification.
formatThe container format for the file.
codecThe codec used inside the container.
bitrateThe bitrate to write with.
Returns
A writer that creates the file.
Exceptions
ExceptionIf no file output can write the file with the given specification an exception is thrown.

◆ 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
inputThe IFileInput to register.

◆ 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
outputThe IFileOutput to register.

The documentation for this class was generated from the following file: