diff options
author | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-01 07:02:00 +0000 |
---|---|---|
committer | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-01 07:02:00 +0000 |
commit | 1784ad6252e50a5ca1a67026f53cb139490009cd (patch) | |
tree | 99a60deb561d5ff4db1b6dee6bf86b3499d6f914 /media/audio/linux | |
parent | 07f63c6bba7e33160fc54af7f2cf4cf207e0831b (diff) | |
download | chromium_src-1784ad6252e50a5ca1a67026f53cb139490009cd.zip chromium_src-1784ad6252e50a5ca1a67026f53cb139490009cd.tar.gz chromium_src-1784ad6252e50a5ca1a67026f53cb139490009cd.tar.bz2 |
Adds method to invoke platform provided audio input UI.
This will be used in a future CL by the speech input feature.
BUG=69886
TEST=none
Review URL: http://codereview.chromium.org/6602012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/linux')
-rw-r--r-- | media/audio/linux/audio_manager_linux.cc | 21 | ||||
-rw-r--r-- | media/audio/linux/audio_manager_linux.h | 2 |
2 files changed, 23 insertions, 0 deletions
diff --git a/media/audio/linux/audio_manager_linux.cc b/media/audio/linux/audio_manager_linux.cc index 4c92a6f..09c8625 100644 --- a/media/audio/linux/audio_manager_linux.cc +++ b/media/audio/linux/audio_manager_linux.cc @@ -5,7 +5,10 @@ #include "media/audio/linux/audio_manager_linux.h" #include "base/command_line.h" +#include "base/environment.h" #include "base/logging.h" +#include "base/nix/xdg_util.h" +#include "base/process_util.h" #include "media/audio/audio_output_dispatcher.h" #include "media/audio/fake_audio_input_stream.h" #include "media/audio/fake_audio_output_stream.h" @@ -130,6 +133,24 @@ void AudioManagerLinux::ReleaseOutputStream(AlsaPcmOutputStream* stream) { } } +bool AudioManagerLinux::CanShowAudioInputSettings() { + scoped_ptr<base::Environment> env(base::Environment::Create()); + base::nix::DesktopEnvironment desktop = base::nix::GetDesktopEnvironment( + env.get()); + return (desktop == base::nix::DESKTOP_ENVIRONMENT_GNOME || + desktop == base::nix::DESKTOP_ENVIRONMENT_KDE3 || + desktop == base::nix::DESKTOP_ENVIRONMENT_KDE4); +} + +void AudioManagerLinux::ShowAudioInputSettings() { + scoped_ptr<base::Environment> env(base::Environment::Create()); + base::nix::DesktopEnvironment desktop = base::nix::GetDesktopEnvironment( + env.get()); + std::string command((desktop == base::nix::DESKTOP_ENVIRONMENT_GNOME) ? + "gnome-volume-control" : "kmix"); + base::LaunchApp(CommandLine(FilePath(command)), false, false, NULL); +} + // static AudioManager* AudioManager::CreateAudioManager() { return new AudioManagerLinux(); diff --git a/media/audio/linux/audio_manager_linux.h b/media/audio/linux/audio_manager_linux.h index b657966..ca759f0 100644 --- a/media/audio/linux/audio_manager_linux.h +++ b/media/audio/linux/audio_manager_linux.h @@ -28,6 +28,8 @@ class AudioManagerLinux : public AudioManagerBase { virtual bool HasAudioInputDevices(); virtual AudioOutputStream* MakeAudioOutputStream(AudioParameters params); virtual AudioInputStream* MakeAudioInputStream(AudioParameters params); + virtual bool CanShowAudioInputSettings(); + virtual void ShowAudioInputSettings(); virtual void MuteAll(); virtual void UnMuteAll(); |