Skip to content

Commit

Permalink
Only need one kind of script for both effects and tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
ultraq committed Feb 4, 2024
1 parent 8f02328 commit 5d88262
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ class MediaPlayer extends Application {

var media = switch (mediaFile) {
case ImageFile -> new Canvas(mediaFile)
case SoundFile -> new Sound(mediaFile)
.attachScript(mediaFile.forStreaming ? new SoundTrackScript() : new SoundEffectScript())
case SoundFile -> new Sound(mediaFile).attachScript(new SoundPlaybackScript())
default -> throw new UnsupportedOperationException("No media script for the associated file class of ${mediaFile}")
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ import nz.net.ultraq.redhorizon.engine.scenegraph.scripting.Script
import static org.lwjgl.glfw.GLFW.GLFW_KEY_SPACE

/**
* A script to control playback of a sound effect. This script will stream the
* data to the sound during playback.
* A script to control playback of a sound effect or track.
*
* @author Emanuel Rabina
*/
class SoundTrackScript extends Script<Sound> {
class SoundPlaybackScript extends Script<Sound> {

@Delegate
private Sound applyDelegate() {
Expand Down

0 comments on commit 5d88262

Please sign in to comment.