summaryrefslogtreecommitdiffstats
path: root/include/hardware/audio_policy.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-12-09 17:10:40 -0800
committerEric Laurent <elaurent@google.com>2012-01-17 09:10:45 -0800
commitca20b17b419eec2b196877be38f9c4290449aeac (patch)
treeb1193d77a7b45b91fed9ee36a55c58f62898f357 /include/hardware/audio_policy.h
parentc38e7baa4f7f0ee69ba494a4624d1f6dd3e21bec (diff)
downloadhardware_libhardware-ca20b17b419eec2b196877be38f9c4290449aeac.zip
hardware_libhardware-ca20b17b419eec2b196877be38f9c4290449aeac.tar.gz
hardware_libhardware-ca20b17b419eec2b196877be38f9c4290449aeac.tar.bz2
audio policy: manage stream volume per device
Improve volume management by keeping track of volume for each type of device independently. Added functions at the audio policy interface to set and get stream volume for a particular device. Change-Id: Ic8899e82e48193cb65b3673e9d20383efed943b5
Diffstat (limited to 'include/hardware/audio_policy.h')
-rw-r--r--include/hardware/audio_policy.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/include/hardware/audio_policy.h b/include/hardware/audio_policy.h
index add14f8..7485953 100644
--- a/include/hardware/audio_policy.h
+++ b/include/hardware/audio_policy.h
@@ -91,7 +91,7 @@ struct audio_policy {
audio_policy_dev_state_t state,
const char *device_address);
- /* retreive a device connection status */
+ /* retrieve a device connection status */
audio_policy_dev_state_t (*get_device_connection_state)(
const struct audio_policy *pol,
audio_devices_t device,
@@ -110,7 +110,7 @@ struct audio_policy {
audio_policy_force_use_t usage,
audio_policy_forced_cfg_t config);
- /* retreive current device category forced for a given usage */
+ /* retrieve current device category forced for a given usage */
audio_policy_forced_cfg_t (*get_force_use)(const struct audio_policy *pol,
audio_policy_force_use_t usage);
@@ -174,23 +174,37 @@ struct audio_policy {
*/
/* initialises stream volume conversion parameters by specifying volume
- * index range. */
+ * index range. The index range for each stream is defined by AudioService. */
void (*init_stream_volume)(struct audio_policy *pol,
audio_stream_type_t stream,
int index_min,
int index_max);
/* sets the new stream volume at a level corresponding to the supplied
- * index */
+ * index. The index is within the range specified by init_stream_volume() */
int (*set_stream_volume_index)(struct audio_policy *pol,
audio_stream_type_t stream,
int index);
- /* retreive current volume index for the specified stream */
+ /* retrieve current volume index for the specified stream */
int (*get_stream_volume_index)(const struct audio_policy *pol,
audio_stream_type_t stream,
int *index);
+ /* sets the new stream volume at a level corresponding to the supplied
+ * index for the specified device.
+ * The index is within the range specified by init_stream_volume() */
+ int (*set_stream_volume_index_for_device)(struct audio_policy *pol,
+ audio_stream_type_t stream,
+ int index,
+ audio_devices_t device);
+
+ /* retrieve current volume index for the specified stream for the specified device */
+ int (*get_stream_volume_index_for_device)(const struct audio_policy *pol,
+ audio_stream_type_t stream,
+ int *index,
+ audio_devices_t device);
+
/* return the strategy corresponding to a given stream type */
uint32_t (*get_strategy_for_stream)(const struct audio_policy *pol,
audio_stream_type_t stream);