Skip to content

Commit 6e3657b

Browse files
committed
backup
1 parent 8b1d132 commit 6e3657b

7 files changed

+51
-5
lines changed

dom/src/main/scala/org/scalajs/dom/AudioBufferSourceNodeOptions.scala

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ trait AudioBufferSourceNodeOptions extends js.Object {
1414
var loopEnd: js.UndefOr[Double] = js.undefined
1515
var detune: js.UndefOr[Double] = js.undefined
1616
var playbackRate: js.UndefOr[Double] = js.undefined
17+
var channelCount: js.UndefOr[Int] = js.undefined
18+
var channelCountMode: js.UndefOr[AudioNodeChannelCountMode] = js.undefined
19+
var channelInterpretation: js.UndefOr[AudioNodeChannelInterpretation] = js.undefined
1720
}
18-

dom/src/main/scala/org/scalajs/dom/AudioNodeChannelCountMode.scala

-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ object AudioNodeChannelCountMode {
1414
val max: AudioNodeChannelCountMode = "max".asInstanceOf[AudioNodeChannelCountMode]
1515
val `clamped-max`: AudioNodeChannelCountMode = "clamped-max".asInstanceOf[AudioNodeChannelCountMode]
1616
val explicit: AudioNodeChannelCountMode = "explicit".asInstanceOf[AudioNodeChannelCountMode]
17-
1817
}

dom/src/main/scala/org/scalajs/dom/AudioParam.scala

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ trait AudioParam extends AudioNode {
3636
/** Represents the initial value of the attributes as defined by the specific AudioNode creating the AudioParam. */
3737
val defaultValue: Double = js.native
3838

39+
val maxValue: Double = js.native
40+
41+
val minValue: Double = js.native
42+
3943
/** Schedules an instant change to the value of the AudioParam at a precise time, as measured against
4044
* AudioContext.currentTime. The new value is given in the value parameter.
4145
*

dom/src/main/scala/org/scalajs/dom/MediaElementAudioSourceNode.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import scala.scalajs.js.annotation._
2323
*/
2424
@JSGlobal
2525
@js.native
26-
class MediaElementAudioSourceNode(ctx: BaseAudioContext, options: MediaElementAudioSourceNodeOptions)
26+
class MediaElementAudioSourceNode(context: BaseAudioContext, options: MediaElementAudioSourceNodeOptions)
2727
extends AudioNode {
2828
val mediaElement: HTMLMediaElement = js.native
2929
}

dom/src/main/scala/org/scalajs/dom/OscillatorNode.scala

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package org.scalajs.dom
77

88
import scala.scalajs.js
9+
import scala.scalajs.js.annotation._
910

1011
/** The OscillatorNode interface represents a periodic waveform, like a sine wave. It is an AudioNode audio-processing
1112
* module that causes a given frequency of sine wave to be created — in effect, a constant tone.
@@ -19,8 +20,10 @@ import scala.scalajs.js
1920
* - Channel count: 2 (not used in the default count mode)
2021
* - Channel interpretation: speakers
2122
*/
23+
@JSGlobal
2224
@js.native
23-
trait OscillatorNode extends AudioScheduledSourceNode {
25+
class OscillatorNode(context: BaseAudioContext, options: OscillatorNodeOptions = js.native)
26+
extends AudioScheduledSourceNode {
2427

2528
/** An a-rate AudioParam representing the frequency of oscillation in hertz (though the AudioParam returned is
2629
* read-only, the value it represents is not.)
@@ -33,7 +36,7 @@ trait OscillatorNode extends AudioScheduledSourceNode {
3336
var detune: AudioParam = js.native
3437

3538
/** Represents the shape of the oscillator wave generated. Different waves will produce different tones. */
36-
var `type`: String = js.native // Not sure if this is correct ...
39+
var `type`: OscillatorNodeType = js.native // Not sure if this is correct ...
3740

3841
/** Used to point to a PeriodicWave defining a periodic waveform that can be used to shape the oscillator's output,
3942
* when type = "custom" is used.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/** Documentation is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API and available
2+
* under the Creative Commons Attribution-ShareAlike v2.5 or later. http://creativecommons.org/licenses/by-sa/2.5/
3+
*
4+
* Everything else is under the MIT License http://opensource.org/licenses/MIT
5+
*/
6+
package org.scalajs.dom
7+
8+
import scala.scalajs.js
9+
10+
trait OscillatorNodeOptions extends js.Object {
11+
var `type`: js.UndefOr[OscillatorNodeType] = js.undefined
12+
var detune: js.UndefOr[Double] = js.undefined
13+
var frequency: js.UndefOr[Double] = js.undefined
14+
var periodicWave: js.UndefOr[PeriodicWave] = js.undefined
15+
var channelCount: js.UndefOr[Int] = js.undefined
16+
var channelCountMode: js.UndefOr[AudioNodeChannelCountMode] = js.undefined
17+
var channelInterpretation: js.UndefOr[AudioNodeChannelInterpretation] = js.undefined
18+
}
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/** Documentation is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API and available
2+
* under the Creative Commons Attribution-ShareAlike v2.5 or later. http://creativecommons.org/licenses/by-sa/2.5/
3+
*
4+
* Everything else is under the MIT License http://opensource.org/licenses/MIT
5+
*/
6+
package org.scalajs.dom
7+
8+
import scala.scalajs.js
9+
10+
@js.native
11+
sealed trait OscillatorNodeType extends js.Any
12+
13+
object OscillatorNodeType {
14+
val sine: OscillatorNodeType = "sine".asInstanceOf[OscillatorNodeType]
15+
val square: OscillatorNodeType = "square".asInstanceOf[OscillatorNodeType]
16+
val sawtooth: OscillatorNodeType = "sawtooth".asInstanceOf[OscillatorNodeType]
17+
val triangle: OscillatorNodeType = "triangle".asInstanceOf[OscillatorNodeType]
18+
val custom: OscillatorNodeType = "custom".asInstanceOf[OscillatorNodeType]
19+
}

0 commit comments

Comments
 (0)