Async  1.5.0
AsyncSigCAudioSource.h
Go to the documentation of this file.
1 
28 #ifndef ASYNC_SIGC_AUDIO_SOURCE_INCLUDED
29 #define ASYNC_SIGC_AUDIO_SOURCE_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 <AsyncAudioSource.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 SigCAudioSource : public AudioSource, public sigc::trackable
115 {
116  public:
121 
126 
133  virtual void resumeOutput(void)
134  {
135  sigResumeOutput();
136  }
137 
144  virtual void allSamplesFlushed(void)
145  {
147  }
148 
159  int writeSamples(float *samples, int count)
160  {
161  return sinkWriteSamples(samples, count);
162  }
163 
171  void flushSamples(void)
172  {
174  }
175 
182  sigc::signal<void> sigResumeOutput;
183 
190  sigc::signal<void> sigAllSamplesFlushed;
191 
192 }; /* class SigCAudioSource */
193 
194 
195 } /* namespace */
196 
197 #endif /* ASYNC_SIGC_AUDIO_SOURCE_INCLUDED */
198 
199 
200 
201 /*
202  * This file has not been truncated
203  */
204 
This file contains the base class for an audio source.
The base class for an audio source.
void sinkFlushSamples(void)
int sinkWriteSamples(const float *samples, int len)
An adapter class to connect to an AudioSink class using SigC.
virtual void allSamplesFlushed(void)
The registered sink has flushed all samples.
void flushSamples(void)
Tell the sink to flush the previously written samples.
int writeSamples(float *samples, int count)
Write samples into this audio sink.
sigc::signal< void > sigResumeOutput
A signal that is emitted when more samples can be written.
sigc::signal< void > sigAllSamplesFlushed
Signal that is emitted when the connected sink is done flushing.
~SigCAudioSource(void)
Destructor.
SigCAudioSource(void)
Default constuctor.
virtual void resumeOutput(void)
Resume audio output to the sink.
Namespace for the asynchronous programming classes.