Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: media/audio/audio_parameters.h

Issue 593653003: Refactoring AudioParameters |operator==| to |Equals()| method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_AUDIO_AUDIO_PARAMETERS_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_PARAMETERS_H_
6 #define MEDIA_AUDIO_AUDIO_PARAMETERS_H_ 6 #define MEDIA_AUDIO_AUDIO_PARAMETERS_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "media/base/channel_layout.h" 10 #include "media/base/channel_layout.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 Format format() const { return format_; } 88 Format format() const { return format_; }
89 ChannelLayout channel_layout() const { return channel_layout_; } 89 ChannelLayout channel_layout() const { return channel_layout_; }
90 int sample_rate() const { return sample_rate_; } 90 int sample_rate() const { return sample_rate_; }
91 int bits_per_sample() const { return bits_per_sample_; } 91 int bits_per_sample() const { return bits_per_sample_; }
92 int frames_per_buffer() const { return frames_per_buffer_; } 92 int frames_per_buffer() const { return frames_per_buffer_; }
93 int channels() const { return channels_; } 93 int channels() const { return channels_; }
94 int effects() const { return effects_; } 94 int effects() const { return effects_; }
95 95
96 // Comparison with other AudioParams. 96 // Comparison with other AudioParams.
97 bool operator==(const AudioParameters& other) const { 97 bool Equals(const AudioParameters& other) const {
DaleCurtis 2014/09/22 21:30:24 Move into class now that it's no longer hacker sty
98 return format_ == other.format() && 98 return format_ == other.format() &&
99 sample_rate_ == other.sample_rate() && 99 sample_rate_ == other.sample_rate() &&
100 channel_layout_ == other.channel_layout() && 100 channel_layout_ == other.channel_layout() &&
101 channels_ == other.channels() && 101 channels_ == other.channels() &&
102 bits_per_sample_ == other.bits_per_sample() && 102 bits_per_sample_ == other.bits_per_sample() &&
103 frames_per_buffer_ == other.frames_per_buffer() && 103 frames_per_buffer_ == other.frames_per_buffer() &&
104 effects_ == other.effects(); 104 effects_ == other.effects();
105 } 105 }
106 106
107 private: 107 private:
(...skipping 19 matching lines...) Expand all
127 if (a.sample_rate() != b.sample_rate()) 127 if (a.sample_rate() != b.sample_rate())
128 return a.sample_rate() < b.sample_rate(); 128 return a.sample_rate() < b.sample_rate();
129 if (a.bits_per_sample() != b.bits_per_sample()) 129 if (a.bits_per_sample() != b.bits_per_sample())
130 return a.bits_per_sample() < b.bits_per_sample(); 130 return a.bits_per_sample() < b.bits_per_sample();
131 return a.frames_per_buffer() < b.frames_per_buffer(); 131 return a.frames_per_buffer() < b.frames_per_buffer();
132 } 132 }
133 133
134 } // namespace media 134 } // namespace media
135 135
136 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ 136 #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_
OLDNEW
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698