Home | History | Annotate | Download | only in libmedia

Lines Matching full:tonegenerator

18 #define LOG_TAG "ToneGenerator"
23 #include "media/ToneGenerator.h"
29 // Descriptors for all available tones (See ToneGenerator::ToneDescriptor class declaration for details)
30 const ToneGenerator::ToneDescriptor ToneGenerator::sToneDescriptors[] = {
31 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1336, 941, 0 }, 0, 0},
33 .repeatCnt = ToneGenerator::TONEGEN_INF,
35 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1209, 697, 0 }, 0, 0 },
37 .repeatCnt = ToneGenerator::TONEGEN_INF,
39 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1336, 697, 0 }, 0, 0 },
41 .repeatCnt = ToneGenerator::TONEGEN_INF,
43 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1477, 697, 0 }, 0, 0 },
45 .repeatCnt = ToneGenerator::TONEGEN_INF,
47 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1209, 770, 0 }, 0, 0 },
49 .repeatCnt = ToneGenerator::TONEGEN_INF,
51 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1336, 770, 0 }, 0, 0 },
53 .repeatCnt = ToneGenerator::TONEGEN_INF,
55 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1477, 770, 0 }, 0, 0 },
57 .repeatCnt = ToneGenerator::TONEGEN_INF,
59 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1209, 852, 0 }, 0, 0 },
61 .repeatCnt = ToneGenerator::TONEGEN_INF,
63 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1336, 852, 0 }, 0, 0 },
65 .repeatCnt = ToneGenerator::TONEGEN_INF,
67 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1477, 852, 0 }, 0, 0 },
69 .repeatCnt = ToneGenerator::TONEGEN_INF,
71 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1209, 941, 0 }, 0, 0 },
73 .repeatCnt = ToneGenerator::TONEGEN_INF,
75 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1477, 941, 0 }, 0, 0 },
77 .repeatCnt = ToneGenerator::TONEGEN_INF,
79 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1633, 697, 0 }, 0, 0 },
81 .repeatCnt = ToneGenerator::TONEGEN_INF,
83 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1633, 770, 0 }, 0, 0 },
85 .repeatCnt = ToneGenerator::TONEGEN_INF,
87 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1633, 852, 0 }, 0, 0 },
89 .repeatCnt = ToneGenerator::TONEGEN_INF,
91 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 1633, 941, 0 }, 0, 0 },
93 .repeatCnt = ToneGenerator::TONEGEN_INF,
95 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 425, 0 }, 0, 0 },
97 .repeatCnt = ToneGenerator::TONEGEN_INF,
102 .repeatCnt = ToneGenerator::TONEGEN_INF,
107 .repeatCnt = ToneGenerator::TONEGEN_INF,
121 .repeatCnt = ToneGenerator::TONEGEN_INF,
128 .repeatCnt = ToneGenerator::TONEGEN_INF,
133 .repeatCnt = ToneGenerator::TONEGEN_INF,
161 .repeatCnt = ToneGenerator::TONEGEN_INF,
183 { .segments = {{ .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 425, 0 }, 0, 0},
185 .repeatCnt = ToneGenerator::TONEGEN_INF,
190 .repeatCnt = ToneGenerator::TONEGEN_INF,
195 .repeatCnt = ToneGenerator::TONEGEN_INF,
205 .repeatCnt = ToneGenerator::TONEGEN_INF,
215 .repeatCnt = ToneGenerator::TONEGEN_INF,
289 .repeatCnt = ToneGenerator::TONEGEN_INF,
295 .repeatCnt = ToneGenerator::TONEGEN_INF,
301 .repeatCnt = ToneGenerator::TONEGEN_INF,
307 .repeatCnt = ToneGenerator::TONEGEN_INF,
313 .repeatCnt = ToneGenerator::TONEGEN_INF,
319 .repeatCnt = ToneGenerator::TONEGEN_INF,
331 .repeatCnt = ToneGenerator::TONEGEN_INF,
343 .repeatCnt = ToneGenerator::TONEGEN_INF,
355 .repeatCnt = ToneGenerator::TONEGEN_INF,
364 .repeatCnt = ToneGenerator::TONEGEN_INF,
373 .repeatCnt = ToneGenerator::TONEGEN_INF,
382 .repeatCnt = ToneGenerator::TONEGEN_INF,
394 .repeatCnt = ToneGenerator::TONEGEN_INF,
406 .repeatCnt = ToneGenerator::TONEGEN_INF,
418 .repeatCnt = ToneGenerator::TONEGEN_INF,
433 .repeatCnt = ToneGenerator::TONEGEN_INF,
448 .repeatCnt = ToneGenerator::TONEGEN_INF,
463 .repeatCnt = ToneGenerator::TONEGEN_INF,
469 .repeatCnt = ToneGenerator::TONEGEN_INF,
475 .repeatCnt = ToneGenerator::TONEGEN_INF,
481 .repeatCnt = ToneGenerator::TONEGEN_INF,
490 .repeatCnt = ToneGenerator::TONEGEN_INF,
499 .repeatCnt = ToneGenerator::TONEGEN_INF,
508 .repeatCnt = ToneGenerator::TONEGEN_INF,
520 .repeatCnt = ToneGenerator::TONEGEN_INF,
532 .repeatCnt = ToneGenerator::TONEGEN_INF,
544 .repeatCnt = ToneGenerator::TONEGEN_INF,
556 .repeatCnt = ToneGenerator::TONEGEN_INF,
568 .repeatCnt = ToneGenerator::TONEGEN_INF,
580 .repeatCnt = ToneGenerator::TONEGEN_INF,
595 .repeatCnt = ToneGenerator::TONEGEN_INF,
610 .repeatCnt = ToneGenerator::TONEGEN_INF,
625 .repeatCnt = ToneGenerator::TONEGEN_INF,
670 .repeatCnt = ToneGenerator::TONEGEN_INF,
702 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 350, 440, 0 }, 0, 0 },
704 .repeatCnt = ToneGenerator::TONEGEN_INF,
709 .repeatCnt = ToneGenerator::TONEGEN_INF,
714 .repeatCnt = ToneGenerator::TONEGEN_INF,
722 .repeatCnt = ToneGenerator::TONEGEN_INF,
727 .repeatCnt = ToneGenerator::TONEGEN_INF,
729 { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 400, 0 }, 0, 0 },
731 .repeatCnt = ToneGenerator::TONEGEN_INF,
736 .repeatCnt = ToneGenerator::TONEGEN_INF,
741 .repeatCnt = ToneGenerator::TONEGEN_INF,
748 .repeatCnt = ToneGenerator::TONEGEN_INF,
755 .repeatCnt = ToneGenerator::TONEGEN_INF,
760 .repeatCnt = ToneGenerator::TONEGEN_INF,
767 .repeatCnt = ToneGenerator::TONEGEN_INF,
772 .repeatCnt = ToneGenerator::TONEGEN_INF,
776 // Used by ToneGenerator::getToneForRegion() to convert user specified supervisory tone type
778 const unsigned char /*tone_type*/ ToneGenerator::sToneMappingTable[NUM_REGIONS-1][NUM_SUP_TONES] = {
823 // ToneGenerator class Implementation
832 // Method: ToneGenerator::ToneGenerator()
845 ToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool threadCanCallJava) {
847 ALOGV("ToneGenerator constructor: streamType=%d, volume=%f", streamType, volume);
881 ALOGV("ToneGenerator INIT OK, time: %d", (unsigned int)(systemTime()/1000000));
883 ALOGV("!!!ToneGenerator INIT FAILED!!!");
892 // Method: ToneGenerator::~ToneGenerator()
904 ToneGenerator::~ToneGenerator() {
905 ALOGV("ToneGenerator destructor");
917 // Method: ToneGenerator::startTone()
931 bool ToneGenerator::startTone(tone_type toneType, int durationMs) {
1018 // Method: ToneGenerator::stopTone()
1029 void ToneGenerator::stopTone() {
1086 // Method: ToneGenerator::initAudioTrack()
1097 bool ToneGenerator::initAudioTrack() {
1131 // Method: ToneGenerator::audioCallback()
1138 // user reference (pointer to our ToneGenerator)
1145 void ToneGenerator::audioCallback(int event, void* user, void *info) {
1150 ToneGenerator *lpToneGen = static_cast<ToneGenerator *>(user);
1380 // Method: ToneGenerator::prepareWave()
1391 bool ToneGenerator::prepareWave() {
1422 ToneGenerator::WaveGenerator *lpWaveGen =
1423 new ToneGenerator::WaveGenerator((unsigned short)mSamplingRate,
1450 // Method: ToneGenerator::numWaves()
1461 unsigned int ToneGenerator::numWaves(unsigned int segmentIdx) {
1477 // Method: ToneGenerator::clearWaveGens()
1488 void ToneGenerator::clearWaveGens() {
1499 // Method: ToneGenerator::getToneForRegion()
1511 ToneGenerator::tone_type ToneGenerator::getToneForRegion(tone_type toneType) {
1547 ToneGenerator::WaveGenerator::WaveGenerator(unsigned short samplingRate,
1585 ToneGenerator::WaveGenerator::~WaveGenerator() {
1604 void ToneGenerator::WaveGenerator::getSamples(short *outBuffer,