From f76f3405ad9bae1ef3725046169f7cc4e34a6dbb Mon Sep 17 00:00:00 2001 From: chinyue Date: Thu, 30 Apr 2015 18:46:23 -0700 Subject: Do not display CRAS loopback devices on UI. Both POST_MIX and POST_DSP loopback devices are filtered out. BUG=479848 Review URL: https://codereview.chromium.org/1116643005 Cr-Commit-Position: refs/heads/master@{#327863} --- ash/system/chromeos/audio/audio_detailed_view.cc | 4 +++- chromeos/audio/audio_device.cc | 10 ++++++++++ chromeos/audio/audio_device.h | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ash/system/chromeos/audio/audio_detailed_view.cc b/ash/system/chromeos/audio/audio_detailed_view.cc index 3b023d8..fa1438b 100644 --- a/ash/system/chromeos/audio/audio_detailed_view.cc +++ b/ash/system/chromeos/audio/audio_detailed_view.cc @@ -118,7 +118,9 @@ void AudioDetailedView::UpdateAudioDevices() { for (size_t i = 0; i < devices.size(); ++i) { // Don't display keyboard mic or aokr type. if (devices[i].type == chromeos::AUDIO_TYPE_KEYBOARD_MIC || - devices[i].type == chromeos::AUDIO_TYPE_AOKR) + devices[i].type == chromeos::AUDIO_TYPE_AOKR || + devices[i].type == chromeos::AUDIO_TYPE_POST_MIX_LOOPBACK || + devices[i].type == chromeos::AUDIO_TYPE_POST_DSP_LOOPBACK) continue; if (devices[i].is_input) input_devices_.push_back(devices[i]); diff --git a/chromeos/audio/audio_device.cc b/chromeos/audio/audio_device.cc index 4f4b18c..32012a1 100644 --- a/chromeos/audio/audio_device.cc +++ b/chromeos/audio/audio_device.cc @@ -29,6 +29,8 @@ uint8 GetDevicePriority(AudioDeviceType type) { return 1; case AUDIO_TYPE_KEYBOARD_MIC: case AUDIO_TYPE_AOKR: + case AUDIO_TYPE_POST_MIX_LOOPBACK: + case AUDIO_TYPE_POST_DSP_LOOPBACK: case AUDIO_TYPE_OTHER: default: return 0; @@ -58,6 +60,10 @@ std::string AudioDevice::GetTypeString(AudioDeviceType type) { return "KEYBOARD_MIC"; case AUDIO_TYPE_AOKR: return "AOKR"; + case AUDIO_TYPE_POST_MIX_LOOPBACK: + return "POST_MIX_LOOPBACK"; + case AUDIO_TYPE_POST_DSP_LOOPBACK: + return "POST_DSP_LOOPBACK"; case AUDIO_TYPE_OTHER: default: return "OTHER"; @@ -85,6 +91,10 @@ AudioDeviceType AudioDevice::GetAudioType( return AUDIO_TYPE_INTERNAL_SPEAKER; else if (node_type.find("AOKR") != std::string::npos) return AUDIO_TYPE_AOKR; + else if (node_type.find("POST_MIX_LOOPBACK") != std::string::npos) + return AUDIO_TYPE_POST_MIX_LOOPBACK; + else if (node_type.find("POST_DSP_LOOPBACK") != std::string::npos) + return AUDIO_TYPE_POST_DSP_LOOPBACK; else return AUDIO_TYPE_OTHER; } diff --git a/chromeos/audio/audio_device.h b/chromeos/audio/audio_device.h index 6ca1eb0..67dca1c 100644 --- a/chromeos/audio/audio_device.h +++ b/chromeos/audio/audio_device.h @@ -26,6 +26,8 @@ enum AudioDeviceType { AUDIO_TYPE_INTERNAL_MIC, AUDIO_TYPE_KEYBOARD_MIC, AUDIO_TYPE_AOKR, + AUDIO_TYPE_POST_MIX_LOOPBACK, + AUDIO_TYPE_POST_DSP_LOOPBACK, AUDIO_TYPE_OTHER, }; -- cgit v1.1