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

Side by Side Diff: chrome/browser/chromeos/audio_handler.h

Issue 5711001: Add a new GetInstance() method for remaining files with singleton classes under chrome/browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 CHROME_BROWSER_CHROMEOS_AUDIO_HANDLER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_AUDIO_HANDLER_H_
6 #define CHROME_BROWSER_CHROMEOS_AUDIO_HANDLER_H_ 6 #define CHROME_BROWSER_CHROMEOS_AUDIO_HANDLER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "base/singleton.h" 10 #include "base/singleton.h"
joth 2010/12/09 15:06:40 remove, fwd declare traits
11 11
12 namespace chromeos { 12 namespace chromeos {
13 13
14 class PulseAudioMixer; 14 class PulseAudioMixer;
15 15
16 class AudioHandler { 16 class AudioHandler {
17 public: 17 public:
18 static AudioHandler* instance() { 18 static AudioHandler* instance();
19 return Singleton<AudioHandler>::get();
20 }
21 19
22 // Get volume level in our internal 0-100% range, 0 being pure silence. 20 // Get volume level in our internal 0-100% range, 0 being pure silence.
23 // Volume may go above 100% if another process changes PulseAudio's volume. 21 // Volume may go above 100% if another process changes PulseAudio's volume.
24 // Returns default of 0 on error. This function will block until the volume 22 // Returns default of 0 on error. This function will block until the volume
25 // is retrieved or fails. Blocking call. 23 // is retrieved or fails. Blocking call.
26 double GetVolumePercent(); 24 double GetVolumePercent();
27 25
28 // Set volume level from 0-100%. Volumes above 100% are OK and boost volume, 26 // Set volume level from 0-100%. Volumes above 100% are OK and boost volume,
29 // although clipping will occur more at higher volumes. Volume gets quieter 27 // although clipping will occur more at higher volumes. Volume gets quieter
30 // as the percentage gets lower, and then switches to silence at 0%. 28 // as the percentage gets lower, and then switches to silence at 0%.
(...skipping 30 matching lines...) Expand all
61 bool connected_; 59 bool connected_;
62 int reconnect_tries_; 60 int reconnect_tries_;
63 61
64 DISALLOW_COPY_AND_ASSIGN(AudioHandler); 62 DISALLOW_COPY_AND_ASSIGN(AudioHandler);
65 }; 63 };
66 64
67 } // namespace chromeos 65 } // namespace chromeos
68 66
69 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_HANDLER_H_ 67 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_HANDLER_H_
70 68
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698