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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp

Issue 2760353002: Define default values for options dictionaries for WebAudio (Closed)
Patch Set: Rebase Created 3 years, 8 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 * 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 ExceptionState& exception_state) { 59 ExceptionState& exception_state) {
60 WaveShaperNode* node = Create(*context, exception_state); 60 WaveShaperNode* node = Create(*context, exception_state);
61 61
62 if (!node) 62 if (!node)
63 return nullptr; 63 return nullptr;
64 64
65 node->HandleChannelOptions(options, exception_state); 65 node->HandleChannelOptions(options, exception_state);
66 66
67 if (options.hasCurve()) 67 if (options.hasCurve())
68 node->setCurve(options.curve(), exception_state); 68 node->setCurve(options.curve(), exception_state);
69 if (options.hasOversample()) 69
70 node->setOversample(options.oversample()); 70 node->setOversample(options.oversample());
71 71
72 return node; 72 return node;
73 } 73 }
74 WaveShaperProcessor* WaveShaperNode::GetWaveShaperProcessor() const { 74 WaveShaperProcessor* WaveShaperNode::GetWaveShaperProcessor() const {
75 return static_cast<WaveShaperProcessor*>( 75 return static_cast<WaveShaperProcessor*>(
76 static_cast<AudioBasicProcessorHandler&>(Handler()).Processor()); 76 static_cast<AudioBasicProcessorHandler&>(Handler()).Processor());
77 } 77 }
78 78
79 void WaveShaperNode::SetCurveImpl(const float* curve_data, 79 void WaveShaperNode::SetCurveImpl(const float* curve_data,
80 unsigned curve_length, 80 unsigned curve_length,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 return "2x"; 152 return "2x";
153 case WaveShaperProcessor::kOverSample4x: 153 case WaveShaperProcessor::kOverSample4x:
154 return "4x"; 154 return "4x";
155 default: 155 default:
156 ASSERT_NOT_REACHED(); 156 ASSERT_NOT_REACHED();
157 return "none"; 157 return "none";
158 } 158 }
159 } 159 }
160 160
161 } // namespace blink 161 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698