forked from WorldStarHipHopX/playforia
-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No functional changes intended. Code changes except for renaming things: - remove hardcoded static strings - remove unnecessary escapes from debug log strings
- Loading branch information
Showing
3 changed files
with
73 additions
and
78 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.aapeli.client; | ||
|
||
import java.applet.Applet; | ||
import java.applet.AudioClip; | ||
import java.net.URL; | ||
|
||
class SoundClip { | ||
|
||
private Applet applet; | ||
private URL dir; | ||
private String file; | ||
private boolean debug; | ||
private AudioClip audioClip; | ||
private boolean defined; | ||
|
||
|
||
protected SoundClip(Applet applet, URL dir, String file, boolean debug) { | ||
this.applet = applet; | ||
this.dir = dir; | ||
this.file = file; | ||
this.debug = debug; | ||
this.audioClip = null; | ||
this.defined = false; | ||
} | ||
|
||
protected boolean isDefined() { | ||
return this.defined; | ||
} | ||
|
||
protected void defineClip() { | ||
if (!this.defined) { | ||
if (this.debug) { | ||
System.out.println("SoundClip.defineClip(): 'dir'=\"" + this.dir + "\", 'file'=\"" + this.file + "\""); | ||
} | ||
|
||
//todo this.audioClip = this.applet.getAudioClip(this.dir, this.file); | ||
URL url = dir; | ||
try { | ||
url = new URL(dir, file); | ||
} catch (Exception ex) { | ||
System.out.println("SoundClip.defineClip(): failed to load sound clip"); | ||
} | ||
audioClip = Applet.newAudioClip(url); | ||
this.defined = true; | ||
} | ||
} | ||
|
||
protected AudioClip getAudioClip() { | ||
return this.audioClip; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters