Async  1.5.0
AsyncAudioReader.h
Go to the documentation of this file.
1 
27 #ifndef ASYNC_AUDIO_READER_INCLUDED
28 #define ASYNC_AUDIO_READER_INCLUDED
29 
30 
31 /****************************************************************************
32  *
33  * System Includes
34  *
35  ****************************************************************************/
36 
37 
38 
39 /****************************************************************************
40  *
41  * Project Includes
42  *
43  ****************************************************************************/
44 
45 #include <AsyncAudioSink.h>
46 
47 
48 /****************************************************************************
49  *
50  * Local Includes
51  *
52  ****************************************************************************/
53 
54 
55 
56 /****************************************************************************
57  *
58  * Forward declarations
59  *
60  ****************************************************************************/
61 
62 
63 
64 /****************************************************************************
65  *
66  * Namespace
67  *
68  ****************************************************************************/
69 
70 namespace Async
71 {
72 
73 
74 /****************************************************************************
75  *
76  * Forward declarations of classes inside of the declared namespace
77  *
78  ****************************************************************************/
79 
80 
81 
82 /****************************************************************************
83  *
84  * Defines & typedefs
85  *
86  ****************************************************************************/
87 
88 
89 
90 /****************************************************************************
91  *
92  * Exported Global Variables
93  *
94  ****************************************************************************/
95 
96 
97 
98 /****************************************************************************
99  *
100  * Class definitions
101  *
102  ****************************************************************************/
103 
112 class AudioReader : public AudioSink
113 {
114  public:
118  AudioReader(void);
119 
123  ~AudioReader(void);
124 
133  int readSamples(float *samples, int count);
134 
146  virtual int writeSamples(const float *samples, int count);
147 
156  virtual void flushSamples(void);
157 
158  protected:
159 
160  private:
161  AudioReader(const AudioReader&);
162  AudioReader& operator=(const AudioReader&);
163 
164  float *buf;
165  int buf_size;
166  bool input_stopped;
167  int samples_in_buf;
168 
169 }; /* class AudioReader */
170 
171 
172 } /* namespace */
173 
174 #endif /* ASYNC_AUDIO_READER_INCLUDED */
175 
176 
177 
178 /*
179  * This file has not been truncated
180  */
181 
AudioReader(void)
Default constuctor.
An audio pipe component for on demand reading samples.
virtual int writeSamples(const float *samples, int count)
Write samples into this audio sink.
virtual void flushSamples(void)
Tell the sink to flush the previously written samples.
This file contains the base class for an audio sink.
~AudioReader(void)
Destructor.
The base class for an audio sink.
Namespace for the asynchronous programming classes.
int readSamples(float *samples, int count)
Read at most the specified number of samples.