mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-23 08:34:11 -08:00
Merge pull request #193 from Wolftein/master
Added missing JSO interfaces.
This commit is contained in:
commit
6261ed03c6
|
@ -0,0 +1,36 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.dom.events;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface WheelEvent extends MouseEvent {
|
||||||
|
int DOM_DELTA_PIXEL = 0;
|
||||||
|
int DOM_DELTA_LINE = 1;
|
||||||
|
int DOM_DELTA_PAGE = 2;
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
double getDeltaX();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
double getDeltaY();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
double getDeltaZ();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
int getDeltaMode();
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.dom.events;
|
||||||
|
|
||||||
|
public interface WheelEventTarget extends EventTarget {
|
||||||
|
default void listenWheel(EventListener<WheelEvent> listener) {
|
||||||
|
addEventListener("wheel", listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
default void neglectWheel(EventListener<WheelEvent> listener) {
|
||||||
|
removeEventListener("wheel", listener);
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,6 +23,7 @@ import org.teavm.jso.dom.events.FocusEventTarget;
|
||||||
import org.teavm.jso.dom.events.KeyboardEventTarget;
|
import org.teavm.jso.dom.events.KeyboardEventTarget;
|
||||||
import org.teavm.jso.dom.events.LoadEventTarget;
|
import org.teavm.jso.dom.events.LoadEventTarget;
|
||||||
import org.teavm.jso.dom.events.MouseEventTarget;
|
import org.teavm.jso.dom.events.MouseEventTarget;
|
||||||
|
import org.teavm.jso.dom.events.WheelEventTarget;
|
||||||
import org.teavm.jso.dom.xml.Element;
|
import org.teavm.jso.dom.xml.Element;
|
||||||
import org.teavm.jso.dom.xml.Node;
|
import org.teavm.jso.dom.xml.Node;
|
||||||
import org.teavm.jso.dom.xml.NodeList;
|
import org.teavm.jso.dom.xml.NodeList;
|
||||||
|
@ -32,7 +33,7 @@ import org.teavm.jso.dom.xml.NodeList;
|
||||||
* @author Alexey Andreev
|
* @author Alexey Andreev
|
||||||
*/
|
*/
|
||||||
public interface HTMLElement extends Element, ElementCSSInlineStyle, EventTarget, FocusEventTarget, MouseEventTarget,
|
public interface HTMLElement extends Element, ElementCSSInlineStyle, EventTarget, FocusEventTarget, MouseEventTarget,
|
||||||
KeyboardEventTarget, LoadEventTarget {
|
WheelEventTarget, KeyboardEventTarget, LoadEventTarget {
|
||||||
@Override
|
@Override
|
||||||
NodeList<? extends HTMLElement> getElementsByTagName(String name);
|
NodeList<? extends HTMLElement> getElementsByTagName(String name);
|
||||||
|
|
||||||
|
|
111
jso/apis/src/main/java/org/teavm/jso/typedarrays/DataView.java
Normal file
111
jso/apis/src/main/java/org/teavm/jso/typedarrays/DataView.java
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.typedarrays;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSBody;
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
|
||||||
|
public abstract class DataView extends ArrayBufferView {
|
||||||
|
@JSMethod
|
||||||
|
public abstract byte getInt8(int byteOffset);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract short getUInt8(int byteOffset);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract short getInt16(int byteOffset);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract short getInt16(int byteOffset, boolean littleEndian);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract int getUInt16(int byteOffset);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract int getUInt16(int byteOffset, boolean littleEndian);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract int getInt32(int byteOffset);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract int getInt32(int byteOffset, boolean littleEndian);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract int getUInt32(int byteOffset);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract int getUInt32(int byteOffset, boolean littleEndian);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract float getFloat32(int byteOffset);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract float getFloat32(int byteOffset, boolean littleEndian);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract double getFloat64(int byteOffset);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract double getFloat64(int byteOffset, boolean littleEndian);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void setInt8(int byteOffset, int value);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void setUInt8(int byteOffset, int value);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void setInt16(int byteOffset, int value);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void setInt16(int byteOffset, int value, boolean littleEndian);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void setUInt16(int byteOffset, int value);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void setUInt16(int byteOffset, int value, boolean littleEndian);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void setInt32(int byteOffset, int value);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void setInt32(int byteOffset, int value, boolean littleEndian);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void setUInt32(int byteOffset, int value);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void setUInt32(int byteOffset, int value, boolean littleEndian);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void setFloat32(int byteOffset, float value);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void setFloat32(int byteOffset, float value, boolean littleEndian);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void setFloat64(int byteOffset, double value);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void setFloat64(int byteOffset, double value, boolean littleEndian);
|
||||||
|
|
||||||
|
@JSBody(params = "buffer", script = "return new DataView(buffer);")
|
||||||
|
public static native DataView create(ArrayBuffer buffer);
|
||||||
|
|
||||||
|
@JSBody(params = {"buffer", "offset", "length"}, script = "return new DataView(buffer, offset, length);")
|
||||||
|
public static native DataView create(ArrayBuffer buffer, int offset, int length);
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2015 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.typedarrays.Float32Array;
|
||||||
|
import org.teavm.jso.typedarrays.Uint8Array;
|
||||||
|
|
||||||
|
public interface AnalyserNode extends AudioNode {
|
||||||
|
@JSProperty
|
||||||
|
void setFftSize(int size);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
int getFftSize();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
int getFrequencyBinCount();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setMinDecibels(float value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
float getMinDecibels();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setMaxDecibels(float value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
float getMaxDecibels();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setSmoothingTimeConstant(float value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
float getSmoothingTimeConstant();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void getFloatFrequencyData(Float32Array array);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void getByteFrequencyData(Uint8Array array);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void getFloatTimeDomainData(Float32Array array);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void getByteTimeDomainData(Uint8Array array);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.typedarrays.Float32Array;
|
||||||
|
|
||||||
|
public interface AudioBuffer extends JSObject {
|
||||||
|
@JSProperty
|
||||||
|
float getSampleRate();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
int getLength();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
double getDuration();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
int getNumberOfChannels();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
Float32Array getChannelData(int channel);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void copyFromChannel(Float32Array destination, int channelNumber);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void copyFromChannel(Float32Array destination, int channelNumber, int startInChannel);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void copyToChannel(Float32Array source, int channelNumber);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void copyToChannel(Float32Array source, int channelNumber, int startInChannel);
|
||||||
|
}
|
|
@ -0,0 +1,77 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.dom.events.EventListener;
|
||||||
|
|
||||||
|
public interface AudioBufferSourceNode extends AudioNode {
|
||||||
|
@JSProperty
|
||||||
|
AudioBuffer getBuffer();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setBuffer(AudioBuffer buffer);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioParam getPlaybackRate();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioParam getDetune();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
boolean getLoop();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setLoop(boolean loop);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
double getLoopStart();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setLoopStart(double start);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
double getLoopEnd();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setLoopEnd(double end);
|
||||||
|
|
||||||
|
@JSProperty("onended")
|
||||||
|
void setOnEnded(EventListener<MediaEvent> ent);
|
||||||
|
|
||||||
|
@JSProperty("onended")
|
||||||
|
EventListener<MediaEvent> getOnEnded();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void start(double when, double offset, double duration);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void start(double when, double offset);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void start(double when);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void start();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void stop(double when);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void stop();
|
||||||
|
}
|
||||||
|
|
161
jso/apis/src/main/java/org/teavm/jso/webaudio/AudioContext.java
Normal file
161
jso/apis/src/main/java/org/teavm/jso/webaudio/AudioContext.java
Normal file
|
@ -0,0 +1,161 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSBody;
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.dom.events.EventListener;
|
||||||
|
import org.teavm.jso.dom.html.HTMLMediaElement;
|
||||||
|
import org.teavm.jso.typedarrays.ArrayBuffer;
|
||||||
|
import org.teavm.jso.typedarrays.Float32Array;
|
||||||
|
|
||||||
|
public abstract class AudioContext implements JSObject {
|
||||||
|
public static final String STATE_SUSPENDED = "suspended";
|
||||||
|
public static final String STATE_RUNNING = "running";
|
||||||
|
public static final String STATE_CLOSE = "close";
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
public abstract AudioDestinationNode getDestination();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
public abstract float getSampleRate();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
public abstract double getCurrentTime();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
public abstract AudioListener getListener();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
public abstract String getState();
|
||||||
|
|
||||||
|
@JSProperty("onstatechange")
|
||||||
|
public abstract void setOnStateChange(EventListener<MediaEvent> listener);
|
||||||
|
|
||||||
|
@JSProperty("onstatechange")
|
||||||
|
public abstract EventListener<MediaEvent> getOnStateChange();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void suspend();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void resume();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void close();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract AudioBuffer createBuffer(int numberOfChannels, int length, float sampleRate);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract AudioBuffer decodeAudioData(ArrayBuffer audioData, DecodeSuccessCallback successCallback,
|
||||||
|
DecodeErrorCallback errorCallback);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract AudioBuffer decodeAudioData(ArrayBuffer audioData, DecodeSuccessCallback successCallback);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract AudioBuffer decodeAudioData(ArrayBuffer audioData);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract AudioBufferSourceNode createBufferSource();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract MediaStreamAudioDestinationNode createMediaStreamDestination();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract AudioWorker createAudioWorker();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract ScriptProcessorNode createScriptProcessor(int bufferSize, int numberOfInputChannels,
|
||||||
|
int numberOfOutputChannels);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract ScriptProcessorNode createScriptProcessor(int bufferSize, int numberOfInputChannels);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract ScriptProcessorNode createScriptProcessor(int bufferSize);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract ScriptProcessorNode createScriptProcessor();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract AnalyserNode createAnalyser();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract GainNode createGain();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract DelayNode createDelay(double maxDelayTime);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract DelayNode createDelay();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract BiquadFilterNode createBiquadFilter();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract IIRFilterNode createIIRFilter(Float32Array feedforward, Float32Array feedback);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract WaveShaperNode createWaveShaper();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract PannerNode createPanner();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract StereoPannerNode createStereoPanner();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract ConvolverNode createConvolver();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract ChannelSplitterNode createChannelSplitter(int numberOfOutputs);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract ChannelSplitterNode createChannelSplitter();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract ChannelMergerNode createChannelMerger(int numberOfInputs);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract ChannelMergerNode createChannelMerger();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract DynamicsCompressorNode createDynamicsCompressor();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract OscillatorNode createOscillator();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract PeriodicWave createPeriodicWave(Float32Array real, Float32Array image,
|
||||||
|
PeriodicWaveConstraints constraints);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract PeriodicWave createPeriodicWave(Float32Array real, Float32Array image);
|
||||||
|
|
||||||
|
@JSBody(params = {},
|
||||||
|
script = "var Context = window.AudioContext || window.webkitAudioContext; return new Context();")
|
||||||
|
public static native AudioContext create();
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface AudioDestinationNode extends AudioNode {
|
||||||
|
@JSProperty
|
||||||
|
int getMaxChannelCount();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface AudioListener extends JSObject {
|
||||||
|
@JSProperty
|
||||||
|
void setDopplerFactor(float value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
float getDopplerFactor();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setSpeedOfSound(float value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
float getSpeedOfSound();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void setPosition(float x, float y, float z);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void setOrientation(float x, float y, float z, float xUp, float yUp, float zUp);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void setVelocity(float x, float y, float z);
|
||||||
|
}
|
||||||
|
|
83
jso/apis/src/main/java/org/teavm/jso/webaudio/AudioNode.java
Normal file
83
jso/apis/src/main/java/org/teavm/jso/webaudio/AudioNode.java
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface AudioNode extends JSObject {
|
||||||
|
String CHANNEL_COUNT_MODE_MAX = "max";
|
||||||
|
String CHANNEL_COUNT_MODE_CLAMPED_MAX = "clamped-max";
|
||||||
|
String CHANNEL_COUNT_MODE_EXPLICIT = "explicit";
|
||||||
|
|
||||||
|
String CHANNEL_INTERPRETATION_SPEAKERS = "speakers";
|
||||||
|
String CHANNEL_INTERPRETATION_DISCRETE = "discrete";
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void connect(AudioNode destination, int output, int input);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void connect(AudioNode destination, int output);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void connect(AudioNode destination);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void connect(AudioParam destination, int output);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void connect(AudioParam destination);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void disconnect();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void disconnect(int output);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void disconnect(AudioNode destination);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void disconnect(AudioNode destination, int output);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void disconnect(AudioNode destination, int output, int input);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void disconnect(AudioParam destination);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void disconnect(AudioParam destination, int output);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioContext getContext();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
int getNumberOfInputs();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
int getNumberOfOutputs();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
int getChannelCount();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getChannelCountMode();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getChannelInterpretation();
|
||||||
|
}
|
|
@ -0,0 +1,50 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.typedarrays.Float32Array;
|
||||||
|
|
||||||
|
public interface AudioParam extends JSObject {
|
||||||
|
@JSProperty
|
||||||
|
float getValue();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setValue(float value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
float getDefaultValue();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void setValueAtTime(float value, double startTime);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void linearRampToValueAtTime(float value, double endTime);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void exponentialRampToValueAtTime(float value, double endTime);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void setTargetAtTime(float target, double startTime, float timeConstant);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void setValueCurveAtTime(Float32Array values, double startTime, double duration);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void cancelScheduledValues(double startTime);
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.dom.events.Event;
|
||||||
|
import org.teavm.jso.typedarrays.Float32Array;
|
||||||
|
|
||||||
|
public interface AudioProcessEvent extends Event {
|
||||||
|
@JSProperty
|
||||||
|
double getPlaybackTime();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioWorkerNodeProcessor getNode();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
Float32Array[][] getInputs();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
Float32Array[][] getOutputs();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
JSObject getParameters();
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface AudioProcessingEvent extends MediaEvent {
|
||||||
|
@JSProperty
|
||||||
|
double getPlaybackTime();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioBuffer getInputBuffer();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioBuffer getOutputBuffer();
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.dom.events.EventListener;
|
||||||
|
|
||||||
|
public interface AudioWorker extends JSObject {
|
||||||
|
@JSProperty
|
||||||
|
AudioWorkerParamDescriptor[] getParameters();
|
||||||
|
|
||||||
|
@JSProperty(value = "onmessage")
|
||||||
|
void setOnMessage(EventListener<MediaEvent> event);
|
||||||
|
|
||||||
|
@JSProperty(value = "onmessage")
|
||||||
|
EventListener<MediaEvent> getOnMessage();
|
||||||
|
|
||||||
|
@JSProperty(value = "onloaded")
|
||||||
|
void setOnLoaded(EventListener<MediaEvent> event);
|
||||||
|
|
||||||
|
@JSProperty(value = "onloaded")
|
||||||
|
EventListener<MediaEvent> getOnLoaded();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void terminate();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void postMessage(JSObject message, JSObject[] transfer);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void postMessage(JSObject message, JSObject transfer);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void postMessage(JSObject message);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
AudioWorkerNode createNode(int numberOfInputs, int numberOfOutputs);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
AudioParam addParameter(String name, float defaultValue);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void removeParameter(String name);
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.dom.events.EventListener;
|
||||||
|
|
||||||
|
public interface AudioWorkerGlobalScope extends JSObject {
|
||||||
|
@JSProperty
|
||||||
|
float getSampleRate();
|
||||||
|
|
||||||
|
@JSProperty("onaudioprocess")
|
||||||
|
void setOnAudioProcess(EventListener<MediaEvent> event);
|
||||||
|
|
||||||
|
@JSProperty("onaudioprocess")
|
||||||
|
EventListener<MediaEvent> getOnAudioProcess();
|
||||||
|
|
||||||
|
@JSProperty("onnodecreate")
|
||||||
|
void setOnNodeCreate(EventListener<MediaEvent> event);
|
||||||
|
|
||||||
|
@JSProperty("onnodecreate")
|
||||||
|
EventListener<MediaEvent> getOnNodeCreate();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioWorkerParamDescriptor[] getParameters();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
AudioParam addParameter(String name, float defaultValue);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void removeParameter(String name);
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.dom.events.EventListener;
|
||||||
|
|
||||||
|
public interface AudioWorkerNode extends AudioNode {
|
||||||
|
@JSProperty("onmessage")
|
||||||
|
void setOnMessage(EventListener<MediaEvent> event);
|
||||||
|
|
||||||
|
@JSProperty("onmessage")
|
||||||
|
EventListener<MediaEvent> getOnMessage();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void postMessage(JSObject message, JSObject[] transfer);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void postMessage(JSObject message, JSObject transfer);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void postMessage(JSObject message);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.core.JSArray;
|
||||||
|
|
||||||
|
public interface AudioWorkerNodeCreationEvent extends MediaEvent {
|
||||||
|
@JSProperty
|
||||||
|
AudioWorkerNodeProcessor getNode();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
JSArray getInputs();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
JSArray getOutputs();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.dom.events.EventListener;
|
||||||
|
import org.teavm.jso.dom.events.EventTarget;
|
||||||
|
|
||||||
|
public interface AudioWorkerNodeProcessor extends EventTarget {
|
||||||
|
@JSProperty("onmessage")
|
||||||
|
void setOnMessage(EventListener<MediaEvent> event);
|
||||||
|
|
||||||
|
@JSProperty("onmessage")
|
||||||
|
EventListener<MediaEvent> getOnMessage();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void postMessage(JSObject message, JSObject[] transfer);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void postMessage(JSObject message, JSObject transfer);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void postMessage(JSObject message);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface AudioWorkerParamDescriptor extends JSObject {
|
||||||
|
@JSProperty
|
||||||
|
String getName();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
float getDefaultValue();
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.typedarrays.Float32Array;
|
||||||
|
|
||||||
|
public interface BiquadFilterNode extends AudioNode {
|
||||||
|
String TYPE_LOW_PASS = "lowpass";
|
||||||
|
String TYPE_LOW_SHELF = "lowshelf";
|
||||||
|
String TYPE_HIGH_SHELF = "highshelf";
|
||||||
|
String TYPE_HIGH_PASS = "highpass";
|
||||||
|
String TYPE_BAND_PASS = "bandpass";
|
||||||
|
String TYPE_PEAKING = "peaking";
|
||||||
|
String TYPE_NOTCH = "notch";
|
||||||
|
String TYPE_ALL_PASS = "allpass";
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setType(String type);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getType();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioParam getFrequency();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioParam getDetune();
|
||||||
|
|
||||||
|
@JSProperty("Q")
|
||||||
|
AudioParam getQ();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioParam getGain();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void getFrequencyResponse(Float32Array frequencyHz, Float32Array magResponse, Float32Array phaseResponse);
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
public interface ChannelMergerNode extends AudioNode {
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
public interface ChannelSplitterNode extends AudioNode {
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface ConvolverNode extends AudioNode {
|
||||||
|
@JSProperty
|
||||||
|
void setBuffer(AudioBuffer buffer);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioBuffer getBuffer();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setNormalize(boolean normalised);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
boolean getNormalize();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSFunctor;
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
|
||||||
|
@JSFunctor
|
||||||
|
public interface DecodeErrorCallback extends JSObject {
|
||||||
|
@JSMethod
|
||||||
|
void onError(JSObject error);
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSFunctor;
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
|
||||||
|
@JSFunctor
|
||||||
|
public interface DecodeSuccessCallback extends JSObject {
|
||||||
|
@JSMethod
|
||||||
|
void onSuccess(AudioBuffer decodedData);
|
||||||
|
}
|
23
jso/apis/src/main/java/org/teavm/jso/webaudio/DelayNode.java
Normal file
23
jso/apis/src/main/java/org/teavm/jso/webaudio/DelayNode.java
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface DelayNode extends AudioNode {
|
||||||
|
@JSProperty
|
||||||
|
AudioParam getDelayTime();
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface DynamicsCompressorNode extends AudioNode {
|
||||||
|
@JSProperty
|
||||||
|
AudioParam getThreshold();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioParam getKnee();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioParam getRatio();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
float getReduction();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioParam getAttack();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioParam getRelease();
|
||||||
|
}
|
24
jso/apis/src/main/java/org/teavm/jso/webaudio/GainNode.java
Normal file
24
jso/apis/src/main/java/org/teavm/jso/webaudio/GainNode.java
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface GainNode extends AudioNode {
|
||||||
|
@JSProperty
|
||||||
|
AudioParam getGain();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.typedarrays.Float32Array;
|
||||||
|
|
||||||
|
public interface IIRFilterNode extends AudioNode {
|
||||||
|
@JSMethod
|
||||||
|
void getFrequencyResponse(Float32Array frequencyHz, Float32Array magResponse, Float32Array phaseResponse);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
public interface MediaElementAudioSourceNode extends AudioNode {
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.dom.events.Event;
|
||||||
|
|
||||||
|
public interface MediaEvent extends Event {
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
|
||||||
|
public interface MediaStream extends JSObject {
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface MediaStreamAudioDestinationNode extends AudioNode {
|
||||||
|
@JSProperty
|
||||||
|
MediaStream getStream();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
public interface MediaStreamAudioSourceNode extends AudioNode {
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface OfflineAudioCompletionEvent extends MediaEvent {
|
||||||
|
@JSProperty
|
||||||
|
AudioBuffer getRenderedBuffer();
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.dom.events.EventListener;
|
||||||
|
|
||||||
|
public abstract class OfflineAudioContext extends AudioContext {
|
||||||
|
@JSProperty("oncomplete")
|
||||||
|
public abstract void setOnComplete(EventListener<OfflineAudioCompletionEvent> event);
|
||||||
|
|
||||||
|
@JSProperty("oncomplete")
|
||||||
|
public abstract EventListener<OfflineAudioCompletionEvent> getOnComplete();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract AudioBuffer startRendering();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void resume();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
public abstract void suspend(double suspendTime);
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.dom.events.EventListener;
|
||||||
|
|
||||||
|
public interface OscillatorNode extends AudioNode {
|
||||||
|
String TYPE_SINE = "sine";
|
||||||
|
String TYPE_SQUARE = "square";
|
||||||
|
String TYPE_SAWTOOTH = "sawtooth";
|
||||||
|
String TYPE_TRIANGLE = "triangle";
|
||||||
|
String TYPE_CUSTOM = "custom";
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setType(String type);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getType();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioParam getFrequency();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
AudioParam getDetune();
|
||||||
|
|
||||||
|
@JSProperty("onended")
|
||||||
|
void setOnEnded(EventListener<MediaEvent> listener);
|
||||||
|
|
||||||
|
@JSProperty("onended")
|
||||||
|
EventListener<MediaEvent> getOnEnded();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void start(double when);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void start();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void stop(double when);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void stop();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void setPeriodicWave(PeriodicWave periodicWave);
|
||||||
|
}
|
|
@ -0,0 +1,86 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSMethod;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface PannerNode extends AudioNode {
|
||||||
|
String MODEL_EQUALPOWER = "equalpower";
|
||||||
|
String MODEL_HRTF = "HRTF";
|
||||||
|
|
||||||
|
String DISTANCE_MODEL_LINEAR = "linear";
|
||||||
|
String DISTANCE_MODEL_INVERSE = "inverse";
|
||||||
|
String DISTANCE_MODEL_EXPONENTIAL = "exponential";
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setPanningModel(String value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getPanningModel();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setDistanceModel(String value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getDistanceModel();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setRefDistance(float value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
float getRefDistance();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setMaxDistance(float value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
float getMaxDistance();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setRolloffFactor(float value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
float getRolloffFactor();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setConeInnerAngle(float value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
float getConeInnerAngle();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setConeOuterAngle(float value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
float getConeOuterAngle();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setConeOuterGain(float value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
float getConeOuterGain();
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void setPosition(float x, float y, float z);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void setOrientation(float x, float y, float z);
|
||||||
|
|
||||||
|
@JSMethod
|
||||||
|
void setVelocity(float x, float y, float z);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
|
||||||
|
public interface PeriodicWave extends JSObject {
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSObject;
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface PeriodicWaveConstraints extends JSObject {
|
||||||
|
@JSProperty
|
||||||
|
void setDisableNormalization(boolean value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
boolean getDisableNormalization();
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.dom.events.EventListener;
|
||||||
|
|
||||||
|
public interface ScriptProcessorNode extends AudioNode {
|
||||||
|
@JSProperty("onaudioprocess")
|
||||||
|
EventListener<AudioProcessingEvent> getOnAudioProcess();
|
||||||
|
|
||||||
|
@JSProperty("onaudioprocess")
|
||||||
|
void setOnAudioProcess(EventListener<AudioProcessingEvent> event);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
int getBufferSize();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
|
||||||
|
public interface StereoPannerNode extends AudioNode {
|
||||||
|
@JSProperty
|
||||||
|
AudioParam getPan();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.jso.webaudio;
|
||||||
|
|
||||||
|
import org.teavm.jso.JSProperty;
|
||||||
|
import org.teavm.jso.typedarrays.Float32Array;
|
||||||
|
|
||||||
|
public interface WaveShaperNode extends AudioNode {
|
||||||
|
String OVERSAMPLE_NONE = "none";
|
||||||
|
String OVERSAMPLE_2X = "2x";
|
||||||
|
String OVERSAMPLE_4X = "4x";
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setCurve(Float32Array value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
Float32Array getCurve();
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
void setOversample(String value);
|
||||||
|
|
||||||
|
@JSProperty
|
||||||
|
String getOversample();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user