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

Side by Side Diff: third_party/WebKit/Source/platform/audio/DynamicsCompressorKernel.cpp

Issue 2615813003: Migrate WTF::Vector::append() to ::push_back() [part 14 of N] (Closed)
Patch Set: rebase, small fix in FontSettings.h Created 3 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 m_meteringReleaseK = static_cast<float>(discreteTimeConstantForSampleRate( 66 m_meteringReleaseK = static_cast<float>(discreteTimeConstantForSampleRate(
67 meteringReleaseTimeConstant, sampleRate)); 67 meteringReleaseTimeConstant, sampleRate));
68 } 68 }
69 69
70 void DynamicsCompressorKernel::setNumberOfChannels(unsigned numberOfChannels) { 70 void DynamicsCompressorKernel::setNumberOfChannels(unsigned numberOfChannels) {
71 if (m_preDelayBuffers.size() == numberOfChannels) 71 if (m_preDelayBuffers.size() == numberOfChannels)
72 return; 72 return;
73 73
74 m_preDelayBuffers.clear(); 74 m_preDelayBuffers.clear();
75 for (unsigned i = 0; i < numberOfChannels; ++i) { 75 for (unsigned i = 0; i < numberOfChannels; ++i) {
76 m_preDelayBuffers.append( 76 m_preDelayBuffers.push_back(
77 WTF::makeUnique<AudioFloatArray>(MaxPreDelayFrames)); 77 WTF::makeUnique<AudioFloatArray>(MaxPreDelayFrames));
78 } 78 }
79 } 79 }
80 80
81 void DynamicsCompressorKernel::setPreDelayTime(float preDelayTime) { 81 void DynamicsCompressorKernel::setPreDelayTime(float preDelayTime) {
82 // Re-configure look-ahead section pre-delay if delay time has changed. 82 // Re-configure look-ahead section pre-delay if delay time has changed.
83 unsigned preDelayFrames = preDelayTime * sampleRate(); 83 unsigned preDelayFrames = preDelayTime * sampleRate();
84 if (preDelayFrames > MaxPreDelayFrames - 1) 84 if (preDelayFrames > MaxPreDelayFrames - 1)
85 preDelayFrames = MaxPreDelayFrames - 1; 85 preDelayFrames = MaxPreDelayFrames - 1;
86 86
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 for (unsigned i = 0; i < m_preDelayBuffers.size(); ++i) 481 for (unsigned i = 0; i < m_preDelayBuffers.size(); ++i)
482 m_preDelayBuffers[i]->zero(); 482 m_preDelayBuffers[i]->zero();
483 483
484 m_preDelayReadIndex = 0; 484 m_preDelayReadIndex = 0;
485 m_preDelayWriteIndex = DefaultPreDelayFrames; 485 m_preDelayWriteIndex = DefaultPreDelayFrames;
486 486
487 m_maxAttackCompressionDiffDb = -1; // uninitialized state 487 m_maxAttackCompressionDiffDb = -1; // uninitialized state
488 } 488 }
489 489
490 } // namespace blink 490 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698