1/*
2 *  Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 *
4 *  Use of this source code is governed by a BSD-style license
5 *  that can be found in the LICENSE file in the root of the source
6 *  tree. An additional intellectual property rights grant can be found
7 *  in the file PATENTS.  All contributing project authors may
8 *  be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef WEBRTC_SOUND_SOUNDSYSTEMPROXY_H_
12#define WEBRTC_SOUND_SOUNDSYSTEMPROXY_H_
13
14#include "webrtc/sound/soundsysteminterface.h"
15#include "webrtc/base/basictypes.h"  // for NULL
16
17namespace rtc {
18
19// A SoundSystemProxy is a sound system that defers to another one.
20// Init(), Terminate(), and GetName() are left as pure virtual, so a sub-class
21// must define them.
22class SoundSystemProxy : public SoundSystemInterface {
23 public:
24  SoundSystemProxy() : wrapped_(NULL) {}
25
26  // Each of these methods simply defers to wrapped_ if non-NULL, else fails.
27
28  virtual bool EnumeratePlaybackDevices(SoundDeviceLocatorList *devices);
29  virtual bool EnumerateCaptureDevices(SoundDeviceLocatorList *devices);
30
31  virtual bool GetDefaultPlaybackDevice(SoundDeviceLocator **device);
32  virtual bool GetDefaultCaptureDevice(SoundDeviceLocator **device);
33
34  virtual SoundOutputStreamInterface *OpenPlaybackDevice(
35      const SoundDeviceLocator *device,
36      const OpenParams &params);
37  virtual SoundInputStreamInterface *OpenCaptureDevice(
38      const SoundDeviceLocator *device,
39      const OpenParams &params);
40
41 protected:
42  SoundSystemInterface *wrapped_;
43};
44
45}  // namespace rtc
46
47#endif  // WEBRTC_SOUND_SOUNDSYSTEMPROXY_H_
48