19 #include <ucommon/ucommon.h>
20 #include <ucommon/export.h>
24 using namespace UCOMMON_NAMESPACE;
26 DTMFDialer::DTMFDialer(
const char *d, level_t l, timeout_t duration, timeout_t timer) :
29 dtmfframes = (timer / duration);
45 DTMFDialer::~DTMFDialer()
50 Audio::linear_t DTMFDialer::getFrame(
void)
56 return Tonegen::getFrame();
59 if(!digits || !*digits) {
65 remaining = dtmfframes;
77 dual(697, 1209, level, level);
78 remaining = dtmfframes;
82 dual(697, 1336, level, level);
83 remaining = dtmfframes;
87 dual(697, 1477, level, level);
88 remaining = dtmfframes;
93 dual(697, 1633, level, level);
94 remaining = dtmfframes;
98 dual(770, 1209, level, level);
99 remaining = dtmfframes;
103 dual(770, 1336, level, level);
104 remaining = dtmfframes;
108 dual(770, 1477, level, level);
109 remaining = dtmfframes;
113 dual(852, 1209, level, level);
114 remaining = dtmfframes;
118 dual(852, 1336, level, level);
119 remaining = dtmfframes;
123 dual(852, 1477, level, level);
124 remaining = dtmfframes;
129 dual(852, 1633, level, level);
130 remaining = dtmfframes;
134 dual(941, 1209, level, level);
135 remaining = dtmfframes;
139 dual(941, 1336, level, level);
140 remaining = dtmfframes;
144 dual(941, 1477, level, level);
145 remaining = dtmfframes;
150 dual(941, 1633, level, level);
151 remaining = dtmfframes;
157 remaining = 1000 / framing;
161 remaining = dtmfframes * 2;
168 MFDialer::MFDialer(
const char *d, level_t l, timeout_t duration, timeout_t timer) :
171 mfframes = (timer / duration);
184 if(digits && *digits)
188 MFDialer::~MFDialer()
193 Audio::linear_t MFDialer::getFrame(
void)
199 return Tonegen::getFrame();
202 if(!digits || !*digits) {
209 remaining = 100 / framing;
211 remaining = mfframes;
217 switch(*(digits++)) {
224 dual(700, 900, level, level);
225 remaining = mfframes;
229 dual(700, 1100, level, level);
230 remaining = mfframes;
234 dual(900, 1100, level, level);
235 remaining = mfframes;
239 dual(700, 1300, level, level);
240 remaining = mfframes;
244 dual(900, 1300, level, level);
245 remaining = mfframes;
249 dual(1100, 1300, level, level);
250 remaining = mfframes;
254 dual(700, 1500, level, level);
255 remaining = mfframes;
259 dual(900, 1500, level, level);
260 remaining = mfframes;
264 dual(1100, 1500, level, level);
265 remaining = mfframes;
271 dual(1100, 1700, level, level);
272 remaining = 100 / framing;
277 dual(1300, 1500, level, level);
278 remaining = mfframes;
284 dual(1500, 1700, level, level);
285 remaining = mfframes;
292 remaining = 1000 / framing;
296 remaining = 1000 / framing;
300 remaining = mfframes * 2;
#define BAYONNE_NAMESPACE
GNU Bayonne library namespace.