mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
5366306b68
This is the full implementation of the AudioBuffer object. There are two ways to create these objects from an audio context and this patch implements only one of them. The construction of the AudioBuffer object is a two step process: the object should be created with operator new first, and then InitializeBuffers should be called on it. InitializeBuffers is fallible, because it uses the JS API to create the underlying typed arrays, but that's fine, since the length of the buffers comes from web content, and we don't want to use infallible allocations for those anyways. We hold on to the JS objects from the C++ implementation, and trace through all of those objects, so that a GC does not kill those object without us knowing. The buffer should be possible to manipulate from both C++ and JS, and the C++ object probably needs to support a set of methods for the C++ callers at some point.
31 lines
985 B
Plaintext
31 lines
985 B
Plaintext
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*
|
|
* The origin of this IDL file is
|
|
* https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html
|
|
*
|
|
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
|
* liability, trademark and document use rules apply.
|
|
*/
|
|
|
|
[Constructor, PrefControlled]
|
|
interface mozAudioContext {
|
|
|
|
readonly attribute AudioDestinationNode destination;
|
|
|
|
[Creator, Throws]
|
|
AudioBuffer createBuffer(unsigned long numberOfChannels, unsigned long length, float sampleRate);
|
|
|
|
// [Creator, Throws]
|
|
// AudioBuffer createBuffer(ArrayBuffer buffer, boolean mixToMono);
|
|
|
|
// AudioNode creation
|
|
AudioBufferSourceNode createBufferSource();
|
|
|
|
};
|
|
|
|
typedef mozAudioContext AudioContext;
|
|
|