forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make AudioContentType/VolumeChangeSource easier to print
No need to add XXXToString helper function in each file. Bug: None Change-Id: Ie717defac4f4444aeab207de472ae190f935ac1e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2220359 Commit-Queue: Linkun Chen <lkchen@chromium.org> Reviewed-by: Sergey Volk <servolk@chromium.org> Cr-Commit-Position: refs/heads/master@{#778526}
- Loading branch information
Linkun Chen
authored and
Commit Bot
committed
Jun 15, 2020
1 parent
7c83aef
commit 5ea1bc1
Showing
6 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
#include "chromecast/public/volume_control.h" | ||
|
||
#include "base/notreached.h" | ||
|
||
namespace chromecast { | ||
namespace media { | ||
|
||
std::ostream& operator<<(std::ostream& os, AudioContentType audio_type) { | ||
switch (audio_type) { | ||
case AudioContentType::kMedia: | ||
return os << "MEDIA"; | ||
case AudioContentType::kAlarm: | ||
return os << "ALARM"; | ||
case AudioContentType::kCommunication: | ||
return os << "COMMUNICATION"; | ||
case AudioContentType::kOther: | ||
return os << "OTHER"; | ||
default: | ||
NOTREACHED() | ||
<< "Add a new entry above, otherwise kNumTypes is not a valid type."; | ||
return os << "UNKNOWN"; | ||
} | ||
} | ||
|
||
std::ostream& operator<<(std::ostream& os, | ||
VolumeChangeSource vol_change_source) { | ||
switch (vol_change_source) { | ||
case VolumeChangeSource::kUser: | ||
return os << "USER"; | ||
case VolumeChangeSource::kAutomatic: | ||
return os << "AUTOMATIC"; | ||
case VolumeChangeSource::kAutoWithFeedback: | ||
return os << "AUTO_WITH_FEEDBACK"; | ||
} | ||
} | ||
|
||
} // namespace media | ||
} // namespace chromecast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters