Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.help > #1520
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.java.help |
| Subject | Re: getting sound on side of the preferred size |
| Date | 2012-01-21 09:22 -0500 |
| Organization | A noiseless patient Spider |
| Message-ID | <jfeh6n$vac$1@dont-email.me> (permalink) |
| References | <1f66bafb-babb-48e3-a183-8e671984dd85@f11g2000yql.googlegroups.com> |
On 01/20/2012 02:45 PM, Michael Adedeji wrote:
> Hey guys, I want the sound in this program to sound at six different
> places on the preffered size of the screen. There should be upper
> right and lower right sound, upper and lower left sound and last upper
> and lower middle sound. Currently the sound below is just for the four
> sides of the prefferred size of the screen...but am thinking of a way
> to divide the sound into six different part. any help is
> appreciated :)
>
import java.awt.geom.Area;
import java.awt.geom.Point2D;
import java.util.HashSet;
import java.util.Set;
import javax.sound.sampled.Clip;
public class Scratch {
private class MyRegion {
private Area area;
private Clip clip;
public MyRegion(Area area, Clip clip) {
this.area = area;
this.clip = clip;
}
public boolean contains(Area area) {
return false;
}
public boolean contains(Point2D point) {
return false;
}
public void playClip() {
}
}
public static void main(String[] args) {
Set<MyRegion> regions = new HashSet<MyRegion>();
// setup some regions
Point2D bouncingBallLocation = null;
// initialize bouncingBallLocation
while(true) {
for(MyRegion region : regions) {
if(region.contains(bouncingBallLocation)) {
region.playClip();
}
}
// bouncingBallLocation changes
}
}
}
Back to comp.lang.java.help | Previous | Next — Previous in thread | Find similar
getting sound on side of the preferred size Michael Adedeji <yankosmgt@gmail.com> - 2012-01-20 11:45 -0800 Re: getting sound on side of the preferred size Jeff Higgins <jeff@invalid.invalid> - 2012-01-21 09:22 -0500
csiph-web