Async
0.18.0
Main Page
Namespaces
Classes
Files
Examples
File List
File Members
include
AsyncAudioMixer.h
Go to the documentation of this file.
1
28
#ifndef ASYNC_AUDIO_MIXER_INCLUDED
29
#define ASYNC_AUDIO_MIXER_INCLUDED
30
31
32
/****************************************************************************
33
*
34
* System Includes
35
*
36
****************************************************************************/
37
38
#include <list>
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
class
Timer;
83
84
85
/****************************************************************************
86
*
87
* Defines & typedefs
88
*
89
****************************************************************************/
90
91
92
93
/****************************************************************************
94
*
95
* Exported Global Variables
96
*
97
****************************************************************************/
98
99
100
101
/****************************************************************************
102
*
103
* Class definitions
104
*
105
****************************************************************************/
106
114
class
AudioMixer
:
public
SigC::Object,
public
Async::AudioSource
115
{
116
public
:
120
AudioMixer
(
void
);
121
125
~AudioMixer
(
void
);
126
131
void
addSource
(
AudioSource
*source);
132
140
void
resumeOutput
(
void
);
141
142
143
protected
:
151
void
allSamplesFlushed
(
void
);
152
153
154
private
:
155
class
MixerSrc
;
156
157
static
const
int
OUTBUF_SIZE = 256;
158
159
std::list<MixerSrc *> sources;
160
Timer
*delayed_exec_timer;
161
float
outbuf[OUTBUF_SIZE];
162
unsigned
outbuf_pos;
163
unsigned
outbuf_cnt;
164
bool
is_flushed;
165
bool
output_stopped;
166
167
AudioMixer
(
const
AudioMixer
&);
168
AudioMixer
& operator=(
const
AudioMixer
&);
169
170
void
setAudioAvailable(
void
);
171
void
flushSamples(
void
);
172
void
outputHandler(
Timer
*t);
173
void
checkFlush(
void
);
174
175
friend
class
MixerSrc
;
176
177
};
/* class AudioMixer */
178
179
180
}
/* namespace */
181
182
#endif
/* ASYNC_AUDIO_MIXER_INCLUDED */
183
184
185
186
/*
187
* This file has not been truncated
188
*/
189
Generated by
1.8.3