Async  1.5.0
AsyncAudioEncoder.h
Go to the documentation of this file.
1 
27 #ifndef ASYNC_AUDIO_ENCODER_INCLUDED
28 #define ASYNC_AUDIO_ENCODER_INCLUDED
29 
30 
31 /****************************************************************************
32  *
33  * System Includes
34  *
35  ****************************************************************************/
36 
37 #include <sigc++/sigc++.h>
38 #include <string>
39 
40 
41 /****************************************************************************
42  *
43  * Project Includes
44  *
45  ****************************************************************************/
46 
47 #include <AsyncAudioSink.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 
72 namespace 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 
113 class AudioEncoder : public AudioSink, public sigc::trackable
114 {
115  public:
120  static bool isAvailable(const std::string &name);
121 
126  static AudioEncoder *create(const std::string &name);
127 
131  AudioEncoder(void) {}
132 
136  ~AudioEncoder(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) {}
155 
160 
169  virtual void flushSamples(void) { flushEncodedSamples(); }
170 
176  sigc::signal<void,const void *,int> writeEncodedSamples;
177 
181  sigc::signal<void> flushEncodedSamples;
182 
183 
184  protected:
185 
186  private:
188  AudioEncoder& operator=(const AudioEncoder&);
189 
190 }; /* class AudioEncoder */
191 
192 
193 } /* namespace */
194 
195 #endif /* ASYNC_AUDIO_ENCODER_INCLUDED */
196 
197 
198 
199 /*
200  * This file has not been truncated
201  */
202 
Async::AudioEncoder::allEncodedSamplesFlushed
void allEncodedSamplesFlushed(void)
Call this function when all encoded samples have been flushed.
Definition: AsyncAudioEncoder.h:215
Async::AudioEncoder::name
virtual const char * name(void) const =0
Get the name of the codec.
Async::AudioEncoder::~AudioEncoder
~AudioEncoder(void)
Destructor.
Definition: AsyncAudioEncoder.h:192
Async::AudioEncoder::printCodecParams
virtual void printCodecParams(void)
Print codec parameter settings.
Definition: AsyncAudioEncoder.h:210
Async::AudioEncoder::AudioEncoder
AudioEncoder(void)
Default constuctor.
Definition: AsyncAudioEncoder.h:187
Async::AudioEncoder::flushSamples
virtual void flushSamples(void)
Tell the sink to flush the previously written samples.
Definition: AsyncAudioEncoder.h:225
Async::AudioEncoder::create
static AudioEncoder * create(const std::string &name)
Create a new encoder of the specified type.
Async::AudioEncoder::setOption
virtual void setOption(const std::string &name, const std::string &value)
Set an option for the encoder.
Definition: AsyncAudioEncoder.h:205
Async
Namespace for the asynchronous programming classes.
Definition: AsyncApplication.h:75
Async::AudioEncoder::writeEncodedSamples
sigc::signal< void, const void *, int > writeEncodedSamples
A signal emitted when encoded samples are available.
Definition: AsyncAudioEncoder.h:232
AsyncAudioSink.h
This file contains the base class for an audio sink.
Async::AudioEncoder
Base class for an audio encoder.
Definition: AsyncAudioEncoder.h:133
Async::AudioEncoder::isAvailable
static bool isAvailable(const std::string &name)
Check if a specific encoder is available.
Async::AudioSink::sourceAllSamplesFlushed
void sourceAllSamplesFlushed(void)
Tell the source that all samples have been flushed.
Async::AudioEncoder::flushEncodedSamples
sigc::signal< void > flushEncodedSamples
This signal is emitted when the source calls flushSamples.
Definition: AsyncAudioEncoder.h:237