Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: chromecast/public/avsettings.h

Issue 1602323003: [Chromecast] Add volume step interval getter to AvSettings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROMECAST_PUBLIC_AVSETTINGS_H_ 5 #ifndef CHROMECAST_PUBLIC_AVSETTINGS_H_
6 #define CHROMECAST_PUBLIC_AVSETTINGS_H_ 6 #define CHROMECAST_PUBLIC_AVSETTINGS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "output_restrictions.h" 10 #include "output_restrictions.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // This event should be fired whenever the active output restrictions on the 96 // This event should be fired whenever the active output restrictions on the
97 // device outputs change. On this event, GetOutputRestrictions() will be 97 // device outputs change. On this event, GetOutputRestrictions() will be
98 // called on the thread where Initialize() was called. 98 // called on the thread where Initialize() was called.
99 OUTPUT_RESTRICTIONS_CHANGED = 4, 99 OUTPUT_RESTRICTIONS_CHANGED = 4,
100 100
101 // This event shall be fired whenever the type of volume control provided 101 // This event shall be fired whenever the type of volume control provided
102 // by the device is changed, for e.g., when the device is connected or 102 // by the device is changed, for e.g., when the device is connected or
103 // disconnected to HDMI sinks 103 // disconnected to HDMI sinks
104 AUDIO_VOLUME_CONTROL_TYPE_CHANGED = 5, 104 AUDIO_VOLUME_CONTROL_TYPE_CHANGED = 5,
105 105
106 // This event shall be fired whenever the volume step interval provided
107 // by the device is changed, for e.g. when connecting to an AVR setup
108 // where step interval should be 1%.
109 AUDIO_VOLUME_STEP_INTERVAL_CHANGED = 6,
gfhuang 2016/01/20 22:48:22 I think you should just give up ordering and use n
110
106 // This event shall be fired whenever wake-on-cast status is changed by 111 // This event shall be fired whenever wake-on-cast status is changed by
107 // platform. 112 // platform.
108 WAKE_ON_CAST_CHANGED = 6, 113 WAKE_ON_CAST_CHANGED = 7,
109 114
110 // This event should be fired when the device is connected to HDMI sinks. 115 // This event should be fired when the device is connected to HDMI sinks.
111 HDMI_CONNECTED = 100, 116 HDMI_CONNECTED = 100,
112 117
113 // This event should be fired when the device is disconnected to HDMI sinks. 118 // This event should be fired when the device is disconnected to HDMI sinks.
114 HDMI_DISCONNECTED = 101, 119 HDMI_DISCONNECTED = 101,
115 }; 120 };
116 121
117 // Delegate to inform the caller events. As a subclass of TaskRunner, 122 // Delegate to inform the caller events. As a subclass of TaskRunner,
118 // AvSettings implementation can post tasks to the thread where Initialize() 123 // AvSettings implementation can post tasks to the thread where Initialize()
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // Returns true if successful. 175 // Returns true if successful.
171 virtual bool KeepSystemAwake(int time_ms) = 0; 176 virtual bool KeepSystemAwake(int time_ms) = 0;
172 177
173 // Returns the type of volume control, i.e. MASTER_VOLUME, FIXED_VOLUME or 178 // Returns the type of volume control, i.e. MASTER_VOLUME, FIXED_VOLUME or
174 // ATTENUATION_VOLUME. For example, normal TVs, devices of CEC audio 179 // ATTENUATION_VOLUME. For example, normal TVs, devices of CEC audio
175 // controls, and audio devices are master volume systems. The counter 180 // controls, and audio devices are master volume systems. The counter
176 // examples are Chromecast (which doesn't do CEC audio controls) and 181 // examples are Chromecast (which doesn't do CEC audio controls) and
177 // Nexus Player which is fixed volume. 182 // Nexus Player which is fixed volume.
178 virtual AudioVolumeControlType GetAudioVolumeControlType() = 0; 183 virtual AudioVolumeControlType GetAudioVolumeControlType() = 0;
179 184
185 // Retrieves the volume step interval as percentage in range [0.0, 1.0] that
186 // specifies how much volume to change per step. Returns true if a valid
187 // interval is specified by platform; returns false if interval should defer
188 // to default values.
189 //
190 // Current default volume step intervals per control type are as follows:
191 // - MASTER_VOLUME (5%)
gfhuang 2016/01/20 22:48:22 "5%" -> "5%, i.e. 0.05" to make it more clear in t
192 // - ATTENUATION_VOLUME (2%)
193 // - FIXED_VOLUME (1%)
194 // - UNKNOWN_VOLUME (1%)
195 virtual bool GetAudioVolumeStepInterval(float* step_inteval) = 0;
196
180 // Returns the current volume level, which must be from 0.0 (inclusive) to 197 // Returns the current volume level, which must be from 0.0 (inclusive) to
181 // 1.0 (inclusive). 198 // 1.0 (inclusive).
182 virtual float GetAudioVolume() = 0; 199 virtual float GetAudioVolume() = 0;
183 200
184 // Sets new volume level of the device (or HDMI sinks). |level| is from 0.0 201 // Sets new volume level of the device (or HDMI sinks). |level| is from 0.0
185 // (inclusive) to 1.0 (inclusive). 202 // (inclusive) to 1.0 (inclusive).
186 // If successful and the level has changed, it must return true and fire 203 // If successful and the level has changed, it must return true and fire
187 // AUDIO_VOLUME_CHANGED. 204 // AUDIO_VOLUME_CHANGED.
188 virtual bool SetAudioVolume(float level) = 0; 205 virtual bool SetAudioVolume(float level) = 0;
189 206
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 virtual WakeOnCastStatus GetWakeOnCastStatus() = 0; 240 virtual WakeOnCastStatus GetWakeOnCastStatus() = 0;
224 241
225 // Enables/Disables Wake-On-Cast status. 242 // Enables/Disables Wake-On-Cast status.
226 // Returns false if failed or not supported. 243 // Returns false if failed or not supported.
227 virtual bool EnableWakeOnCast(bool enabled) = 0; 244 virtual bool EnableWakeOnCast(bool enabled) = 0;
228 }; 245 };
229 246
230 } // namespace chromecast 247 } // namespace chromecast
231 248
232 #endif // CHROMECAST_PUBLIC_AVSETTINGS_H_ 249 #endif // CHROMECAST_PUBLIC_AVSETTINGS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698