/src/mozilla-central/dom/media/AudioDeviceInfo.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
3 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | | |
6 | | #ifndef MOZILLA_AudioDeviceInfo_H |
7 | | #define MOZILLA_AudioDeviceInfo_H |
8 | | |
9 | | #include "nsIAudioDeviceInfo.h" |
10 | | #include "CubebUtils.h" |
11 | | #include "mozilla/Maybe.h" |
12 | | |
13 | | // This is mapped to the cubeb_device_info. |
14 | | class AudioDeviceInfo final : public nsIAudioDeviceInfo |
15 | | { |
16 | | public: |
17 | | NS_DECL_THREADSAFE_ISUPPORTS |
18 | | NS_DECL_NSIAUDIODEVICEINFO |
19 | | |
20 | | using AudioDeviceID = mozilla::CubebUtils::AudioDeviceID; |
21 | | |
22 | | AudioDeviceInfo(const AudioDeviceID aID, |
23 | | const nsAString& aName, |
24 | | const nsAString& aGroupId, |
25 | | const nsAString& aVendor, |
26 | | uint16_t aType, |
27 | | uint16_t aState, |
28 | | uint16_t aPreferred, |
29 | | uint16_t aSupportedFormat, |
30 | | uint16_t aDefaultFormat, |
31 | | uint32_t aMaxChannels, |
32 | | uint32_t aDefaultRate, |
33 | | uint32_t aMaxRate, |
34 | | uint32_t aMinRate, |
35 | | uint32_t aMaxLatency, |
36 | | uint32_t aMinLatency); |
37 | | explicit AudioDeviceInfo(cubeb_device_info* aInfo); |
38 | | |
39 | | AudioDeviceID DeviceID() const; |
40 | | const nsString& Name() const; |
41 | | uint32_t MaxChannels() const; |
42 | | uint32_t Type() const; |
43 | | uint32_t State() const; |
44 | | bool Preferred() const; |
45 | | private: |
46 | 0 | virtual ~AudioDeviceInfo() = default; |
47 | | |
48 | | const AudioDeviceID mDeviceId; |
49 | | const nsString mName; |
50 | | const nsString mGroupId; |
51 | | const nsString mVendor; |
52 | | const uint16_t mType; |
53 | | const uint16_t mState; |
54 | | const uint16_t mPreferred; |
55 | | const uint16_t mSupportedFormat; |
56 | | const uint16_t mDefaultFormat; |
57 | | const uint32_t mMaxChannels; |
58 | | const uint32_t mDefaultRate; |
59 | | const uint32_t mMaxRate; |
60 | | const uint32_t mMinRate; |
61 | | const uint32_t mMaxLatency; |
62 | | const uint32_t mMinLatency; |
63 | | }; |
64 | | |
65 | | #endif // MOZILLA_AudioDeviceInfo_H |