1e14391e94c850b8bd03680c23b38978db68687a8John Reck/* 2e14391e94c850b8bd03680c23b38978db68687a8John Reck * Copyright (C) 2010, Google Inc. All rights reserved. 3e14391e94c850b8bd03680c23b38978db68687a8John Reck * 4e14391e94c850b8bd03680c23b38978db68687a8John Reck * Redistribution and use in source and binary forms, with or without 5e14391e94c850b8bd03680c23b38978db68687a8John Reck * modification, are permitted provided that the following conditions 6e14391e94c850b8bd03680c23b38978db68687a8John Reck * are met: 7e14391e94c850b8bd03680c23b38978db68687a8John Reck * 1. Redistributions of source code must retain the above copyright 8e14391e94c850b8bd03680c23b38978db68687a8John Reck * notice, this list of conditions and the following disclaimer. 9e14391e94c850b8bd03680c23b38978db68687a8John Reck * 2. Redistributions in binary form must reproduce the above copyright 10e14391e94c850b8bd03680c23b38978db68687a8John Reck * notice, this list of conditions and the following disclaimer in the 11e14391e94c850b8bd03680c23b38978db68687a8John Reck * documentation and/or other materials provided with the distribution. 12e14391e94c850b8bd03680c23b38978db68687a8John Reck * 13e14391e94c850b8bd03680c23b38978db68687a8John Reck * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY 14e14391e94c850b8bd03680c23b38978db68687a8John Reck * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15e14391e94c850b8bd03680c23b38978db68687a8John Reck * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16e14391e94c850b8bd03680c23b38978db68687a8John Reck * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY 17e14391e94c850b8bd03680c23b38978db68687a8John Reck * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18e14391e94c850b8bd03680c23b38978db68687a8John Reck * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19e14391e94c850b8bd03680c23b38978db68687a8John Reck * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 20e14391e94c850b8bd03680c23b38978db68687a8John Reck * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21e14391e94c850b8bd03680c23b38978db68687a8John Reck * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22e14391e94c850b8bd03680c23b38978db68687a8John Reck * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23e14391e94c850b8bd03680c23b38978db68687a8John Reck */ 24e14391e94c850b8bd03680c23b38978db68687a8John Reck 25e14391e94c850b8bd03680c23b38978db68687a8John Reck#include "config.h" 26e14391e94c850b8bd03680c23b38978db68687a8John Reck 27e14391e94c850b8bd03680c23b38978db68687a8John Reck#if ENABLE(WEB_AUDIO) 28e14391e94c850b8bd03680c23b38978db68687a8John Reck 29e14391e94c850b8bd03680c23b38978db68687a8John Reck#include "DelayProcessor.h" 30e14391e94c850b8bd03680c23b38978db68687a8John Reck 31e14391e94c850b8bd03680c23b38978db68687a8John Reck#include "DelayDSPKernel.h" 32e14391e94c850b8bd03680c23b38978db68687a8John Reck 33e14391e94c850b8bd03680c23b38978db68687a8John Recknamespace WebCore { 34e14391e94c850b8bd03680c23b38978db68687a8John Reck 35e14391e94c850b8bd03680c23b38978db68687a8John ReckDelayProcessor::DelayProcessor(double sampleRate, unsigned numberOfChannels) 36e14391e94c850b8bd03680c23b38978db68687a8John Reck : AudioDSPKernelProcessor(sampleRate, numberOfChannels) 37e14391e94c850b8bd03680c23b38978db68687a8John Reck{ 38e14391e94c850b8bd03680c23b38978db68687a8John Reck m_delayTime = AudioParam::create("delayTime", 0.0, 0.0, 1.0); 39e14391e94c850b8bd03680c23b38978db68687a8John Reck} 40e14391e94c850b8bd03680c23b38978db68687a8John Reck 41e14391e94c850b8bd03680c23b38978db68687a8John ReckDelayProcessor::~DelayProcessor() 42e14391e94c850b8bd03680c23b38978db68687a8John Reck{ 43e14391e94c850b8bd03680c23b38978db68687a8John Reck if (isInitialized()) 44e14391e94c850b8bd03680c23b38978db68687a8John Reck uninitialize(); 45e14391e94c850b8bd03680c23b38978db68687a8John Reck} 46e14391e94c850b8bd03680c23b38978db68687a8John Reck 47e14391e94c850b8bd03680c23b38978db68687a8John ReckPassOwnPtr<AudioDSPKernel> DelayProcessor::createKernel() 48e14391e94c850b8bd03680c23b38978db68687a8John Reck{ 49e14391e94c850b8bd03680c23b38978db68687a8John Reck return adoptPtr(new DelayDSPKernel(this)); 50e14391e94c850b8bd03680c23b38978db68687a8John Reck} 51e14391e94c850b8bd03680c23b38978db68687a8John Reck 52e14391e94c850b8bd03680c23b38978db68687a8John Reck} // namespace WebCore 53e14391e94c850b8bd03680c23b38978db68687a8John Reck 54e14391e94c850b8bd03680c23b38978db68687a8John Reck#endif // ENABLE(WEB_AUDIO) 55