diff options
author | Yu-Hsuan Hsu <yuhsuan@chromium.org> | 2021-03-17 13:44:26 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-17 12:22:08 +0000 |
commit | 92556766caa86808b7f60ae2bf7000ffc39c702a (patch) | |
tree | bf319b550dcb73404503d39d813a8a12bd794221 | |
parent | 667cccce6ef942466b79805af1021ba6558b23e4 (diff) | |
download | adhd-92556766caa86808b7f60ae2bf7000ffc39c702a.tar.gz |
CRAS: cras_alsa_mixer - Removing master from the comments
Ableist language like master should be removed. However, Master is the
keyword in ALSA so we can not remove them completely. Removing them
from comments to reduce the number of occurrences.
BUG=b:167649426
TEST=Built and run CRAS successfully.
Change-Id: Ia2bee14655392991d06f7bb593892a2c1895bc8e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/2764119
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
Commit-Queue: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Tested-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
-rw-r--r-- | cras/src/server/cras_alsa_mixer.c | 2 | ||||
-rw-r--r-- | cras/src/server/cras_alsa_mixer.h | 2 | ||||
-rw-r--r-- | cras/src/tests/alsa_mixer_unittest.cc | 26 |
3 files changed, 15 insertions, 15 deletions
diff --git a/cras/src/server/cras_alsa_mixer.c b/cras/src/server/cras_alsa_mixer.c index 10705573..3379d959 100644 --- a/cras/src/server/cras_alsa_mixer.c +++ b/cras/src/server/cras_alsa_mixer.c @@ -943,7 +943,7 @@ void cras_alsa_mixer_set_dBFS(struct cras_alsa_mixer *cras_mixer, long dBFS, assert(cras_mixer); /* dBFS is normally < 0 to specify the attenuation from max. max is the - * combined max of the master controls and the current output. + * combined max of the main controls and the current output. */ to_set = dBFS + cras_mixer->max_volume_dB; if (cras_alsa_mixer_has_volume(mixer_output)) diff --git a/cras/src/server/cras_alsa_mixer.h b/cras/src/server/cras_alsa_mixer.h index 3f730cf5..878fbe54 100644 --- a/cras/src/server/cras_alsa_mixer.h +++ b/cras/src/server/cras_alsa_mixer.h @@ -147,7 +147,7 @@ void cras_alsa_mixer_set_mute(struct cras_alsa_mixer *cras_mixer, int muted, * Args: * cras_mixer - Mixer to set the volume in. * muted - 1 if muted, 0 if not. - * mixer_input - The mixer input to mute if no master mute. + * mixer_input - The mixer input to mute if no card mute. */ void cras_alsa_mixer_set_capture_mute(struct cras_alsa_mixer *cras_mixer, int muted, diff --git a/cras/src/tests/alsa_mixer_unittest.cc b/cras/src/tests/alsa_mixer_unittest.cc index edf61101..b3db9de5 100644 --- a/cras/src/tests/alsa_mixer_unittest.cc +++ b/cras/src/tests/alsa_mixer_unittest.cc @@ -381,7 +381,7 @@ TEST(AlsaMixer, CreateOneUnknownElementWithVolume) { mixer_control_destroy(mixer_output); } -TEST(AlsaMixer, CreateOneMasterElement) { +TEST(AlsaMixer, CreateOneMainElement) { struct cras_alsa_mixer* c; int element_playback_volume[] = { 1, @@ -419,10 +419,10 @@ TEST(AlsaMixer, CreateOneMasterElement) { EXPECT_EQ(3, snd_mixer_selem_get_name_called); EXPECT_EQ(1, snd_mixer_elem_next_called); - /* set mute should be called for Master. */ + /* set mute should be called for Main. */ cras_alsa_mixer_set_mute(c, 0, NULL); EXPECT_EQ(1, snd_mixer_selem_set_playback_switch_all_called); - /* set volume should be called for Master. */ + /* set volume should be called for Main. */ cras_alsa_mixer_set_dBFS(c, 0, NULL); EXPECT_EQ(1, snd_mixer_selem_set_playback_dB_all_called); @@ -515,15 +515,15 @@ TEST(AlsaMixer, CreateTwoMainVolumeElements) { EXPECT_EQ(5, snd_mixer_selem_get_name_called); EXPECT_EQ(3, snd_mixer_selem_has_playback_switch_called); - /* Set mute should be called for Master only. */ + /* Set mute should be called for Main only. */ cras_alsa_mixer_set_mute(c, 0, NULL); EXPECT_EQ(1, snd_mixer_selem_set_playback_switch_all_called); - /* Set volume should be called for Master and PCM. If Master doesn't set to + /* Set volume should be called for Main and PCM. If Main doesn't set to * anything but zero then the entire volume should be passed to the PCM * control.*/ - /* Set volume should be called for Master and PCM. (without mixer_output) */ + /* Set volume should be called for Main and PCM. (without mixer_output) */ snd_mixer_selem_get_playback_dB_return_values = get_dB_returns; snd_mixer_selem_get_playback_dB_return_values_length = ARRAY_SIZE(get_dB_returns); @@ -557,8 +557,8 @@ TEST(AlsaMixer, CreateTwoMainVolumeElements) { EXPECT_EQ(1, snd_mixer_selem_has_playback_switch_called); EXPECT_EQ(1, snd_mixer_selem_get_playback_dB_range_called); - /* Set volume should be called for Master, PCM, and the mixer_output passed - * in. If Master doesn't set to anything but zero then the entire volume + /* Set volume should be called for Main, PCM, and the mixer_output passed + * in. If Main doesn't set to anything but zero then the entire volume * should be passed to the PCM control.*/ cras_alsa_mixer_set_dBFS(c, -50, mixer_output); EXPECT_EQ(3, snd_mixer_selem_set_playback_dB_all_called); @@ -566,8 +566,8 @@ TEST(AlsaMixer, CreateTwoMainVolumeElements) { EXPECT_EQ(30, set_dB_values[0]); EXPECT_EQ(30, set_dB_values[1]); EXPECT_EQ(30, set_dB_values[2]); - /* Set volume should be called for Master and PCM. Since the controls were - * sorted, Master should get the volume remaining after PCM is set, in this + /* Set volume should be called for Main and PCM. Since the controls were + * sorted, Main should get the volume remaining after PCM is set, in this * case -50 - -24 = -26. */ long get_dB_returns2[] = { -25, @@ -584,7 +584,7 @@ TEST(AlsaMixer, CreateTwoMainVolumeElements) { cras_alsa_mixer_set_dBFS(c, -50, mixer_output); EXPECT_EQ(2, snd_mixer_selem_set_playback_dB_all_called); EXPECT_EQ(2, snd_mixer_selem_get_playback_dB_called); - EXPECT_EQ(54, set_dB_values[0]); // Master + EXPECT_EQ(54, set_dB_values[0]); // Main EXPECT_EQ(30, set_dB_values[1]); // PCM cras_alsa_mixer_destroy(c); @@ -639,7 +639,7 @@ TEST(AlsaMixer, CreateTwoMainCaptureElements) { EXPECT_EQ(5, snd_mixer_selem_get_name_called); EXPECT_EQ(3, snd_mixer_selem_has_capture_switch_called); - /* Set mute should be called for Master only. */ + /* Set mute should be called for Main only. */ cras_alsa_mixer_set_capture_mute(c, 0, NULL); EXPECT_EQ(1, snd_mixer_selem_set_capture_switch_all_called); /* Set volume should be called for Capture and Digital Capture. If Capture @@ -773,7 +773,7 @@ class AlsaMixerOutputs : public testing::Test { ResetStubData(); snd_mixer_first_elem_return_value = - reinterpret_cast<snd_mixer_elem_t*>(1); // Master + reinterpret_cast<snd_mixer_elem_t*>(1); // Main snd_mixer_elem_next_return_values = elements; snd_mixer_elem_next_return_values_length = ARRAY_SIZE(elements); snd_mixer_selem_has_playback_volume_return_values = element_playback_volume; |