diff options
author | Glenn Kasten <gkasten@google.com> | 2012-01-17 14:39:34 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-01-20 16:19:59 -0800 |
commit | bc4de888c12f1ad9aec8c9b2a0addaaa73dceae9 (patch) | |
tree | 0dece8e783d706b57edff22ccc33d469069ccdd8 /include/private | |
parent | 0a204ed0f58a9baaac5630864cd75495486c6cbe (diff) | |
download | frameworks_base-bc4de888c12f1ad9aec8c9b2a0addaaa73dceae9.zip frameworks_base-bc4de888c12f1ad9aec8c9b2a0addaaa73dceae9.tar.gz frameworks_base-bc4de888c12f1ad9aec8c9b2a0addaaa73dceae9.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.h | 15 |
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; + } + }; |