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

Side by Side Diff: Source/modules/webaudio/PeriodicWave.cpp

Issue 540283003: bindings: Retires ScriptWrappable::init, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed a review comment. Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/webaudio/PannerNode.cpp ('k') | Source/modules/webaudio/ScriptProcessorNode.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 periodicWave->generateBasicWaveform(OscillatorNode::TRIANGLE); 85 periodicWave->generateBasicWaveform(OscillatorNode::TRIANGLE);
86 return periodicWave; 86 return periodicWave;
87 } 87 }
88 88
89 PeriodicWave::PeriodicWave(float sampleRate) 89 PeriodicWave::PeriodicWave(float sampleRate)
90 : m_sampleRate(sampleRate) 90 : m_sampleRate(sampleRate)
91 , m_periodicWaveSize(PeriodicWaveSize) 91 , m_periodicWaveSize(PeriodicWaveSize)
92 , m_numberOfRanges(NumberOfRanges) 92 , m_numberOfRanges(NumberOfRanges)
93 , m_centsPerRange(CentsPerRange) 93 , m_centsPerRange(CentsPerRange)
94 { 94 {
95 ScriptWrappable::init(this);
96 float nyquist = 0.5 * m_sampleRate; 95 float nyquist = 0.5 * m_sampleRate;
97 m_lowestFundamentalFrequency = nyquist / maxNumberOfPartials(); 96 m_lowestFundamentalFrequency = nyquist / maxNumberOfPartials();
98 m_rateScale = m_periodicWaveSize / m_sampleRate; 97 m_rateScale = m_periodicWaveSize / m_sampleRate;
99 } 98 }
100 99
101 void PeriodicWave::waveDataForFundamentalFrequency(float fundamentalFrequency, f loat* &lowerWaveData, float* &higherWaveData, float& tableInterpolationFactor) 100 void PeriodicWave::waveDataForFundamentalFrequency(float fundamentalFrequency, f loat* &lowerWaveData, float* &higherWaveData, float& tableInterpolationFactor)
102 { 101 {
103 // Negative frequencies are allowed, in which case we alias to the positive frequency. 102 // Negative frequencies are allowed, in which case we alias to the positive frequency.
104 fundamentalFrequency = fabsf(fundamentalFrequency); 103 fundamentalFrequency = fabsf(fundamentalFrequency);
105 104
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 realP[n] = 0; 295 realP[n] = 0;
297 imagP[n] = b; 296 imagP[n] = b;
298 } 297 }
299 298
300 createBandLimitedTables(realP, imagP, halfSize); 299 createBandLimitedTables(realP, imagP, halfSize);
301 } 300 }
302 301
303 } // namespace blink 302 } // namespace blink
304 303
305 #endif // ENABLE(WEB_AUDIO) 304 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/PannerNode.cpp ('k') | Source/modules/webaudio/ScriptProcessorNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698