summaryrefslogtreecommitdiffstats
path: root/include/hardware_legacy/AudioPolicyInterface.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-12-14 18:18:36 -0800
committerEric Laurent <elaurent@google.com>2012-01-17 16:00:01 -0800
commitc6f331b3f48455c9a9cdf00fc82894badd0a7da6 (patch)
treee5f93ad7a7e9ebb225b0a8b37bdb0021cde4270d /include/hardware_legacy/AudioPolicyInterface.h
parentd97809bca3b086fe85475f462b6fdba6775f5ae1 (diff)
downloadhardware_libhardware_legacy-c6f331b3f48455c9a9cdf00fc82894badd0a7da6.zip
hardware_libhardware_legacy-c6f331b3f48455c9a9cdf00fc82894badd0a7da6.tar.gz
hardware_libhardware_legacy-c6f331b3f48455c9a9cdf00fc82894badd0a7da6.tar.bz2
audio policy manager: stream volume per device
Improve volume management by keeping track of volume for each type of device independently. AudioPolicyManagerBase now keeps track of stream volumes for each device and apply volume according to current device selection. Methods to set and get stream volume now specify the device class. A value for "default" device is always present for each stream and is used if a device is selected and no specific volume was ever set for this device. Change-Id: I06d8f43aa151a09014f7e47e81304c73ff82e9f8
Diffstat (limited to 'include/hardware_legacy/AudioPolicyInterface.h')
-rw-r--r--include/hardware_legacy/AudioPolicyInterface.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/include/hardware_legacy/AudioPolicyInterface.h b/include/hardware_legacy/AudioPolicyInterface.h
index 1ee0e20..a1c1fd5 100644
--- a/include/hardware_legacy/AudioPolicyInterface.h
+++ b/include/hardware_legacy/AudioPolicyInterface.h
@@ -128,10 +128,19 @@ public:
int indexMin,
int indexMax) = 0;
- // sets the new stream volume at a level corresponding to the supplied index
- virtual status_t setStreamVolumeIndex(AudioSystem::stream_type stream, int index) = 0;
- // retreive current volume index for the specified stream
- virtual status_t getStreamVolumeIndex(AudioSystem::stream_type stream, int *index) = 0;
+ // sets the new stream volume at a level corresponding to the supplied index for the
+ // supplied device. By convention, specifying AUDIO_DEVICE_OUT_DEFAULT means
+ // setting volume for all devices
+ virtual status_t setStreamVolumeIndex(AudioSystem::stream_type stream,
+ int index,
+ audio_devices_t device) = 0;
+
+ // retrieve current volume index for the specified stream and the
+ // specified device. By convention, specifying AUDIO_DEVICE_OUT_DEFAULT means
+ // querying the volume of the active device.
+ virtual status_t getStreamVolumeIndex(AudioSystem::stream_type stream,
+ int *index,
+ audio_devices_t device) = 0;
// return the strategy corresponding to a given stream type
virtual uint32_t getStrategyForStream(AudioSystem::stream_type stream) = 0;