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

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

Issue 2635983006: Final cleanup pass over audio device API (Closed)
Patch Set: rebase Created 3 years, 10 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 <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 virtual ~AudioService() {} 47 virtual ~AudioService() {}
48 48
49 // Called by listeners to this service to add/remove themselves as observers. 49 // Called by listeners to this service to add/remove themselves as observers.
50 virtual void AddObserver(Observer* observer) = 0; 50 virtual void AddObserver(Observer* observer) = 0;
51 virtual void RemoveObserver(Observer* observer) = 0; 51 virtual void RemoveObserver(Observer* observer) = 0;
52 52
53 // Start to query audio device information. Should be called on UI thread. 53 // Start to query audio device information. Should be called on UI thread.
54 // Populates |output_info_out| and |input_info_out| with the results. 54 // Populates |output_info_out| and |input_info_out| with the results.
55 // Returns true on success. 55 // Returns true on success.
56 // DEPRECATED: Use |GetDevices| instead.
56 virtual bool GetInfo(OutputInfo* output_info_out, 57 virtual bool GetInfo(OutputInfo* output_info_out,
57 InputInfo* input_info_out) = 0; 58 InputInfo* input_info_out) = 0;
58 59
60 // Retrieves list of audio devices that satisfy |filter|. Poulates
jennyz 2017/02/02 01:10:44 typo: Poulates -> Populates
tbarzic 2017/02/02 01:24:41 Done.
61 // |devices_out| with retrieved devices.
62 // If |filter->is_active| is set, |devices_out| will contain only devices
63 // whose is-active state matches |filter->is_active| value.
64 // If |filter->stream_types| is set, |devices_out| will contain only devices
65 // whose stream type (INPUT for input devices, OUTPUT for output devices) is
66 // contained in |filter->stream_types|.
67 // Returns whether the list of devices was successfully retrieved.
68 virtual bool GetDevices(const api::audio::DeviceFilter& filter,
69 DeviceInfoList* devices_out) = 0;
70
59 // Sets set of active inputs to devices defined by IDs in |input_devices|, 71 // Sets set of active inputs to devices defined by IDs in |input_devices|,
60 // and set of active outputs to devices defined by IDs in |output_devices|. 72 // and set of active outputs to devices defined by IDs in |output_devices|.
61 // If either of |input_devices| or |output_devices| is not set, associated 73 // If either of |input_devices| or |output_devices| is not set, associated
62 // set of active devices will remain unchanged. 74 // set of active devices will remain unchanged.
63 // If either list is empty, all active devices of associated type will be 75 // If either list is empty, all active devices of associated type will be
64 // deactivated. 76 // deactivated.
65 // Returns whether the operation succeeded - on failure there will be no 77 // Returns whether the operation succeeded - on failure there will be no
66 // changes to active devices. 78 // changes to active devices.
67 // Note that device ID lists should contain only existing device ID of 79 // Note that device ID lists should contain only existing device ID of
68 // appropriate type in order for the method to succeed. 80 // appropriate type in order for the method to succeed.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 protected: 113 protected:
102 AudioService() {} 114 AudioService() {}
103 115
104 private: 116 private:
105 DISALLOW_COPY_AND_ASSIGN(AudioService); 117 DISALLOW_COPY_AND_ASSIGN(AudioService);
106 }; 118 };
107 119
108 } // namespace extensions 120 } // namespace extensions
109 121
110 #endif // EXTENSIONS_BROWSER_API_AUDIO_AUDIO_SERVICE_H_ 122 #endif // EXTENSIONS_BROWSER_API_AUDIO_AUDIO_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698