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

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

Issue 606653006: bindings: Adds DOMArrayBuffer, etc. as thin wrappers for ArrayBuffer, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/webaudio/BiquadFilterNode.cpp ('k') | Source/modules/webaudio/WaveShaperNode.h » ('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) 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 default: 71 default:
72 ASSERT_NOT_REACHED(); 72 ASSERT_NOT_REACHED();
73 } 73 }
74 } 74 }
75 75
76 void WaveShaperDSPKernel::processCurve(const float* source, float* destination, size_t framesToProcess) 76 void WaveShaperDSPKernel::processCurve(const float* source, float* destination, size_t framesToProcess)
77 { 77 {
78 ASSERT(source && destination && waveShaperProcessor()); 78 ASSERT(source && destination && waveShaperProcessor());
79 79
80 Float32Array* curve = waveShaperProcessor()->curve(); 80 DOMFloat32Array* curve = waveShaperProcessor()->curve();
81 if (!curve) { 81 if (!curve) {
82 // Act as "straight wire" pass-through if no curve is set. 82 // Act as "straight wire" pass-through if no curve is set.
83 memcpy(destination, source, sizeof(float) * framesToProcess); 83 memcpy(destination, source, sizeof(float) * framesToProcess);
84 return; 84 return;
85 } 85 }
86 86
87 float* curveData = curve->data(); 87 float* curveData = curve->data();
88 int curveLength = curve->length(); 88 int curveLength = curve->length();
89 89
90 ASSERT(curveData); 90 ASSERT(curveData);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 default: 200 default:
201 ASSERT_NOT_REACHED(); 201 ASSERT_NOT_REACHED();
202 } 202 }
203 203
204 return static_cast<double>(latencyFrames) / sampleRate(); 204 return static_cast<double>(latencyFrames) / sampleRate();
205 } 205 }
206 206
207 } // namespace blink 207 } // namespace blink
208 208
209 #endif // ENABLE(WEB_AUDIO) 209 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/BiquadFilterNode.cpp ('k') | Source/modules/webaudio/WaveShaperNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698