Async 1.8.0
AsyncAudioContainer.h
Go to the documentation of this file.
1
31#ifndef ASYNC_AUDIO_CONTAINER_INCLUDED
32#define ASYNC_AUDIO_CONTAINER_INCLUDED
33
34
35/****************************************************************************
36 *
37 * System Includes
38 *
39 ****************************************************************************/
40
41#include <sigc++/sigc++.h>
42
43
44/****************************************************************************
45 *
46 * Project Includes
47 *
48 ****************************************************************************/
49
50#include <AsyncAudioSink.h>
51#include <AsyncFactory.h>
52
53
54/****************************************************************************
55 *
56 * Local Includes
57 *
58 ****************************************************************************/
59
60
61
62/****************************************************************************
63 *
64 * Forward declarations
65 *
66 ****************************************************************************/
67
68
69
70/****************************************************************************
71 *
72 * Namespace
73 *
74 ****************************************************************************/
75
76namespace Async
77{
78
79
80/****************************************************************************
81 *
82 * Forward declarations of classes inside of the declared namespace
83 *
84 ****************************************************************************/
85
86
87
88/****************************************************************************
89 *
90 * Defines & typedefs
91 *
92 ****************************************************************************/
93
94
95
96/****************************************************************************
97 *
98 * Exported Global Variables
99 *
100 ****************************************************************************/
101
102
103
104/****************************************************************************
105 *
106 * Class definitions
107 *
108 ****************************************************************************/
109
136{
137 public:
142
147
152
156 virtual ~AudioContainer(void) {}
157
162 virtual const char* mediaType(void) const = 0;
163
168 virtual const char* filenameExtension(void) const = 0;
169
178 virtual void setRealtime(void) {}
179
188 virtual void endStream(void) { flushSamples(); }
189
198 virtual size_t headerSize(void) const { return 0; }
199
209 virtual const char* header(void) { return nullptr; }
210
220 sigc::signal<void, const char*, size_t> writeBlock;
221}; /* class AudioContainer */
222
223
231
232
242template <class T>
244 : public Async::SpecificFactory<AudioContainer, T>
245{
248};
249
250
256AudioContainer* createAudioContainer(const std::string& name);
257
258
259} /* namespace */
260
261#endif /* ASYNC_AUDIO_CONTAINER_INCLUDED */
262
263/*
264 * This file has not been truncated
265 */
This file contains the base class for an audio sink.
Some templates used to support the creation of an object factory.
virtual void setRealtime(void)
Indicate to the container that realtime operation is desired.
virtual size_t headerSize(void) const
Get the size of the header for this container.
AudioContainer & operator=(const AudioContainer &)=delete
Disable assignment operator.
sigc::signal< void, const char *, size_t > writeBlock
A signal that is emitted when a block is ready to be written.
AudioContainer(void)
Default constructor.
virtual const char * mediaType(void) const =0
Retrieve the media type for the audio container.
virtual ~AudioContainer(void)
Destructor.
virtual const char * header(void)
Get the header data.
virtual const char * filenameExtension(void) const =0
Get the standard filename extension for the audio container.
AudioContainer(const AudioContainer &)=delete
Disable copy constructor.
virtual void endStream(void)
Indicate to the container that the stream has ended.
The base class for an audio sink.
virtual void flushSamples(void)
Tell the sink to flush the previously written samples.
Namespace for the asynchronous programming classes.
Async::Factory< AudioContainer > AudioContainerFactory
Convenience typedef for easier access to the factory members.
AudioContainer * createAudioContainer(const std::string &name)
Create a named AudioContainer-derived object.
Convenience struct to make specific factory instantiation easier.