Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Side by Side Diff: media/audio/win/audio_manager_win.cc

Issue 6602012: Adds method to invoke platform provided audio input UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/audio/win/audio_manager_win.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "media/audio/audio_io.h" 5 #include "media/audio/audio_io.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <objbase.h> // This has to be before initguid.h 8 #include <objbase.h> // This has to be before initguid.h
9 #include <initguid.h> 9 #include <initguid.h>
10 #include <mmsystem.h> 10 #include <mmsystem.h>
11 #include <setupapi.h> 11 #include <setupapi.h>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/command_line.h"
15 #include "base/file_path.h"
16 #include "base/path_service.h"
17 #include "base/process_util.h"
14 #include "base/scoped_ptr.h" 18 #include "base/scoped_ptr.h"
15 #include "base/string_number_conversions.h" 19 #include "base/string_number_conversions.h"
16 #include "base/string_util.h" 20 #include "base/string_util.h"
21 #include "base/win/windows_version.h"
17 #include "media/audio/fake_audio_input_stream.h" 22 #include "media/audio/fake_audio_input_stream.h"
18 #include "media/audio/fake_audio_output_stream.h" 23 #include "media/audio/fake_audio_output_stream.h"
19 #include "media/audio/win/audio_manager_win.h" 24 #include "media/audio/win/audio_manager_win.h"
20 #include "media/audio/win/wavein_input_win.h" 25 #include "media/audio/win/wavein_input_win.h"
21 #include "media/audio/win/waveout_output_win.h" 26 #include "media/audio/win/waveout_output_win.h"
22 #include "media/base/limits.h" 27 #include "media/base/limits.h"
23 28
24 // Libraries required for the SetupAPI and Wbem APIs used here. 29 // Libraries required for the SetupAPI and Wbem APIs used here.
25 #pragma comment(lib, "setupapi.lib") 30 #pragma comment(lib, "setupapi.lib")
26 31
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 227
223 bool device_found = (device_interface_name == interface_detail->DevicePath); 228 bool device_found = (device_interface_name == interface_detail->DevicePath);
224 229
225 if (device_found) 230 if (device_found)
226 return GetDeviceAndDriverInfo(device_info, &device_data); 231 return GetDeviceAndDriverInfo(device_info, &device_data);
227 } 232 }
228 233
229 return string16(); 234 return string16();
230 } 235 }
231 236
237 bool AudioManagerWin::CanShowAudioInputSettings() {
238 return true;
239 }
240
241 void AudioManagerWin::ShowAudioInputSettings() {
242 std::wstring program;
243 std::string argument;
244 if (base::win::GetVersion() <= base::win::VERSION_XP) {
245 program = L"sndvol32.exe";
246 argument = "-R";
247 } else {
248 program = L"control.exe";
249 argument = "mmsys.cpl,,1";
250 }
251
252 FilePath path;
253 PathService::Get(base::DIR_SYSTEM, &path);
254 path = path.Append(program);
255 CommandLine command_line(path);
256 command_line.AppendArg(argument);
257 base::LaunchApp(command_line, false, false, NULL);
258 }
259
232 // static 260 // static
233 AudioManager* AudioManager::CreateAudioManager() { 261 AudioManager* AudioManager::CreateAudioManager() {
234 return new AudioManagerWin(); 262 return new AudioManagerWin();
235 } 263 }
OLDNEW
« no previous file with comments | « media/audio/win/audio_manager_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698