summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-02-03 08:00:52 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-03 08:00:52 -0800
commitff3c83e04ae459c4252b86dd4440b4e37ee92c16 (patch)
tree8de4de832991dd2086313b6168f8523d002f6251
parenta0d68338a88c2ddb4502f95017b546d603ef1ec7 (diff)
parent3d2f877c1cb4e4ae4ddde7f57f4353de9341f11b (diff)
downloadframeworks_av-ff3c83e04ae459c4252b86dd4440b4e37ee92c16.zip
frameworks_av-ff3c83e04ae459c4252b86dd4440b4e37ee92c16.tar.gz
frameworks_av-ff3c83e04ae459c4252b86dd4440b4e37ee92c16.tar.bz2
Merge "Use ToneGenerator::tone_type consistently"
-rw-r--r--include/media/ToneGenerator.h4
-rw-r--r--media/libmedia/ToneGenerator.cpp10
-rw-r--r--services/audioflinger/AudioPolicyService.cpp3
-rw-r--r--services/audioflinger/AudioPolicyService.h5
4 files changed, 12 insertions, 10 deletions
diff --git a/include/media/ToneGenerator.h b/include/media/ToneGenerator.h
index 7d890bd..df0c97e 100644
--- a/include/media/ToneGenerator.h
+++ b/include/media/ToneGenerator.h
@@ -154,7 +154,7 @@ public:
ToneGenerator(audio_stream_type_t streamType, float volume, bool threadCanCallJava = false);
~ToneGenerator();
- bool startTone(int toneType, int durationMs = -1);
+ bool startTone(tone_type toneType, int durationMs = -1);
void stopTone();
bool isInited() { return (mState == TONE_IDLE)?false:true;}
@@ -274,7 +274,7 @@ private:
bool prepareWave();
unsigned int numWaves(unsigned int segmentIdx);
void clearWaveGens();
- int getToneForRegion(int toneType);
+ tone_type getToneForRegion(tone_type toneType);
// WaveGenerator generates a single sine wave
class WaveGenerator {
diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp
index 1d1f645..e6e989d 100644
--- a/media/libmedia/ToneGenerator.cpp
+++ b/media/libmedia/ToneGenerator.cpp
@@ -751,7 +751,7 @@ const ToneGenerator::ToneDescriptor ToneGenerator::sToneDescriptors[] = {
// Used by ToneGenerator::getToneForRegion() to convert user specified supervisory tone type
// to actual tone for current region.
-const unsigned char ToneGenerator::sToneMappingTable[NUM_REGIONS-1][NUM_SUP_TONES] = {
+const unsigned char /*tone_type*/ ToneGenerator::sToneMappingTable[NUM_REGIONS-1][NUM_SUP_TONES] = {
{ // ANSI
TONE_ANSI_DIAL, // TONE_SUP_DIAL
TONE_ANSI_BUSY, // TONE_SUP_BUSY
@@ -878,7 +878,7 @@ ToneGenerator::~ToneGenerator() {
// none
//
////////////////////////////////////////////////////////////////////////////////
-bool ToneGenerator::startTone(int toneType, int durationMs) {
+bool ToneGenerator::startTone(tone_type toneType, int durationMs) {
bool lResult = false;
status_t lStatus;
@@ -1434,13 +1434,13 @@ void ToneGenerator::clearWaveGens() {
// none
//
////////////////////////////////////////////////////////////////////////////////
-int ToneGenerator::getToneForRegion(int toneType) {
- int regionTone;
+ToneGenerator::tone_type ToneGenerator::getToneForRegion(tone_type toneType) {
+ tone_type regionTone;
if (mRegion == CEPT || toneType < FIRST_SUP_TONE || toneType > LAST_SUP_TONE) {
regionTone = toneType;
} else {
- regionTone = sToneMappingTable[mRegion][toneType - FIRST_SUP_TONE];
+ regionTone = (tone_type) sToneMappingTable[mRegion][toneType - FIRST_SUP_TONE];
}
ALOGV("getToneForRegion, tone %d, region %d, regionTone %d", toneType, mRegion, regionTone);
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp
index 0d8667b..0f2f544 100644
--- a/services/audioflinger/AudioPolicyService.cpp
+++ b/services/audioflinger/AudioPolicyService.cpp
@@ -789,7 +789,8 @@ status_t AudioPolicyService::AudioCommandThread::dump(int fd)
return NO_ERROR;
}
-void AudioPolicyService::AudioCommandThread::startToneCommand(int type, audio_stream_type_t stream)
+void AudioPolicyService::AudioCommandThread::startToneCommand(ToneGenerator::tone_type type,
+ audio_stream_type_t stream)
{
AudioCommand *command = new AudioCommand();
command->mCommand = START_TONE;
diff --git a/services/audioflinger/AudioPolicyService.h b/services/audioflinger/AudioPolicyService.h
index 3c0f5ed..6597bf8 100644
--- a/services/audioflinger/AudioPolicyService.h
+++ b/services/audioflinger/AudioPolicyService.h
@@ -171,7 +171,8 @@ private:
virtual bool threadLoop();
void exit();
- void startToneCommand(int type = 0, audio_stream_type_t stream = AUDIO_STREAM_VOICE_CALL);
+ void startToneCommand(ToneGenerator::tone_type type,
+ audio_stream_type_t stream);
void stopToneCommand();
status_t volumeCommand(audio_stream_type_t stream, float volume, int output, int delayMs = 0);
status_t parametersCommand(int ioHandle, const char *keyValuePairs, int delayMs = 0);
@@ -198,7 +199,7 @@ private:
class ToneData {
public:
- int mType; // tone type (START_TONE only)
+ ToneGenerator::tone_type mType; // tone type (START_TONE only)
audio_stream_type_t mStream; // stream type (START_TONE only)
};