From 1e2ae2821fb2539da090cc09d21a1be6a1c15527 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sun, 9 Jan 2022 18:48:10 -0700 Subject: [PATCH] stopSound --- src/hollywoo/Director.hx | 1 + src/hollywoo/Movie.kiss | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/hollywoo/Director.hx b/src/hollywoo/Director.hx index d144a7f..1ad58e5 100644 --- a/src/hollywoo/Director.hx +++ b/src/hollywoo/Director.hx @@ -18,6 +18,7 @@ interface Director, toPos:StagePosition, toFacing:StageFacing, cc:Continuation):Void; function swapCharacters(a:Character, b:Character, cc:Continuation):Void; function playSound(sound:Sound, volumeMod:Float, waitForEnd:Bool, cc:Continuation):Void; + function stopSound(sound:Sound):Void; function playSong(song:Song, volumeMod:Float, loop:Bool, waitForEnd:Bool, cc:Continuation):Void; function stopSong():Void; function playVoiceTrack(track:VoiceTrack, volumeMod:Float, start:Float, end:Float, cc:Continuation):Void; diff --git a/src/hollywoo/Movie.kiss b/src/hollywoo/Movie.kiss index 087e864..3779139 100644 --- a/src/hollywoo/Movie.kiss +++ b/src/hollywoo/Movie.kiss @@ -194,6 +194,10 @@ (hollywooMethod awaitPlaySound true [name :Continuation cc &opt :Float volumeMod] (playSound name cc volumeMod true)) +(hollywooMethod stopSound true [name :Continuation cc] + (director.stopSound (dictGet sounds name)) + (cc)) + (hollywooMethod newSong true [name :Song song] (assert isLoading) (dictSet songs name song))