diff options
author | Glenn Kasten <gkasten@google.com> | 2012-01-04 12:41:44 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-02-03 15:48:25 -0800 |
commit | 7c2e37dd32d42f1398a48d2ca6a51cf2e96b9893 (patch) | |
tree | 823cae479f17737133119b957dd28748f30b1668 | |
parent | f55bc56490660e8eff92ff1f97607d6e78826629 (diff) | |
download | frameworks_base-7c2e37dd32d42f1398a48d2ca6a51cf2e96b9893.zip frameworks_base-7c2e37dd32d42f1398a48d2ca6a51cf2e96b9893.tar.gz frameworks_base-7c2e37dd32d42f1398a48d2ca6a51cf2e96b9893.tar.bz2 |
AudioTrack declare more methods const
Change-Id: I4999e984460893961d0d8092cff17f3cf07d7214
-rw-r--r-- | include/media/AudioTrack.h | 14 | ||||
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index 02c85cd..9a42bc1 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -273,18 +273,18 @@ public: * left and right volumes. Levels must be >= 0.0 and <= 1.0. */ status_t setVolume(float left, float right); - void getVolume(float* left, float* right); + void getVolume(float* left, float* right) const; /* Set the send level for this track. An auxiliary effect should be attached * to the track with attachEffect(). Level must be >= 0.0 and <= 1.0. */ status_t setAuxEffectSendLevel(float level); - void getAuxEffectSendLevel(float* level); + void getAuxEffectSendLevel(float* level) const; /* Set sample rate for this track, mostly used for games' sound effects */ status_t setSampleRate(int sampleRate); - uint32_t getSampleRate(); + uint32_t getSampleRate() const; /* Enables looping and sets the start and end points of looping. * @@ -299,7 +299,7 @@ public: * (loopEnd-loopStart) <= framecount() */ status_t setLoop(uint32_t loopStart, uint32_t loopEnd, int loopCount); - status_t getLoop(uint32_t *loopStart, uint32_t *loopEnd, int *loopCount); + status_t getLoop(uint32_t *loopStart, uint32_t *loopEnd, int *loopCount) const; /* Sets marker position. When playback reaches the number of frames specified, a callback with * event type EVENT_MARKER is called. Calling setMarkerPosition with marker == 0 cancels marker @@ -315,7 +315,7 @@ public: * - INVALID_OPERATION: the AudioTrack has no callback installed. */ status_t setMarkerPosition(uint32_t marker); - status_t getMarkerPosition(uint32_t *marker); + status_t getMarkerPosition(uint32_t *marker) const; /* Sets position update period. Every time the number of frames specified has been played, @@ -333,7 +333,7 @@ public: * - INVALID_OPERATION: the AudioTrack has no callback installed. */ status_t setPositionUpdatePeriod(uint32_t updatePeriod); - status_t getPositionUpdatePeriod(uint32_t *updatePeriod); + status_t getPositionUpdatePeriod(uint32_t *updatePeriod) const; /* Sets playback head position within AudioTrack buffer. The new position is specified * in number of frames. @@ -384,7 +384,7 @@ public: * Returned value: * AudioTrack session ID. */ - int getSessionId(); + int getSessionId() const; /* Attach track auxiliary output to specified effect. Use effectId = 0 * to detach track from effect. diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 8c33f41..233cf75 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -506,7 +506,7 @@ status_t AudioTrack::setVolume(float left, float right) return NO_ERROR; } -void AudioTrack::getVolume(float* left, float* right) +void AudioTrack::getVolume(float* left, float* right) const { if (left != NULL) { *left = mVolume[LEFT]; @@ -531,7 +531,7 @@ status_t AudioTrack::setAuxEffectSendLevel(float level) return NO_ERROR; } -void AudioTrack::getAuxEffectSendLevel(float* level) +void AudioTrack::getAuxEffectSendLevel(float* level) const { if (level != NULL) { *level = mSendLevel; @@ -553,7 +553,7 @@ status_t AudioTrack::setSampleRate(int rate) return NO_ERROR; } -uint32_t AudioTrack::getSampleRate() +uint32_t AudioTrack::getSampleRate() const { AutoMutex lock(mLock); return mCblk->sampleRate; @@ -601,7 +601,7 @@ status_t AudioTrack::setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCou return NO_ERROR; } -status_t AudioTrack::getLoop(uint32_t *loopStart, uint32_t *loopEnd, int *loopCount) +status_t AudioTrack::getLoop(uint32_t *loopStart, uint32_t *loopEnd, int *loopCount) const { AutoMutex lock(mLock); if (loopStart != NULL) { @@ -631,7 +631,7 @@ status_t AudioTrack::setMarkerPosition(uint32_t marker) return NO_ERROR; } -status_t AudioTrack::getMarkerPosition(uint32_t *marker) +status_t AudioTrack::getMarkerPosition(uint32_t *marker) const { if (marker == NULL) return BAD_VALUE; @@ -652,7 +652,7 @@ status_t AudioTrack::setPositionUpdatePeriod(uint32_t updatePeriod) return NO_ERROR; } -status_t AudioTrack::getPositionUpdatePeriod(uint32_t *updatePeriod) +status_t AudioTrack::getPositionUpdatePeriod(uint32_t *updatePeriod) const { if (updatePeriod == NULL) return BAD_VALUE; @@ -712,7 +712,7 @@ audio_io_handle_t AudioTrack::getOutput_l() mCblk->sampleRate, mFormat, mChannelMask, (audio_policy_output_flags_t)mFlags); } -int AudioTrack::getSessionId() +int AudioTrack::getSessionId() const { return mSessionId; } |