OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/arc/audio/arc_audio_bridge.h" | 5 #include "components/arc/audio/arc_audio_bridge.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chromeos/audio/audio_device.h" | 8 #include "chromeos/audio/audio_device.h" |
9 | 9 |
10 namespace arc { | 10 namespace arc { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 VLOG(1) << "HEADPHONE " << headphone_inserted | 43 VLOG(1) << "HEADPHONE " << headphone_inserted |
44 << " MICROPHONE " << microphone_inserted; | 44 << " MICROPHONE " << microphone_inserted; |
45 SendSwitchState(headphone_inserted, microphone_inserted); | 45 SendSwitchState(headphone_inserted, microphone_inserted); |
46 } | 46 } |
47 | 47 |
48 void ArcAudioBridge::SendSwitchState(bool headphone_inserted, | 48 void ArcAudioBridge::SendSwitchState(bool headphone_inserted, |
49 bool microphone_inserted) { | 49 bool microphone_inserted) { |
50 uint32_t switch_state = 0; | 50 uint32_t switch_state = 0; |
51 if (headphone_inserted) { | 51 if (headphone_inserted) { |
52 switch_state |= | 52 switch_state |= |
53 (1 << static_cast<uint32_t>(AudioSwitch::SW_HEADPHONE_INSERT)); | 53 (1 << static_cast<uint32_t>(mojom::AudioSwitch::SW_HEADPHONE_INSERT)); |
54 } | 54 } |
55 if (microphone_inserted) { | 55 if (microphone_inserted) { |
56 switch_state |= | 56 switch_state |= |
57 (1 << static_cast<uint32_t>(AudioSwitch::SW_MICROPHONE_INSERT)); | 57 (1 << static_cast<uint32_t>(mojom::AudioSwitch::SW_MICROPHONE_INSERT)); |
58 } | 58 } |
59 | 59 |
60 VLOG(1) << "Send switch state " << switch_state; | 60 VLOG(1) << "Send switch state " << switch_state; |
61 AudioInstance* audio_instance = arc_bridge_service()->audio_instance(); | 61 mojom::AudioInstance* audio_instance = arc_bridge_service()->audio_instance(); |
62 if (audio_instance) | 62 if (audio_instance) |
63 audio_instance->NotifySwitchState(switch_state); | 63 audio_instance->NotifySwitchState(switch_state); |
64 } | 64 } |
65 | 65 |
66 } // namespace arc | 66 } // namespace arc |
OLD | NEW |