Skip to content

Commit a4edff5

Browse files
committed
Switch encoding for mima.
1 parent b91df37 commit a4edff5

File tree

6 files changed

+50
-12
lines changed

6 files changed

+50
-12
lines changed

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
package org.scalajs.dom
77

88
import scala.scalajs.js
9-
import scala.scalajs.js.annotation._
109

1110
/** AudioBufferSourceNode has no input and exactly one output. The number of channels in the output corresponds to the
1211
* number of channels of the AudioBuffer that is set to the AudioBufferSourceNode.buffer property. If there is no
@@ -24,10 +23,8 @@ import scala.scalajs.js.annotation._
2423
* - Number of outputs: 1
2524
* - Channel count: defined by the associated AudioBuffer
2625
*/
27-
@JSGlobal
2826
@js.native
29-
class AudioBufferSourceNode(context: BaseAudioContext, options: AudioBufferSourceNodeOptions = js.native)
30-
extends AudioScheduledSourceNode {
27+
trait AudioBufferSourceNode extends AudioScheduledSourceNode {
3128

3229
/** Is an AudioBuffer that defines the audio asset to be played, or when set to the value null, defines a single
3330
* channel of silence.
@@ -71,3 +68,15 @@ class AudioBufferSourceNode(context: BaseAudioContext, options: AudioBufferSourc
7168
def start(when: Double, offset: Double): Unit = js.native
7269

7370
}
71+
72+
object AudioBufferSourceNode {
73+
74+
import js.`|`.undefOr2jsAny
75+
76+
def apply(context: BaseAudioContext,
77+
options: js.UndefOr[AudioBufferSourceNodeOptions] = js.undefined): AudioBufferSourceNode = {
78+
js.Dynamic
79+
.newInstance(js.Dynamic.global.AudioBufferSourceNode)(context, options)
80+
.asInstanceOf[AudioBufferSourceNode]
81+
}
82+
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
package org.scalajs.dom
77

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

11+
@JSGlobal
1012
@js.native
11-
trait ConstantSourceNode extends AudioScheduledSourceNode {
13+
class ConstantSourceNode(context: BaseAudioContext, options: ConstantSourceNodeOptions = js.native)
14+
extends AudioScheduledSourceNode {
1215

1316
// TODO
1417
val offset: AudioParam = js.native
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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 ConstantSourceNodeOptions extends js.Object {
11+
var offset: js.UndefOr[Double] = js.undefined
12+
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ trait GainNode extends AudioNode {
3232

3333
object GainNode {
3434

35-
def apply(context: BaseAudioContext, options: js.UndefOr[GainNodeOptions] = js.undefined): GainNode =
35+
import js.`|`.undefOr2jsAny
36+
37+
def apply(context: BaseAudioContext, options: js.UndefOr[GainNodeOptions] = js.undefined): GainNode = {
3638
js.Dynamic.newInstance(js.Dynamic.global.GainNode)(context, options).asInstanceOf[GainNode]
39+
}
3740
}

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
package org.scalajs.dom
77

88
import scala.scalajs.js
9-
import scala.scalajs.js.annotation._
109

1110
/** The MediaElementAudioSourceNode interface represents an audio source consisting of an HTML5 <audio> or
1211
* <video> element. It is an AudioNode that acts as an audio source.
@@ -21,9 +20,19 @@ import scala.scalajs.js.annotation._
2120
* - Channel count: defined by the media in the HTMLMediaElement passed to the AudioContext.createMediaElementSource
2221
* method that created it.
2322
*/
24-
@JSGlobal
2523
@js.native
26-
class MediaElementAudioSourceNode(context: BaseAudioContext, options: MediaElementAudioSourceNodeOptions)
27-
extends AudioNode {
24+
trait MediaElementAudioSourceNode extends AudioNode {
2825
val mediaElement: HTMLMediaElement = js.native
2926
}
27+
28+
object MediaElementAudioSourceNode {
29+
30+
import js.`|`.undefOr2jsAny
31+
32+
def apply(context: BaseAudioContext,
33+
options: js.UndefOr[MediaElementAudioSourceNodeOptions] = js.undefined): MediaElementAudioSourceNode = {
34+
js.Dynamic
35+
.newInstance(js.Dynamic.global.MediaElementAudioSourceNode)(context, options)
36+
.asInstanceOf[MediaElementAudioSourceNode]
37+
}
38+
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ import scala.scalajs.js
2020
* - Channel interpretation: speakers
2121
*/
2222
@js.native
23-
trait OscillatorNode
24-
extends AudioScheduledSourceNode {
23+
trait OscillatorNode extends AudioScheduledSourceNode {
2524

2625
/** An a-rate AudioParam representing the frequency of oscillation in hertz (though the AudioParam returned is
2726
* read-only, the value it represents is not.)
@@ -45,6 +44,9 @@ trait OscillatorNode
4544
}
4645

4746
object OscillatorNode {
47+
48+
import js.`|`.undefOr2jsAny
49+
4850
def apply(context: BaseAudioContext, options: js.UndefOr[OscillatorNodeOptions] = js.undefined): OscillatorNode =
4951
js.Dynamic.newInstance(js.Dynamic.global.OscillatorNode)(context, options).asInstanceOf[OscillatorNode]
5052
}

0 commit comments

Comments
 (0)