Update Files
This commit is contained in:
21
Kha/Backends/WPF/kha/audio1/WpfMusicChannel.hx
Normal file
21
Kha/Backends/WPF/kha/audio1/WpfMusicChannel.hx
Normal file
@ -0,0 +1,21 @@
|
||||
package kha.audio1;
|
||||
|
||||
import system.windows.controls.MediaElement;
|
||||
|
||||
class WpfMusicChannel extends WpfSoundChannel implements kha.audio1.MusicChannel {
|
||||
var looping: Bool = false;
|
||||
|
||||
public function new(filename: String, looping: Bool) {
|
||||
super(filename);
|
||||
this.looping = looping;
|
||||
}
|
||||
|
||||
override function OnMediaEnded(obj: Dynamic, e: RoutedEventArgs): Void {
|
||||
if (looping) {
|
||||
play();
|
||||
}
|
||||
else {
|
||||
hasFinished = true;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user