OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_AUDIO_DEVICE_AUDIO_MIXER_MANAGER_MAC_H | 11 #ifndef WEBRTC_AUDIO_DEVICE_AUDIO_MIXER_MANAGER_MAC_H |
12 #define WEBRTC_AUDIO_DEVICE_AUDIO_MIXER_MANAGER_MAC_H | 12 #define WEBRTC_AUDIO_DEVICE_AUDIO_MIXER_MANAGER_MAC_H |
13 | 13 |
14 #include "webrtc/modules/audio_device/include/audio_device.h" | 14 #include "webrtc/modules/audio_device/include/audio_device.h" |
15 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | 15 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
16 #include "webrtc/typedefs.h" | 16 #include "webrtc/typedefs.h" |
17 | 17 |
18 #include <CoreAudio/CoreAudio.h> | 18 #include <CoreAudio/CoreAudio.h> |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 | |
22 class AudioMixerManagerMac | |
23 { | |
24 public: | |
25 int32_t OpenSpeaker(AudioDeviceID deviceID); | |
26 int32_t OpenMicrophone(AudioDeviceID deviceID); | |
27 int32_t SetSpeakerVolume(uint32_t volume); | |
28 int32_t SpeakerVolume(uint32_t& volume) const; | |
29 int32_t MaxSpeakerVolume(uint32_t& maxVolume) const; | |
30 int32_t MinSpeakerVolume(uint32_t& minVolume) const; | |
31 int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const; | |
32 int32_t SpeakerVolumeIsAvailable(bool& available); | |
33 int32_t SpeakerMuteIsAvailable(bool& available); | |
34 int32_t SetSpeakerMute(bool enable); | |
35 int32_t SpeakerMute(bool& enabled) const; | |
36 int32_t StereoPlayoutIsAvailable(bool& available); | |
37 int32_t StereoRecordingIsAvailable(bool& available); | |
38 int32_t MicrophoneMuteIsAvailable(bool& available); | |
39 int32_t SetMicrophoneMute(bool enable); | |
40 int32_t MicrophoneMute(bool& enabled) const; | |
41 int32_t MicrophoneBoostIsAvailable(bool& available); | |
42 int32_t SetMicrophoneBoost(bool enable); | |
43 int32_t MicrophoneBoost(bool& enabled) const; | |
44 int32_t MicrophoneVolumeIsAvailable(bool& available); | |
45 int32_t SetMicrophoneVolume(uint32_t volume); | |
46 int32_t MicrophoneVolume(uint32_t& volume) const; | |
47 int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const; | |
48 int32_t MinMicrophoneVolume(uint32_t& minVolume) const; | |
49 int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const; | |
50 int32_t Close(); | |
51 int32_t CloseSpeaker(); | |
52 int32_t CloseMicrophone(); | |
53 bool SpeakerIsInitialized() const; | |
54 bool MicrophoneIsInitialized() const; | |
55 | 21 |
56 public: | 22 class AudioMixerManagerMac { |
57 AudioMixerManagerMac(const int32_t id); | 23 public: |
58 ~AudioMixerManagerMac(); | 24 int32_t OpenSpeaker(AudioDeviceID deviceID); |
| 25 int32_t OpenMicrophone(AudioDeviceID deviceID); |
| 26 int32_t SetSpeakerVolume(uint32_t volume); |
| 27 int32_t SpeakerVolume(uint32_t& volume) const; |
| 28 int32_t MaxSpeakerVolume(uint32_t& maxVolume) const; |
| 29 int32_t MinSpeakerVolume(uint32_t& minVolume) const; |
| 30 int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const; |
| 31 int32_t SpeakerVolumeIsAvailable(bool& available); |
| 32 int32_t SpeakerMuteIsAvailable(bool& available); |
| 33 int32_t SetSpeakerMute(bool enable); |
| 34 int32_t SpeakerMute(bool& enabled) const; |
| 35 int32_t StereoPlayoutIsAvailable(bool& available); |
| 36 int32_t StereoRecordingIsAvailable(bool& available); |
| 37 int32_t MicrophoneMuteIsAvailable(bool& available); |
| 38 int32_t SetMicrophoneMute(bool enable); |
| 39 int32_t MicrophoneMute(bool& enabled) const; |
| 40 int32_t MicrophoneBoostIsAvailable(bool& available); |
| 41 int32_t SetMicrophoneBoost(bool enable); |
| 42 int32_t MicrophoneBoost(bool& enabled) const; |
| 43 int32_t MicrophoneVolumeIsAvailable(bool& available); |
| 44 int32_t SetMicrophoneVolume(uint32_t volume); |
| 45 int32_t MicrophoneVolume(uint32_t& volume) const; |
| 46 int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const; |
| 47 int32_t MinMicrophoneVolume(uint32_t& minVolume) const; |
| 48 int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const; |
| 49 int32_t Close(); |
| 50 int32_t CloseSpeaker(); |
| 51 int32_t CloseMicrophone(); |
| 52 bool SpeakerIsInitialized() const; |
| 53 bool MicrophoneIsInitialized() const; |
59 | 54 |
60 private: | 55 public: |
61 static void logCAMsg(const TraceLevel level, | 56 AudioMixerManagerMac(const int32_t id); |
62 const TraceModule module, | 57 ~AudioMixerManagerMac(); |
63 const int32_t id, const char *msg, | |
64 const char *err); | |
65 | 58 |
66 private: | 59 private: |
67 CriticalSectionWrapper& _critSect; | 60 static void logCAMsg(const TraceLevel level, |
68 int32_t _id; | 61 const TraceModule module, |
| 62 const int32_t id, |
| 63 const char* msg, |
| 64 const char* err); |
69 | 65 |
70 AudioDeviceID _inputDeviceID; | 66 private: |
71 AudioDeviceID _outputDeviceID; | 67 CriticalSectionWrapper& _critSect; |
| 68 int32_t _id; |
72 | 69 |
73 uint16_t _noInputChannels; | 70 AudioDeviceID _inputDeviceID; |
74 uint16_t _noOutputChannels; | 71 AudioDeviceID _outputDeviceID; |
75 | 72 |
| 73 uint16_t _noInputChannels; |
| 74 uint16_t _noOutputChannels; |
76 }; | 75 }; |
77 » | 76 |
78 } // namespace webrtc | 77 } // namespace webrtc |
79 | 78 |
80 #endif // AUDIO_MIXER_MAC_H | 79 #endif // AUDIO_MIXER_MAC_H |
OLD | NEW |