OLD | NEW |
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 wake-on-cast status is changed by | 106 // This event shall be fired whenever wake-on-cast status is changed by |
107 // platform. | 107 // platform. |
108 WAKE_ON_CAST_CHANGED = 6, | 108 WAKE_ON_CAST_CHANGED = 6, |
109 | 109 |
| 110 // This event shall be fired whenever the volume step interval provided |
| 111 // by the device is changed, for e.g. when connecting to an AVR setup |
| 112 // where step interval should be 1%. |
| 113 AUDIO_VOLUME_STEP_INTERVAL_CHANGED = 7, |
| 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() |
119 // was called. | 124 // was called. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 in range [0.0, 1.0] that specifies how |
| 186 // much volume to change per step, e.g. 0.05 = 5%. 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: 0.05 (5%) |
| 192 // - ATTENUATION_VOLUME: 0.02 (2%) |
| 193 // - FIXED_VOLUME: 0.01 (1%) |
| 194 // - UNKNOWN_VOLUME: 0.01 (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 Loading... |
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_ |
OLD | NEW |