LNXSDK/Kha/Backends/WPF/kha/audio1/WpfMusicChannel.hx

22 lines
431 B
Haxe
Raw Normal View History

2025-01-22 16:18:30 +01:00
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;
}
}
}