Skip to content

Commit c1eadec

Browse files
j-f1Strega's Gate
andcommitted
Add patch for AudioNode.connect
Co-Authored-By: Strega's Gate <55062873+stregasgate@users.noreply.github.com>
1 parent d0e88c2 commit c1eadec

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

Patches/WebAudio.patch

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
diff --git a/Sources/WebAudio/Generated.swift b/Sources/WebAudio/Generated.swift
2-
index 35bbf34..770a8e8 100644
2+
index fc5553f..590831f 100644
33
--- a/Sources/WebAudio/Generated.swift
44
+++ b/Sources/WebAudio/Generated.swift
5-
@@ -194,7 +194,8 @@ public class AudioBufferSourceNode: AudioScheduledSourceNode {
5+
@@ -195,7 +195,8 @@ public class AudioBufferSourceNode: AudioScheduledSourceNode {
66
@ReadWriteAttribute
77
public var loopEnd: Double
8-
8+
99
- @inlinable override public func start(when: Double? = nil, offset: Double? = nil, duration: Double? = nil) {
1010
+ // `override` removed since the superclass function has fewer parameters
1111
+ @inlinable func start(when: Double? = nil, offset: Double? = nil, duration: Double? = nil) {
1212
let this = jsObject
1313
_ = this[Strings.start].function!(this: this, arguments: [_toJSValue(when), _toJSValue(offset), _toJSValue(duration)])
1414
}
15+
@@ -492,7 +493,7 @@ public class AudioNode: EventTarget {
16+
super.init(unsafelyWrapping: jsObject)
17+
}
18+
19+
- @inlinable public func connect(destinationNode: AudioNode, output: UInt32? = nil, input: UInt32? = nil) -> Self {
20+
+ @discardableResult @inlinable public func connect<NodeType: AudioNode>(destinationNode: NodeType, output: UInt32? = nil, input: UInt32? = nil) -> NodeType {
21+
let this = jsObject
22+
return this[Strings.connect].function!(this: this, arguments: [_toJSValue(destinationNode), _toJSValue(output), _toJSValue(input)]).fromJSValue()!
23+
}

Sources/WebAudio/Generated.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ public class AudioNode: EventTarget {
493493
super.init(unsafelyWrapping: jsObject)
494494
}
495495

496-
@inlinable public func connect(destinationNode: AudioNode, output: UInt32? = nil, input: UInt32? = nil) -> Self {
496+
@discardableResult @inlinable public func connect<NodeType: AudioNode>(destinationNode: NodeType, output: UInt32? = nil, input: UInt32? = nil) -> NodeType {
497497
let this = jsObject
498498
return this[Strings.connect].function!(this: this, arguments: [_toJSValue(destinationNode), _toJSValue(output), _toJSValue(input)]).fromJSValue()!
499499
}

0 commit comments

Comments
 (0)