Removes parts of the webrtc::VoEVolumeControl sub API as part of a clean-up operation where the goal is to remove unused APIs.
BUG=3206
R=niklas.enbom@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/12519004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6145 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/voice_engine/include/voe_volume_control.h b/voice_engine/include/voe_volume_control.h
index c67d984..89b64c1 100644
--- a/voice_engine/include/voe_volume_control.h
+++ b/voice_engine/include/voe_volume_control.h
@@ -62,12 +62,6 @@
// Gets the speaker |volume| level.
virtual int GetSpeakerVolume(unsigned int& volume) = 0;
- // Mutes the speaker device completely in the operating system.
- virtual int SetSystemOutputMute(bool enable) = 0;
-
- // Gets the output device mute state in the operating system.
- virtual int GetSystemOutputMute(bool &enabled) = 0;
-
// Sets the microphone volume level. Valid range is [0,255].
virtual int SetMicVolume(unsigned int volume) = 0;
@@ -81,12 +75,6 @@
// Gets the current microphone input mute state.
virtual int GetInputMute(int channel, bool& enabled) = 0;
- // Mutes the microphone device completely in the operating system.
- virtual int SetSystemInputMute(bool enable) = 0;
-
- // Gets the mute state of the input device in the operating system.
- virtual int GetSystemInputMute(bool& enabled) = 0;
-
// Gets the microphone speech |level|, mapped non-linearly to the range
// [0,9].
virtual int GetSpeechInputLevel(unsigned int& level) = 0;
@@ -117,6 +105,12 @@
// Gets the current left and right scaling factors.
virtual int GetOutputVolumePan(int channel, float& left, float& right) = 0;
+ // Don't use. Will be removed.
+ virtual int SetSystemOutputMute(bool enable) { return -1; }
+ virtual int GetSystemOutputMute(bool &enabled) { return -1; }
+ virtual int SetSystemInputMute(bool enable) { return -1; }
+ virtual int GetSystemInputMute(bool& enabled) { return -1; }
+
protected:
VoEVolumeControl() {};
virtual ~VoEVolumeControl() {};
diff --git a/voice_engine/test/auto_test/standard/volume_test.cc b/voice_engine/test/auto_test/standard/volume_test.cc
index 3e79430..a59f134 100644
--- a/voice_engine/test/auto_test/standard/volume_test.cc
+++ b/voice_engine/test/auto_test/standard/volume_test.cc
@@ -188,58 +188,6 @@
Sleep(2000);
}
-TEST_F(VolumeTest, DISABLED_ON_LINUX(SystemInputMutingIsNotEnabledByDefault)) {
- bool is_muted = true;
- EXPECT_EQ(0, voe_volume_control_->GetSystemInputMute(is_muted));
- EXPECT_FALSE(is_muted);
-}
-
-TEST_F(VolumeTest, DISABLED_ON_LINUX(ManualSystemInputMutingMutesMicrophone)) {
- SwitchToManualMicrophone();
-
- // Enable system input muting.
- EXPECT_EQ(0, voe_volume_control_->SetSystemInputMute(true));
- bool is_muted = false;
- EXPECT_EQ(0, voe_volume_control_->GetSystemInputMute(is_muted));
- EXPECT_TRUE(is_muted);
-
- TEST_LOG("Muted: talk into microphone and verify you can't hear yourself.\n");
- Sleep(2000);
-
- // Test that we can disable system input muting.
- EXPECT_EQ(0, voe_volume_control_->SetSystemInputMute(false));
- EXPECT_EQ(0, voe_volume_control_->GetSystemInputMute(is_muted));
- EXPECT_FALSE(is_muted);
-
- TEST_LOG("Unmuted: talk into microphone and verify you can hear yourself.\n");
- Sleep(2000);
-}
-
-TEST_F(VolumeTest, DISABLED_ON_LINUX(SystemOutputMutingIsNotEnabledByDefault)) {
- bool is_muted = true;
- EXPECT_EQ(0, voe_volume_control_->GetSystemOutputMute(is_muted));
- EXPECT_FALSE(is_muted);
-}
-
-TEST_F(VolumeTest, ManualSystemOutputMutingMutesOutput) {
- // Enable muting.
- EXPECT_EQ(0, voe_volume_control_->SetSystemOutputMute(true));
- bool is_muted = false;
- EXPECT_EQ(0, voe_volume_control_->GetSystemOutputMute(is_muted));
- EXPECT_TRUE(is_muted);
-
- TEST_LOG("Muted: you should hear no audio.\n");
- Sleep(2000);
-
- // Test that we can disable muting.
- EXPECT_EQ(0, voe_volume_control_->SetSystemOutputMute(false));
- EXPECT_EQ(0, voe_volume_control_->GetSystemOutputMute(is_muted));
- EXPECT_FALSE(is_muted);
-
- TEST_LOG("Unmuted: you should hear audio.\n");
- Sleep(2000);
-}
-
TEST_F(VolumeTest, ManualTestInputAndOutputLevels) {
SwitchToManualMicrophone();
diff --git a/voice_engine/voe_volume_control_impl.cc b/voice_engine/voe_volume_control_impl.cc
index e47090d..f27c4ff 100644
--- a/voice_engine/voe_volume_control_impl.cc
+++ b/voice_engine/voe_volume_control_impl.cc
@@ -129,50 +129,6 @@
return 0;
}
-int VoEVolumeControlImpl::SetSystemOutputMute(bool enable)
-{
- WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
- "GetSystemOutputMute(enabled=%d)", enable);
-
- if (!_shared->statistics().Initialized())
- {
- _shared->SetLastError(VE_NOT_INITED, kTraceError);
- return -1;
- }
-
- if (_shared->audio_device()->SetSpeakerMute(enable) != 0)
- {
- _shared->SetLastError(VE_GET_MIC_VOL_ERROR, kTraceError,
- "SpeakerMute() unable to Set speaker mute");
- return -1;
- }
-
- return 0;
-}
-
-int VoEVolumeControlImpl::GetSystemOutputMute(bool& enabled)
-{
- WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
- "GetSystemOutputMute(enabled=?)");
-
- if (!_shared->statistics().Initialized())
- {
- _shared->SetLastError(VE_NOT_INITED, kTraceError);
- return -1;
- }
-
- if (_shared->audio_device()->SpeakerMute(&enabled) != 0)
- {
- _shared->SetLastError(VE_GET_MIC_VOL_ERROR, kTraceError,
- "SpeakerMute() unable to get speaker mute state");
- return -1;
- }
- WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
- VoEId(_shared->instance_id(), -1),
- "GetSystemOutputMute() => %d", enabled);
- return 0;
-}
-
int VoEVolumeControlImpl::SetMicVolume(unsigned int volume)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
@@ -332,50 +288,6 @@
return 0;
}
-int VoEVolumeControlImpl::SetSystemInputMute(bool enable)
-{
- WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
- "SetSystemInputMute(enabled=%d)", enable);
-
- if (!_shared->statistics().Initialized())
- {
- _shared->SetLastError(VE_NOT_INITED, kTraceError);
- return -1;
- }
-
- if (_shared->audio_device()->SetMicrophoneMute(enable) != 0)
- {
- _shared->SetLastError(VE_GET_MIC_VOL_ERROR, kTraceError,
- "MicrophoneMute() unable to set microphone mute state");
- return -1;
- }
-
- return 0;
-}
-
-int VoEVolumeControlImpl::GetSystemInputMute(bool& enabled)
-{
- WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
- "GetSystemInputMute(enabled=?)");
-
- if (!_shared->statistics().Initialized())
- {
- _shared->SetLastError(VE_NOT_INITED, kTraceError);
- return -1;
- }
-
- if (_shared->audio_device()->MicrophoneMute(&enabled) != 0)
- {
- _shared->SetLastError(VE_GET_MIC_VOL_ERROR, kTraceError,
- "MicrophoneMute() unable to get microphone mute state");
- return -1;
- }
- WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
- VoEId(_shared->instance_id(), -1),
- "GetSystemInputMute() => %d", enabled);
- return 0;
-}
-
int VoEVolumeControlImpl::GetSpeechInputLevel(unsigned int& level)
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
@@ -399,7 +311,7 @@
{
WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1),
"GetSpeechOutputLevel(channel=%d, level=?)", channel);
-
+
if (!_shared->statistics().Initialized())
{
_shared->SetLastError(VE_NOT_INITED, kTraceError);
diff --git a/voice_engine/voe_volume_control_impl.h b/voice_engine/voe_volume_control_impl.h
index cdbc428..b5e3b1b 100644
--- a/voice_engine/voe_volume_control_impl.h
+++ b/voice_engine/voe_volume_control_impl.h
@@ -24,10 +24,6 @@
virtual int GetSpeakerVolume(unsigned int& volume);
- virtual int SetSystemOutputMute(bool enable);
-
- virtual int GetSystemOutputMute(bool& enabled);
-
virtual int SetMicVolume(unsigned int volume);
virtual int GetMicVolume(unsigned int& volume);
@@ -36,10 +32,6 @@
virtual int GetInputMute(int channel, bool& enabled);
- virtual int SetSystemInputMute(bool enable);
-
- virtual int GetSystemInputMute(bool& enabled);
-
virtual int GetSpeechInputLevel(unsigned int& level);
virtual int GetSpeechOutputLevel(int channel, unsigned int& level);