summaryrefslogtreecommitdiffstats
path: root/include/private
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-01-17 14:39:34 -0800
committerGlenn Kasten <gkasten@google.com>2012-01-20 16:19:59 -0800
commit83d86538c4c479a9225c75ab27938e8f05abb9c8 (patch)
tree72fdff9fb9bb7e41fe48c41bfed65ab83b64f85f /include/private
parent58f30210ea540b6ce5aa6a46330cd3499483cb97 (diff)
downloadframeworks_av-83d86538c4c479a9225c75ab27938e8f05abb9c8.zip
frameworks_av-83d86538c4c479a9225c75ab27938e8f05abb9c8.tar.gz
frameworks_av-83d86538c4c479a9225c75ab27938e8f05abb9c8.tar.bz2
Make AudioTrack control block volume field private
This is part of the process of abstracting the control block to make it easier to maintain. Change-Id: Idb8f461e68dab3bcf268159cc0781651c6fb7094
Diffstat (limited to 'include/private')
-rw-r--r--include/private/media/AudioTrackShared.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/private/media/AudioTrackShared.h b/include/private/media/AudioTrackShared.h
index ffc546e..dd97ce4 100644
--- a/include/private/media/AudioTrackShared.h
+++ b/include/private/media/AudioTrackShared.h
@@ -76,7 +76,9 @@ struct audio_track_cblk_t
// Left channel is in [0:15], right channel is in [16:31].
// Always read and write the combined pair atomically.
// For AudioTrack only, not used by AudioRecord.
- uint32_t volumeLR;
+private:
+ uint32_t mVolumeLR;
+public:
uint32_t sampleRate;
// NOTE: audio_track_cblk_t::frameSize is not equal to AudioTrack::frameSize() for
@@ -116,6 +118,17 @@ public:
uint16_t getSendLevel_U4_12() const {
return mSendLevel;
}
+
+ // for AudioTrack client only, caller must limit to 0 <= volumeLR <= 0x10001000
+ void setVolumeLR(uint32_t volumeLR) {
+ mVolumeLR = volumeLR;
+ }
+
+ // for AudioFlinger only; the return value must be validated by the caller
+ uint32_t getVolumeLR() const {
+ return mVolumeLR;
+ }
+
};