Audaspace  1.6.0
A high level audio library.
FileManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright 2009-2016 Jörg Müller
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  ******************************************************************************/
16 
17 #pragma once
18 
25 #include "FileInfo.h"
26 #include "respec/Specification.h"
27 #include "IWriter.h"
28 
29 #include <list>
30 #include <memory>
31 #include <string>
32 #include <vector>
33 
35 
36 class IFileInput;
37 class IFileOutput;
38 class IReader;
39 class Buffer;
40 
45 {
46 private:
47  static std::list<std::shared_ptr<IFileInput>>& inputs();
48  static std::list<std::shared_ptr<IFileOutput>>& outputs();
49 
50  // delete copy constructor and operator=
51  FileManager(const FileManager&) = delete;
52  FileManager& operator=(const FileManager&) = delete;
53  FileManager() = delete;
54 
55 public:
60  static void registerInput(std::shared_ptr<IFileInput> input);
61 
66  static void registerOutput(std::shared_ptr<IFileOutput> output);
67 
75  static std::shared_ptr<IReader> createReader(const std::string &filename, int stream = 0);
76 
84  static std::shared_ptr<IReader> createReader(std::shared_ptr<Buffer> buffer, int stream = 0);
85 
92  static std::vector<StreamInfo> queryStreams(const std::string &filename);
93 
100  static std::vector<StreamInfo> queryStreams(std::shared_ptr<Buffer> buffer);
101 
113  static std::shared_ptr<IWriter> createWriter(const std::string &filename, DeviceSpecs specs, Container format, Codec codec, unsigned int bitrate);
114 };
115 
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition: Audaspace.h:116
This class represents a sound source as stream or as buffer which can be read for example by another ...
Definition: IReader.h:34
The IFileInput interface represents a file input plugin that can create file input readers from filen...
Definition: IFileInput.h:42
#define AUD_API
Used for exporting symbols in the shared library.
Definition: Audaspace.h:93
Defines all important macros and basic data structures for stream format descriptions.
The FileManager manages all file input and output plugins.
Definition: FileManager.h:44
This class is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality...
Definition: Buffer.h:33
Specification of a sound device.
Definition: Specification.h:128
The FileInfo data structures.
Codec
Audio codecs for writers.
Definition: IWriter.h:44
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition: Audaspace.h:119
Container
Container formats for writers.
Definition: IWriter.h:30
The IFileOutput interface represents a file output plugin that can write files.
Definition: IFileOutput.h:37
Defines the IWriter interface as well as Container and Codec types.