Async  1.3.1
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:
116  static AudioEncoder *create(const std::string &name);
117 
121  AudioEncoder(void) {}
122 
126  ~AudioEncoder(void) {}
127 
132  virtual const char *name(void) const = 0;
133 
139  virtual void setOption(const std::string &name, const std::string &value) {}
140 
144  virtual void printCodecParams(void) {}
145 
150 
159  virtual void flushSamples(void) { flushEncodedSamples(); }
160 
166  sigc::signal<void,const void *,int> writeEncodedSamples;
167 
171  sigc::signal<void> flushEncodedSamples;
172 
173 
174  protected:
175 
176  private:
177  AudioEncoder(const AudioEncoder&);
178  AudioEncoder& operator=(const AudioEncoder&);
179 
180 }; /* class AudioEncoder */
181 
182 
183 } /* namespace */
184 
185 #endif /* ASYNC_AUDIO_ENCODER_INCLUDED */
186 
187 
188 
189 /*
190  * This file has not been truncated
191  */
192 
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)
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.