/
AudioStreamPlayer.hx
164 lines (131 loc) · 4.01 KB
/
AudioStreamPlayer.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
Plays an audio stream non-positionally.
To play audio positionally, use `godot.AudioStreamPlayer2D` or `godot.AudioStreamPlayer3D` instead of `godot.AudioStreamPlayer`.
**/
@:libType
@:csNative
@:native("Godot.AudioStreamPlayer")
@:autoBuild(godot.Godot.buildUserClass())
extern class AudioStreamPlayer extends godot.Node {
/**
`finished` signal.
**/
public var onFinished(get, never):Signal<Void->Void>;
@:dox(hide) @:noCompletion inline function get_onFinished():Signal<Void->Void> {
return new Signal(this, "finished", Signal.SignalHandlerVoidVoid.connectSignal, Signal.SignalHandlerVoidVoid.disconnectSignal, Signal.SignalHandlerVoidVoid.isSignalConnected);
}
/**
Bus on which this audio is playing.
**/
@:native("Bus")
public var bus:std.String;
/**
If the audio configuration has more than two speakers, this sets the target channels. See `godot.AudioStreamPlayer_MixTargetEnum` constants.
**/
@:native("MixTarget")
public var mixTarget:godot.AudioStreamPlayer_MixTargetEnum;
/**
If `true`, the playback is paused. You can resume it by setting `stream_paused` to `false`.
**/
@:native("StreamPaused")
public var streamPaused:Bool;
/**
If `true`, audio plays when added to scene tree.
**/
@:native("Autoplay")
public var autoplay:Bool;
/**
If `true`, audio is playing.
**/
@:native("Playing")
public var playing:Bool;
/**
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
**/
@:native("PitchScale")
public var pitchScale:Single;
/**
Volume of sound, in dB.
**/
@:native("VolumeDb")
public var volumeDb:Single;
/**
The `godot.AudioStream` object to be played.
**/
@:native("Stream")
public var stream:godot.AudioStream;
@:native("new")
public function new():Void;
@:native("SetStream")
public function setStream(stream:godot.AudioStream):Void;
@:native("GetStream")
public function getStream():godot.AudioStream;
@:native("SetVolumeDb")
public function setVolumeDb(volumeDb:Single):Void;
@:native("GetVolumeDb")
public function getVolumeDb():Single;
@:native("SetPitchScale")
public function setPitchScale(pitchScale:Single):Void;
@:native("GetPitchScale")
public function getPitchScale():Single;
#if doc_gen
/**
Plays the audio from the given `from_position`, in seconds.
**/
@:native("Play")
public function play(?fromPosition:Single):Void;
#else
/**
Plays the audio from the given `from_position`, in seconds.
**/
@:native("Play")
public overload function play():Void;
/**
Plays the audio from the given `from_position`, in seconds.
**/
@:native("Play")
public overload function play(fromPosition:Single):Void;
#end
/**
Sets the position from which audio will be played, in seconds.
**/
@:native("Seek")
public function seek(toPosition:Single):Void;
/**
Stops the audio.
**/
@:native("Stop")
public function stop():Void;
@:native("IsPlaying")
public function isPlaying():Bool;
/**
Returns the position in the `godot.AudioStream` in seconds.
**/
@:native("GetPlaybackPosition")
public function getPlaybackPosition():Single;
@:native("SetBus")
public function setBus(bus:std.String):Void;
@:native("GetBus")
public function getBus():std.String;
@:native("SetAutoplay")
public function setAutoplay(enable:Bool):Void;
@:native("IsAutoplayEnabled")
public function isAutoplayEnabled():Bool;
@:native("SetMixTarget")
public function setMixTarget(mixTarget:godot.AudioStreamPlayer_MixTargetEnum):Void;
@:native("GetMixTarget")
public function getMixTarget():godot.AudioStreamPlayer_MixTargetEnum;
@:native("SetStreamPaused")
public function setStreamPaused(pause:Bool):Void;
@:native("GetStreamPaused")
public function getStreamPaused():Bool;
/**
Returns the `godot.AudioStreamPlayback` object associated with this `godot.AudioStreamPlayer`.
**/
@:native("GetStreamPlayback")
public function getStreamPlayback():godot.AudioStreamPlayback;
}