OLD | NEW |
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 if (type == "none") { | 68 if (type == "none") { |
69 waveShaperProcessor()->setOversample(WaveShaperProcessor::OverSampleNone
); | 69 waveShaperProcessor()->setOversample(WaveShaperProcessor::OverSampleNone
); |
70 } else if (type == "2x") { | 70 } else if (type == "2x") { |
71 waveShaperProcessor()->setOversample(WaveShaperProcessor::OverSample2x); | 71 waveShaperProcessor()->setOversample(WaveShaperProcessor::OverSample2x); |
72 } else if (type == "4x") { | 72 } else if (type == "4x") { |
73 waveShaperProcessor()->setOversample(WaveShaperProcessor::OverSample4x); | 73 waveShaperProcessor()->setOversample(WaveShaperProcessor::OverSample4x); |
74 } else { | 74 } else { |
75 exceptionState.throwDOMException( | 75 exceptionState.throwDOMException( |
76 InvalidStateError, | 76 InvalidStateError, |
77 ExceptionMessages::failedToSet( | 77 "The value provided ('" + type + "') is not one of 'none', '2x', or
'4x'."); |
78 "oversample", | |
79 "WaveShaperNode", | |
80 "invalid oversample '" + type + "': must be 'none', '2x', or '4x
'.")); | |
81 } | 78 } |
82 } | 79 } |
83 | 80 |
84 String WaveShaperNode::oversample() const | 81 String WaveShaperNode::oversample() const |
85 { | 82 { |
86 switch (const_cast<WaveShaperNode*>(this)->waveShaperProcessor()->oversample
()) { | 83 switch (const_cast<WaveShaperNode*>(this)->waveShaperProcessor()->oversample
()) { |
87 case WaveShaperProcessor::OverSampleNone: | 84 case WaveShaperProcessor::OverSampleNone: |
88 return "none"; | 85 return "none"; |
89 case WaveShaperProcessor::OverSample2x: | 86 case WaveShaperProcessor::OverSample2x: |
90 return "2x"; | 87 return "2x"; |
91 case WaveShaperProcessor::OverSample4x: | 88 case WaveShaperProcessor::OverSample4x: |
92 return "4x"; | 89 return "4x"; |
93 default: | 90 default: |
94 ASSERT_NOT_REACHED(); | 91 ASSERT_NOT_REACHED(); |
95 return "none"; | 92 return "none"; |
96 } | 93 } |
97 } | 94 } |
98 | 95 |
99 } // namespace WebCore | 96 } // namespace WebCore |
100 | 97 |
101 #endif // ENABLE(WEB_AUDIO) | 98 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |