summaryrefslogtreecommitdiff
path: root/sound/sounddevicelocator.h
blob: 4e8e1485aba3cb749ad90a2e4ff62650b3a77c5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 *  Copyright 2004 The WebRTC Project Authors. All rights reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#ifndef WEBRTC_SOUND_SOUNDDEVICELOCATOR_H_
#define WEBRTC_SOUND_SOUNDDEVICELOCATOR_H_

#include <string>

#include "webrtc/base/constructormagic.h"

namespace rtc {

// A simple container for holding the name of a device and any additional id
// information needed to locate and open it. Implementations of
// SoundSystemInterface must subclass this to add any id information that they
// need.
class SoundDeviceLocator {
 public:
  virtual ~SoundDeviceLocator() {}

  // Human-readable name for the device.
  const std::string &name() const { return name_; }

  // Name sound system uses to locate this device.
  const std::string &device_name() const { return device_name_; }

  // Makes a duplicate of this locator.
  virtual SoundDeviceLocator *Copy() const = 0;

 protected:
  SoundDeviceLocator(const std::string &name,
                     const std::string &device_name)
      : name_(name), device_name_(device_name) {}

  explicit SoundDeviceLocator(const SoundDeviceLocator &that)
      : name_(that.name_), device_name_(that.device_name_) {}

  std::string name_;
  std::string device_name_;

 private:
  DISALLOW_ASSIGN(SoundDeviceLocator);
};

}  // namespace rtc

#endif  // WEBRTC_SOUND_SOUNDDEVICELOCATOR_H_