Async  1.5.0
AsyncSigCAudioSink.h
Go to the documentation of this file.
1 
28 #ifndef ASYNC_SIGC_AUDIO_SINK_INCLUDED
29 #define ASYNC_SIGC_AUDIO_SINK_INCLUDED
30 
31 
32 /****************************************************************************
33  *
34  * System Includes
35  *
36  ****************************************************************************/
37 
38 #include <sigc++/sigc++.h>
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 
114 class SigCAudioSink : public AudioSink, public sigc::trackable
115 {
116  public:
120  SigCAudioSink(void) {}
121 
125  ~SigCAudioSink(void) {}
126 
140  virtual int writeSamples(const float *samples, int count)
141  {
142  return sigWriteSamples(const_cast<float *>(samples), count);
143  }
144 
155  virtual void flushSamples(void)
156  {
157  sigFlushSamples();
158  }
159 
166  void resumeOutput(void)
167  {
169  }
170 
179  void allSamplesFlushed(void)
180  {
182  }
183 
194  sigc::signal<int, float *, int> sigWriteSamples;
195 
203  sigc::signal<void> sigFlushSamples;
204 
205 }; /* class SigCAudioSink */
206 
207 
208 } /* namespace */
209 
210 #endif /* ASYNC_SIGC_AUDIO_SINK_INCLUDED */
211 
212 
213 
214 /*
215  * This file has not been truncated
216  */
void resumeOutput(void)
Tell the source that we are ready to accept more samples.
SigCAudioSink(void)
Default constuctor.
This file contains the base class for an audio sink.
sigc::signal< int, float *, int > sigWriteSamples
Signal that is emitted when the source write samples.
sigc::signal< void > sigFlushSamples
Signal emitted when the source are finished writing samples.
The base class for an audio sink.
Namespace for the asynchronous programming classes.
virtual int writeSamples(const float *samples, int count)
Write samples into this audio sink.
void sourceResumeOutput(void)
Tell the source that we are ready to accept more samples.
void sourceAllSamplesFlushed(void)
Tell the source that all samples have been flushed.
virtual void flushSamples(void)
Tell the sink to flush the previously written samples.
An adapter class to connect to an AudioSource class using SigC.
~SigCAudioSink(void)
Destructor.
void allSamplesFlushed(void)
Tell the source that all samples have been flushed.