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

Side by Side Diff: extensions/browser/api/audio/audio_service.h

Issue 2578473002: chrome.audio API: treat mute as system wide property (Closed)
Patch Set: . Created 3 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 EXTENSIONS_BROWSER_API_AUDIO_AUDIO_SERVICE_H_ 5 #ifndef EXTENSIONS_BROWSER_API_AUDIO_AUDIO_SERVICE_H_
6 #define EXTENSIONS_BROWSER_API_AUDIO_AUDIO_SERVICE_H_ 6 #define EXTENSIONS_BROWSER_API_AUDIO_AUDIO_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // Sets the active devices to the devices specified by |device_list|. 58 // Sets the active devices to the devices specified by |device_list|.
59 // It can pass in the "complete" active device list of either input 59 // It can pass in the "complete" active device list of either input
60 // devices, or output devices, or both. If only input devices are passed in, 60 // devices, or output devices, or both. If only input devices are passed in,
61 // it will only change the input devices' active status, output devices will 61 // it will only change the input devices' active status, output devices will
62 // NOT be changed; similarly for the case if only output devices are passed. 62 // NOT be changed; similarly for the case if only output devices are passed.
63 // If the devices specified in |new_active_ids| are already active, they will 63 // If the devices specified in |new_active_ids| are already active, they will
64 // remain active. Otherwise, the old active devices will be de-activated 64 // remain active. Otherwise, the old active devices will be de-activated
65 // before we activate the new devices with the same type(input/output). 65 // before we activate the new devices with the same type(input/output).
66 virtual void SetActiveDevices(const DeviceIdList& device_list) = 0; 66 virtual void SetActiveDevices(const DeviceIdList& device_list) = 0;
67 67
68 // Set the muted and volume/gain properties of a device. 68 // Set the sound level properties (volume or gain) of a device.
69 virtual bool SetDeviceProperties(const std::string& device_id, 69 virtual bool SetDeviceSoundLevel(const std::string& device_id,
70 bool muted,
71 int volume, 70 int volume,
72 int gain) = 0; 71 int gain) = 0;
73 72
73 // Sets the mute property of a device.
74 virtual bool SetMuteForDevice(const std::string& device_id, bool value) = 0;
75
76 // Sets mute property for audio input (if |is_input| is true) or output (if
77 // |is_input| is false).
78 // Note that the value set here is never persisted on the device - it will be
79 // reset after user session ends.
80 virtual bool SetMute(bool is_input, bool value) = 0;
81
82 // Gets mute property for audio input (if |is_input| is true) or output (if
83 // |is_input| is false).
84 // The mute value is returned via |mute| argument.
85 // The method returns whether the value was successfully fetched.
86 virtual bool GetMute(bool is_input, bool* mute) = 0;
87
74 protected: 88 protected:
75 AudioService() {} 89 AudioService() {}
76 90
77 private: 91 private:
78 DISALLOW_COPY_AND_ASSIGN(AudioService); 92 DISALLOW_COPY_AND_ASSIGN(AudioService);
79 }; 93 };
80 94
81 } // namespace extensions 95 } // namespace extensions
82 96
83 #endif // EXTENSIONS_BROWSER_API_AUDIO_AUDIO_SERVICE_H_ 97 #endif // EXTENSIONS_BROWSER_API_AUDIO_AUDIO_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698