| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_MIXER_ALSA_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_AUDIO_MIXER_ALSA_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_AUDIO_MIXER_ALSA_H_ | 6 #define CHROME_BROWSER_CHROMEOS_AUDIO_MIXER_ALSA_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | |
| 11 | 10 |
| 12 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 13 #include "base/callback_old.h" | 12 #include "base/callback_old.h" |
| 14 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
| 16 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
| 17 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
| 18 #include "chrome/browser/chromeos/audio_mixer.h" | 17 #include "chrome/browser/chromeos/audio_mixer.h" |
| 19 | 18 |
| 20 class PrefService; | 19 class PrefService; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 94 |
| 96 // Most recently requested muting state. | 95 // Most recently requested muting state. |
| 97 bool is_muted_; | 96 bool is_muted_; |
| 98 | 97 |
| 99 // Is there already a pending call to ApplyState() scheduled on |thread_|? | 98 // Is there already a pending call to ApplyState() scheduled on |thread_|? |
| 100 bool apply_is_pending_; | 99 bool apply_is_pending_; |
| 101 | 100 |
| 102 // Connection to ALSA. NULL if not connected. | 101 // Connection to ALSA. NULL if not connected. |
| 103 _snd_mixer* alsa_mixer_; | 102 _snd_mixer* alsa_mixer_; |
| 104 | 103 |
| 105 // Master mixers (some hardware has e.g. separate headphone and speaker | 104 // Master mixer. |
| 106 // elements). | 105 _snd_mixer_elem* master_element_; |
| 107 std::vector<_snd_mixer_elem*> master_elements_; | |
| 108 | 106 |
| 109 // PCM mixer. May be NULL if the driver doesn't expose one. | 107 // PCM mixer. May be NULL if the driver doesn't expose one. |
| 110 _snd_mixer_elem* pcm_element_; | 108 _snd_mixer_elem* pcm_element_; |
| 111 | 109 |
| 112 PrefService* prefs_; | 110 PrefService* prefs_; |
| 113 | 111 |
| 114 // Signalled after Disconnect() finishes (which is itself invoked by the | 112 // Signalled after Disconnect() finishes (which is itself invoked by the |
| 115 // d'tor). | 113 // d'tor). |
| 116 base::WaitableEvent disconnected_event_; | 114 base::WaitableEvent disconnected_event_; |
| 117 | 115 |
| 118 // Background thread used for interacting with ALSA. | 116 // Background thread used for interacting with ALSA. |
| 119 scoped_ptr<base::Thread> thread_; | 117 scoped_ptr<base::Thread> thread_; |
| 120 | 118 |
| 121 // Number of times that we've attempted to connect to ALSA. Just used to keep | 119 // Number of times that we've attempted to connect to ALSA. Just used to keep |
| 122 // us from spamming the logs. | 120 // us from spamming the logs. |
| 123 int num_connection_attempts_; | 121 int num_connection_attempts_; |
| 124 | 122 |
| 125 DISALLOW_COPY_AND_ASSIGN(AudioMixerAlsa); | 123 DISALLOW_COPY_AND_ASSIGN(AudioMixerAlsa); |
| 126 }; | 124 }; |
| 127 | 125 |
| 128 } // namespace chromeos | 126 } // namespace chromeos |
| 129 | 127 |
| 130 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::AudioMixerAlsa); | 128 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::AudioMixerAlsa); |
| 131 | 129 |
| 132 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_MIXER_ALSA_H_ | 130 #endif // CHROME_BROWSER_CHROMEOS_AUDIO_MIXER_ALSA_H_ |
| OLD | NEW |