| OLD | NEW |
| 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 * 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 return "sine"; | 78 return "sine"; |
| 79 case SQUARE: | 79 case SQUARE: |
| 80 return "square"; | 80 return "square"; |
| 81 case SAWTOOTH: | 81 case SAWTOOTH: |
| 82 return "sawtooth"; | 82 return "sawtooth"; |
| 83 case TRIANGLE: | 83 case TRIANGLE: |
| 84 return "triangle"; | 84 return "triangle"; |
| 85 case CUSTOM: | 85 case CUSTOM: |
| 86 return "custom"; | 86 return "custom"; |
| 87 default: | 87 default: |
| 88 ASSERT_NOT_REACHED(); | 88 NOTREACHED(); |
| 89 return "custom"; | 89 return "custom"; |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 | 92 |
| 93 void OscillatorHandler::SetType(const String& type, | 93 void OscillatorHandler::SetType(const String& type, |
| 94 ExceptionState& exception_state) { | 94 ExceptionState& exception_state) { |
| 95 if (type == "sine") { | 95 if (type == "sine") { |
| 96 SetType(SINE); | 96 SetType(SINE); |
| 97 } else if (type == "square") { | 97 } else if (type == "square") { |
| 98 SetType(SQUARE); | 98 SetType(SQUARE); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 121 case SAWTOOTH: | 121 case SAWTOOTH: |
| 122 periodic_wave = Context()->GetPeriodicWave(SAWTOOTH); | 122 periodic_wave = Context()->GetPeriodicWave(SAWTOOTH); |
| 123 break; | 123 break; |
| 124 case TRIANGLE: | 124 case TRIANGLE: |
| 125 periodic_wave = Context()->GetPeriodicWave(TRIANGLE); | 125 periodic_wave = Context()->GetPeriodicWave(TRIANGLE); |
| 126 break; | 126 break; |
| 127 case CUSTOM: | 127 case CUSTOM: |
| 128 default: | 128 default: |
| 129 // Return false for invalid types, including CUSTOM since | 129 // Return false for invalid types, including CUSTOM since |
| 130 // setPeriodicWave() method must be called explicitly. | 130 // setPeriodicWave() method must be called explicitly. |
| 131 ASSERT_NOT_REACHED(); | 131 NOTREACHED(); |
| 132 return false; | 132 return false; |
| 133 } | 133 } |
| 134 | 134 |
| 135 SetPeriodicWave(periodic_wave); | 135 SetPeriodicWave(periodic_wave); |
| 136 type_ = type; | 136 type_ = type; |
| 137 return true; | 137 return true; |
| 138 } | 138 } |
| 139 | 139 |
| 140 bool OscillatorHandler::CalculateSampleAccuratePhaseIncrements( | 140 bool OscillatorHandler::CalculateSampleAccuratePhaseIncrements( |
| 141 size_t frames_to_process) { | 141 size_t frames_to_process) { |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 460 |
| 461 AudioParam* OscillatorNode::detune() { | 461 AudioParam* OscillatorNode::detune() { |
| 462 return detune_; | 462 return detune_; |
| 463 } | 463 } |
| 464 | 464 |
| 465 void OscillatorNode::setPeriodicWave(PeriodicWave* wave) { | 465 void OscillatorNode::setPeriodicWave(PeriodicWave* wave) { |
| 466 GetOscillatorHandler().SetPeriodicWave(wave); | 466 GetOscillatorHandler().SetPeriodicWave(wave); |
| 467 } | 467 } |
| 468 | 468 |
| 469 } // namespace blink | 469 } // namespace blink |
| OLD | NEW |