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:
187  AudioEncoder(const AudioEncoder&);
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 
virtual void setOption(const std::string &name, const std::string &value)
Set an option for the encoder.
virtual const char * name(void) const =0
Get the name of the codec.
~AudioEncoder(void)
Destructor.
sigc::signal< void > flushEncodedSamples
This signal is emitted when the source calls flushSamples.
This file contains the base class for an audio sink.
void allEncodedSamplesFlushed(void)
Call this function when all encoded samples have been flushed.
static AudioEncoder * create(const std::string &name)
Create a new encoder of the specified type.
virtual void flushSamples(void)
Tell the sink to flush the previously written samples.
The base class for an audio sink.
Namespace for the asynchronous programming classes.
Base class for an audio encoder.
virtual void printCodecParams(void)
Print codec parameter settings.
sigc::signal< void, const void *, int > writeEncodedSamples
A signal emitted when encoded samples are available.
AudioEncoder(void)
Default constuctor.
void sourceAllSamplesFlushed(void)
Tell the source that all samples have been flushed.
static bool isAvailable(const std::string &name)
Check if a specific encoder is available.