Async 1.8.0
AsyncAudioDecoder.h
Go to the documentation of this file.
1
27#ifndef ASYNC_AUDIO_DECODER_INCLUDED
28#define ASYNC_AUDIO_DECODER_INCLUDED
29
30
31/****************************************************************************
32 *
33 * System Includes
34 *
35 ****************************************************************************/
36
37#include <string>
38#include <sigc++/sigc++.h>
39
40
41/****************************************************************************
42 *
43 * Project Includes
44 *
45 ****************************************************************************/
46
47#include <AsyncAudioSource.h>
48
49
50/****************************************************************************
51 *
52 * Local Includes
53 *
54 ****************************************************************************/
55
56
57
58/****************************************************************************
59 *
60 * Forward declarations
61 *
62 ****************************************************************************/
63
64
65
66/****************************************************************************
67 *
68 * Namespace
69 *
70 ****************************************************************************/
71
72namespace Async
73{
74
75
76/****************************************************************************
77 *
78 * Forward declarations of classes inside of the declared namespace
79 *
80 ****************************************************************************/
81
82
83
84/****************************************************************************
85 *
86 * Defines & typedefs
87 *
88 ****************************************************************************/
89
90
91
92/****************************************************************************
93 *
94 * Exported Global Variables
95 *
96 ****************************************************************************/
97
98
99
100/****************************************************************************
101 *
102 * Class definitions
103 *
104 ****************************************************************************/
105
113class AudioDecoder : public AudioSource, public sigc::trackable
114{
115 public:
120 static bool isAvailable(const std::string &name);
121
126 static AudioDecoder *create(const std::string &name);
127
132
136 virtual ~AudioDecoder(void) {}
137
142 virtual const char *name(void) const = 0;
143
149 virtual void setOption(const std::string &name, const std::string &value) {}
150
154 virtual void printCodecParams(void) const {}
155
161 virtual void writeEncodedSamples(void *buf, int size) = 0;
162
166 virtual void flushEncodedSamples(void) { sinkFlushSamples(); }
167
175 virtual void resumeOutput(void) {}
176
180 sigc::signal<void> allEncodedSamplesFlushed;
181
182
183 protected:
192
193
194 private:
196 AudioDecoder& operator=(const AudioDecoder&);
197
198}; /* class AudioDecoder */
199
200
201} /* namespace */
202
203#endif /* ASYNC_AUDIO_DECODER_INCLUDED */
204
205
206
207/*
208 * This file has not been truncated
209 */
210
This file contains the base class for an audio source.
Base class for an audio decoder.
virtual const char * name(void) const =0
Get the name of the codec.
virtual void resumeOutput(void)
Resume audio output to the sink.
virtual ~AudioDecoder(void)
Destructor.
static bool isAvailable(const std::string &name)
Check if a specific decoder is available.
AudioDecoder(void)
Default constuctor.
virtual void allSamplesFlushed(void)
The registered sink has flushed all samples.
sigc::signal< void > allEncodedSamplesFlushed
This signal is emitted when all encoded samples have been flushed.
static AudioDecoder * create(const std::string &name)
Create a new decoder of the specified type.
virtual void setOption(const std::string &name, const std::string &value)
Set an option for the decoder.
virtual void printCodecParams(void) const
Print codec parameter settings.
virtual void writeEncodedSamples(void *buf, int size)=0
Write encoded samples into the decoder.
virtual void flushEncodedSamples(void)
Call this function when all encoded samples have been received.
The base class for an audio source.
void sinkFlushSamples(void)
Namespace for the asynchronous programming classes.