OLD | NEW |
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 #include "chrome/browser/chromeos/audio_mixer_alsa.h" | 5 #include "chrome/browser/chromeos/audio_mixer_alsa.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include <alsa/asoundlib.h> | 9 #include <alsa/asoundlib.h> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/task.h" | 13 #include "base/task.h" |
14 #include "base/threading/thread_restrictions.h" | 14 #include "base/threading/thread_restrictions.h" |
15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
16 #include "chrome/browser/browser_thread.h" | |
17 #include "chrome/browser/prefs/pref_service.h" | 16 #include "chrome/browser/prefs/pref_service.h" |
18 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 18 #include "content/browser/browser_thread.h" |
19 | 19 |
20 namespace chromeos { | 20 namespace chromeos { |
21 | 21 |
22 // Connect to the ALSA mixer using their simple element API. Init is performed | 22 // Connect to the ALSA mixer using their simple element API. Init is performed |
23 // asynchronously on the worker thread. | 23 // asynchronously on the worker thread. |
24 // | 24 // |
25 // To get a wider range and finer control over volume levels, first the Master | 25 // To get a wider range and finer control over volume levels, first the Master |
26 // level is set, then if the PCM element exists, the total level is refined by | 26 // level is set, then if the PCM element exists, the total level is refined by |
27 // adjusting that as well. If the PCM element has more volume steps, it allows | 27 // adjusting that as well. If the PCM element has more volume steps, it allows |
28 // for finer granularity in the total volume. | 28 // for finer granularity in the total volume. |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 if (alsa_result != 0) { | 513 if (alsa_result != 0) { |
514 LOG(WARNING) << "snd_mixer_selem_set_playback_switch_all() failed: " | 514 LOG(WARNING) << "snd_mixer_selem_set_playback_switch_all() failed: " |
515 << snd_strerror(alsa_result); | 515 << snd_strerror(alsa_result); |
516 } else { | 516 } else { |
517 VLOG(1) << "Set playback switch " << snd_mixer_selem_get_name(elem) | 517 VLOG(1) << "Set playback switch " << snd_mixer_selem_get_name(elem) |
518 << " to " << enabled; | 518 << " to " << enabled; |
519 } | 519 } |
520 } | 520 } |
521 | 521 |
522 } // namespace chromeos | 522 } // namespace chromeos |
OLD | NEW |